gobject-introspection r339 - in trunk: . girepository tests/invoke tools



Author: johan
Date: Sat Aug  9 12:55:32 2008
New Revision: 339
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=339&view=rev

Log:
2008-08-09  Johan Dahlin  <johan gnome org>

    * *.[ch]:
    Rename metadata to typelib in variable names,
    comments and apis.



Modified:
   trunk/ChangeLog
   trunk/girepository/ginfo.c
   trunk/girepository/ginvoke.c
   trunk/girepository/girepository.c
   trunk/girepository/girepository.h
   trunk/girepository/girmodule.c
   trunk/girepository/girmodule.h
   trunk/girepository/girnode.c
   trunk/girepository/girnode.h
   trunk/girepository/gtypelib.c
   trunk/girepository/gtypelib.h
   trunk/tests/invoke/invoke.c
   trunk/tools/compiler.c
   trunk/tools/generate.c

Modified: trunk/girepository/ginfo.c
==============================================================================
--- trunk/girepository/ginfo.c	(original)
+++ trunk/girepository/ginfo.c	Sat Aug  9 12:55:32 2008
@@ -32,7 +32,7 @@
   gint ref_count;
   GIBaseInfo *container;
 
-  GTypelib *metadata;
+  GTypelib *typelib;
   guint32 offset;
 };
 
@@ -136,7 +136,7 @@
 GIBaseInfo *
 g_info_new (GIInfoType     type,
 	    GIBaseInfo    *container,
-	    GTypelib     *metadata, 
+	    GTypelib     *typelib, 
 	    guint32        offset)
 {
   GIBaseInfo *info;
@@ -146,7 +146,7 @@
   info->ref_count = 1;
   info->type = type;
 
-  info->metadata = metadata;
+  info->typelib = typelib;
   info->offset = offset;
 
   if (container)
@@ -156,18 +156,18 @@
 }
 
 static GIBaseInfo *
-g_info_from_entry (GTypelib *metadata,
+g_info_from_entry (GTypelib *typelib,
 		   guint16    index)
 {
   GIBaseInfo *result;
-  DirEntry *entry = g_typelib_get_dir_entry (metadata, index);
+  DirEntry *entry = g_typelib_get_dir_entry (typelib, index);
   
   if (entry->local)
-    result = g_info_new (entry->blob_type, NULL, metadata, entry->offset);
+    result = g_info_new (entry->blob_type, NULL, typelib, entry->offset);
   else 
     {
-      const gchar *namespace = g_typelib_get_string (metadata, entry->offset);
-      const gchar *name = g_typelib_get_string (metadata, entry->name);
+      const gchar *namespace = g_typelib_get_string (typelib, entry->offset);
+      const gchar *name = g_typelib_get_string (typelib, entry->name);
       
       GIRepository *repository = g_irepository_get_default ();
       
@@ -238,57 +238,57 @@
     case GI_INFO_TYPE_ERROR_DOMAIN:
     case GI_INFO_TYPE_UNION:
       {
-	CommonBlob *blob = (CommonBlob *)&info->metadata->data[info->offset];
+	CommonBlob *blob = (CommonBlob *)&info->typelib->data[info->offset];
 
-	return g_typelib_get_string (info->metadata, blob->name);
+	return g_typelib_get_string (info->typelib, blob->name);
       }
       break;
 
     case GI_INFO_TYPE_VALUE:
       {
-	ValueBlob *blob = (ValueBlob *)&info->metadata->data[info->offset];
+	ValueBlob *blob = (ValueBlob *)&info->typelib->data[info->offset];
 
-	return g_typelib_get_string (info->metadata, blob->name);
+	return g_typelib_get_string (info->typelib, blob->name);
       }
       break;
 
     case GI_INFO_TYPE_SIGNAL:
       {
-	SignalBlob *blob = (SignalBlob *)&info->metadata->data[info->offset];
+	SignalBlob *blob = (SignalBlob *)&info->typelib->data[info->offset];
 
-	return g_typelib_get_string (info->metadata, blob->name);
+	return g_typelib_get_string (info->typelib, blob->name);
       }
       break;
 
     case GI_INFO_TYPE_PROPERTY:
       {
-	PropertyBlob *blob = (PropertyBlob *)&info->metadata->data[info->offset];
+	PropertyBlob *blob = (PropertyBlob *)&info->typelib->data[info->offset];
 
-	return g_typelib_get_string (info->metadata, blob->name);
+	return g_typelib_get_string (info->typelib, blob->name);
       }
       break;
 
     case GI_INFO_TYPE_VFUNC:
       {
-	VFuncBlob *blob = (VFuncBlob *)&info->metadata->data[info->offset];
+	VFuncBlob *blob = (VFuncBlob *)&info->typelib->data[info->offset];
 
-	return g_typelib_get_string (info->metadata, blob->name);
+	return g_typelib_get_string (info->typelib, blob->name);
       }
       break;
 
     case GI_INFO_TYPE_FIELD:
       {
-	FieldBlob *blob = (FieldBlob *)&info->metadata->data[info->offset];
+	FieldBlob *blob = (FieldBlob *)&info->typelib->data[info->offset];
 	
-	return g_typelib_get_string (info->metadata, blob->name);
+	return g_typelib_get_string (info->typelib, blob->name);
       }
       break;
 
     case GI_INFO_TYPE_ARG:
       {
-	ArgBlob *blob = (ArgBlob *)&info->metadata->data[info->offset];
+	ArgBlob *blob = (ArgBlob *)&info->typelib->data[info->offset];
 	
-	return g_typelib_get_string (info->metadata, blob->name);
+	return g_typelib_get_string (info->typelib, blob->name);
       }
       break;
 
@@ -311,7 +311,7 @@
 const gchar *
 g_base_info_get_namespace (GIBaseInfo *info)
 {
-  Header *header = (Header *)info->metadata->data;  
+  Header *header = (Header *)info->typelib->data;  
 
   if (info->type == GI_INFO_TYPE_UNRESOLVED)
     {
@@ -320,7 +320,7 @@
       return unresolved->namespace;
     }
 
-  return g_typelib_get_string (info->metadata, header->namespace);
+  return g_typelib_get_string (info->typelib, header->namespace);
 }
 
 gboolean 
@@ -339,7 +339,7 @@
     case GI_INFO_TYPE_CONSTANT:
     case GI_INFO_TYPE_ERROR_DOMAIN:
       {
-	CommonBlob *blob = (CommonBlob *)&info->metadata->data[info->offset];
+	CommonBlob *blob = (CommonBlob *)&info->typelib->data[info->offset];
 
 	return blob->deprecated;
       }
@@ -347,7 +347,7 @@
 
     case GI_INFO_TYPE_VALUE:
       {
-	ValueBlob *blob = (ValueBlob *)&info->metadata->data[info->offset];
+	ValueBlob *blob = (ValueBlob *)&info->typelib->data[info->offset];
 
 	return blob->deprecated;
       }
@@ -355,7 +355,7 @@
 
     case GI_INFO_TYPE_SIGNAL:
       {
-	SignalBlob *blob = (SignalBlob *)&info->metadata->data[info->offset];
+	SignalBlob *blob = (SignalBlob *)&info->typelib->data[info->offset];
 
 	return blob->deprecated;
       }
@@ -363,7 +363,7 @@
 
     case GI_INFO_TYPE_PROPERTY:
       {
-	PropertyBlob *blob = (PropertyBlob *)&info->metadata->data[info->offset];
+	PropertyBlob *blob = (PropertyBlob *)&info->typelib->data[info->offset];
 
 	return blob->deprecated;
       }
@@ -401,14 +401,14 @@
 			    const gchar *name)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  Header *header = (Header *)base->metadata->data;
+  Header *header = (Header *)base->typelib->data;
   AnnotationBlob blob, *first, *after, *res, *next;
   const gchar *rname;
 
   blob.offset = base->offset;
   
-  first = (AnnotationBlob *) &base->metadata->data[header->annotations];
-  after = (AnnotationBlob *) &base->metadata->data[header->annotations + 
+  first = (AnnotationBlob *) &base->typelib->data[header->annotations];
+  after = (AnnotationBlob *) &base->typelib->data[header->annotations + 
 					     header->n_annotations * header->annotation_blob_size];
 
   res = bsearch (&blob, first, header->n_annotations,
@@ -430,9 +430,9 @@
     {
       res = next;
       
-      rname = g_typelib_get_string (base->metadata, res->name);
+      rname = g_typelib_get_string (base->typelib, res->name);
       if (strcmp (name, rname) == 0)
-	return g_typelib_get_string (base->metadata, res->value);
+	return g_typelib_get_string (base->typelib, res->value);
 
       next = res += header->annotation_blob_size;
     }
@@ -448,9 +448,9 @@
 }
 
 GTypelib *
-g_base_info_get_metadata (GIBaseInfo *info)
+g_base_info_get_typelib (GIBaseInfo *info)
 {
-  return info->metadata;
+  return info->typelib;
 }
 
 /* GIFunctionInfo functions */
@@ -458,9 +458,9 @@
 g_function_info_get_symbol (GIFunctionInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  FunctionBlob *blob = (FunctionBlob *)&base->metadata->data[base->offset];
+  FunctionBlob *blob = (FunctionBlob *)&base->typelib->data[base->offset];
 
-  return g_typelib_get_string (base->metadata, blob->symbol);
+  return g_typelib_get_string (base->typelib, blob->symbol);
 }
 
 GIFunctionInfoFlags
@@ -468,7 +468,7 @@
 {
   GIFunctionInfoFlags flags;
   GIBaseInfo *base = (GIBaseInfo *)info;
-  FunctionBlob *blob = (FunctionBlob *)&base->metadata->data[base->offset];
+  FunctionBlob *blob = (FunctionBlob *)&base->typelib->data[base->offset];
   
   flags = 0;
 
@@ -494,7 +494,7 @@
 g_function_info_get_property (GIFunctionInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  FunctionBlob *blob = (FunctionBlob *)&base->metadata->data[base->offset];
+  FunctionBlob *blob = (FunctionBlob *)&base->typelib->data[base->offset];
   GIInterfaceInfo *container = (GIInterfaceInfo *)base->container;
   
   return g_interface_info_get_property (container, blob->index);  
@@ -504,7 +504,7 @@
 g_function_info_get_vfunc (GIFunctionInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  FunctionBlob *blob = (FunctionBlob *)&base->metadata->data[base->offset];
+  FunctionBlob *blob = (FunctionBlob *)&base->typelib->data[base->offset];
   GIInterfaceInfo *container = (GIInterfaceInfo *)base->container;
   
   return g_interface_info_get_vfunc (container, blob->index);  
@@ -519,10 +519,10 @@
     {
     case GI_INFO_TYPE_FUNCTION:
     case GI_INFO_TYPE_VFUNC:
-      return *(guint32 *)&info->base.metadata->data[info->base.offset + 12];
+      return *(guint32 *)&info->base.typelib->data[info->base.offset + 12];
     case GI_INFO_TYPE_CALLBACK:
     case GI_INFO_TYPE_SIGNAL:
-      return *(guint32 *)&info->base.metadata->data[info->base.offset + 8];
+      return *(guint32 *)&info->base.typelib->data[info->base.offset + 8];
     }
   
   return 0;
@@ -530,12 +530,12 @@
 
 GITypeInfo *
 g_type_info_new (GIBaseInfo    *container,
-		 GTypelib     *metadata,
+		 GTypelib     *typelib,
 		 guint32        offset)
 {
-  SimpleTypeBlob *type = (SimpleTypeBlob *)&metadata->data[offset];
+  SimpleTypeBlob *type = (SimpleTypeBlob *)&typelib->data[offset];
 
-  return (GITypeInfo *) g_info_new (GI_INFO_TYPE_TYPE, container, metadata, 
+  return (GITypeInfo *) g_info_new (GI_INFO_TYPE_TYPE, container, typelib, 
 				    type->reserved == 0 ? offset : type->offset);
 }
 
@@ -557,7 +557,7 @@
 
   offset = signature_offset (info);
 
-  return g_type_info_new (base, base->metadata, offset);
+  return g_type_info_new (base, base->typelib, offset);
 }
 
 /**
@@ -572,7 +572,7 @@
 g_callable_info_may_return_null (GICallableInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  SignatureBlob *blob = (SignatureBlob *)&base->metadata->data[signature_offset (info)];
+  SignatureBlob *blob = (SignatureBlob *)&base->typelib->data[signature_offset (info)];
 
   return blob->may_return_null;
 }
@@ -590,7 +590,7 @@
 g_callable_info_get_caller_owns (GICallableInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  SignatureBlob *blob = (SignatureBlob *)&base->metadata->data[signature_offset (info)];
+  SignatureBlob *blob = (SignatureBlob *)&base->typelib->data[signature_offset (info)];
 
   if (blob->caller_owns_return_value)
     return GI_TRANSFER_EVERYTHING;
@@ -616,7 +616,7 @@
   SignatureBlob *blob;
 
   offset = signature_offset (info);
-  blob = (SignatureBlob *)&base->metadata->data[offset];
+  blob = (SignatureBlob *)&base->typelib->data[offset];
 
   return blob->n_arguments;
 }
@@ -627,19 +627,19 @@
  *
  * Get information about a particular argument of this callable.
  *
- * Returns: A #GIArgInfo indexing the metadata on the given argument.
+ * Returns: A #GIArgInfo indexing the typelib on the given argument.
  */
 GIArgInfo *
 g_callable_info_get_arg (GICallableInfo *info,
 			 gint           n)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  Header *header = (Header *)base->metadata->data;
+  Header *header = (Header *)base->typelib->data;
   gint offset;
 
   offset = signature_offset (info);
   
-  return (GIArgInfo *) g_info_new (GI_INFO_TYPE_ARG, base, base->metadata, 
+  return (GIArgInfo *) g_info_new (GI_INFO_TYPE_ARG, base, base->typelib, 
 				   offset + header->signature_blob_size + n * header->arg_blob_size);
 }
 
@@ -648,7 +648,7 @@
 g_arg_info_get_direction (GIArgInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  ArgBlob *blob = (ArgBlob *)&base->metadata->data[base->offset];
+  ArgBlob *blob = (ArgBlob *)&base->typelib->data[base->offset];
   
   if (blob->in && blob->out)
     return GI_DIRECTION_INOUT;
@@ -662,7 +662,7 @@
 g_arg_info_is_return_value (GIArgInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  ArgBlob *blob = (ArgBlob *)&base->metadata->data[base->offset];
+  ArgBlob *blob = (ArgBlob *)&base->typelib->data[base->offset];
   
   return blob->return_value;
 }
@@ -671,7 +671,7 @@
 g_arg_info_is_dipper (GIArgInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  ArgBlob *blob = (ArgBlob *)&base->metadata->data[base->offset];
+  ArgBlob *blob = (ArgBlob *)&base->typelib->data[base->offset];
   
   return blob->dipper;
 }
@@ -680,7 +680,7 @@
 g_arg_info_is_optional (GIArgInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  ArgBlob *blob = (ArgBlob *)&base->metadata->data[base->offset];
+  ArgBlob *blob = (ArgBlob *)&base->typelib->data[base->offset];
   
   return blob->optional;
 }
@@ -689,7 +689,7 @@
 g_arg_info_may_be_null (GIArgInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  ArgBlob *blob = (ArgBlob *)&base->metadata->data[base->offset];
+  ArgBlob *blob = (ArgBlob *)&base->typelib->data[base->offset];
   
   return blob->null_ok;
 }
@@ -698,7 +698,7 @@
 g_arg_info_get_ownership_transfer (GIArgInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  ArgBlob *blob = (ArgBlob *)&base->metadata->data[base->offset];
+  ArgBlob *blob = (ArgBlob *)&base->typelib->data[base->offset];
 
   if (blob->transfer_ownership)
     return GI_TRANSFER_EVERYTHING;
@@ -713,7 +713,7 @@
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
  
-  return g_type_info_new (base, base->metadata, base->offset + 8);
+  return g_type_info_new (base, base->typelib, base->offset + 8);
 }
 
 /* GITypeInfo functions */
@@ -721,13 +721,13 @@
 g_type_info_is_pointer (GITypeInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  SimpleTypeBlob *type = (SimpleTypeBlob *)&base->metadata->data[base->offset];
+  SimpleTypeBlob *type = (SimpleTypeBlob *)&base->typelib->data[base->offset];
   
   if (type->reserved == 0)
     return type->pointer;
   else
     {
-      InterfaceTypeBlob *iface = (InterfaceTypeBlob *)&base->metadata->data[base->offset];
+      InterfaceTypeBlob *iface = (InterfaceTypeBlob *)&base->typelib->data[base->offset];
       
       return iface->pointer;
     }
@@ -737,13 +737,13 @@
 g_type_info_get_tag (GITypeInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  SimpleTypeBlob *type = (SimpleTypeBlob *)&base->metadata->data[base->offset];
+  SimpleTypeBlob *type = (SimpleTypeBlob *)&base->typelib->data[base->offset];
 
   if (type->reserved == 0)
     return type->tag;
   else
     {
-      InterfaceTypeBlob *iface = (InterfaceTypeBlob *)&base->metadata->data[base->offset];
+      InterfaceTypeBlob *iface = (InterfaceTypeBlob *)&base->typelib->data[base->offset];
 
       return iface->tag;
     }
@@ -754,11 +754,11 @@
 			    gint       n)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  SimpleTypeBlob *type = (SimpleTypeBlob *)&base->metadata->data[base->offset];
+  SimpleTypeBlob *type = (SimpleTypeBlob *)&base->typelib->data[base->offset];
   
   if (type->reserved != 0)
     {
-      ParamTypeBlob *param = (ParamTypeBlob *)&base->metadata->data[base->offset];
+      ParamTypeBlob *param = (ParamTypeBlob *)&base->typelib->data[base->offset];
 
       switch (param->tag)
 	{
@@ -766,7 +766,7 @@
 	case GI_TYPE_TAG_GLIST:
 	case GI_TYPE_TAG_GSLIST:
 	case GI_TYPE_TAG_GHASH:
-	  return g_type_info_new (base, base->metadata, base->offset + 4 + 4 * n);
+	  return g_type_info_new (base, base->typelib, base->offset + 4 + 4 * n);
 	  break;
 	  
 	default: ;
@@ -780,14 +780,14 @@
 g_type_info_get_interface (GITypeInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  SimpleTypeBlob *type = (SimpleTypeBlob *)&base->metadata->data[base->offset];
+  SimpleTypeBlob *type = (SimpleTypeBlob *)&base->typelib->data[base->offset];
   
   if (type->reserved != 0)
     {
-      InterfaceTypeBlob *blob = (InterfaceTypeBlob *)&base->metadata->data[base->offset];
+      InterfaceTypeBlob *blob = (InterfaceTypeBlob *)&base->typelib->data[base->offset];
       
       if (blob->tag == GI_TYPE_TAG_INTERFACE)
-	return g_info_from_entry (base->metadata, blob->interface);
+	return g_info_from_entry (base->typelib, blob->interface);
     }
 
   return NULL;
@@ -797,11 +797,11 @@
 g_type_info_get_array_length (GITypeInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  SimpleTypeBlob *type = (SimpleTypeBlob *)&base->metadata->data[base->offset];
+  SimpleTypeBlob *type = (SimpleTypeBlob *)&base->typelib->data[base->offset];
   
   if (type->reserved != 0)
     {
-      ArrayTypeBlob *blob = (ArrayTypeBlob *)&base->metadata->data[base->offset];
+      ArrayTypeBlob *blob = (ArrayTypeBlob *)&base->typelib->data[base->offset];
 
       if (blob->tag == GI_TYPE_TAG_ARRAY)
 	{
@@ -817,11 +817,11 @@
 g_type_info_is_zero_terminated (GITypeInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  SimpleTypeBlob *type = (SimpleTypeBlob *)&base->metadata->data[base->offset];
+  SimpleTypeBlob *type = (SimpleTypeBlob *)&base->typelib->data[base->offset];
   
   if (type->reserved != 0)
     {
-      ArrayTypeBlob *blob = (ArrayTypeBlob *)&base->metadata->data[base->offset];
+      ArrayTypeBlob *blob = (ArrayTypeBlob *)&base->typelib->data[base->offset];
 
       if (blob->tag == GI_TYPE_TAG_ARRAY)
 	return blob->zero_terminated;
@@ -834,11 +834,11 @@
 g_type_info_get_n_error_domains (GITypeInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  SimpleTypeBlob *type = (SimpleTypeBlob *)&base->metadata->data[base->offset];
+  SimpleTypeBlob *type = (SimpleTypeBlob *)&base->typelib->data[base->offset];
   
   if (type->reserved != 0)
     {
-      ErrorTypeBlob *blob = (ErrorTypeBlob *)&base->metadata->data[base->offset];
+      ErrorTypeBlob *blob = (ErrorTypeBlob *)&base->typelib->data[base->offset];
 
       if (blob->tag == GI_TYPE_TAG_ERROR)
 	return blob->n_domains;
@@ -852,14 +852,14 @@
 			      gint       n)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  SimpleTypeBlob *type = (SimpleTypeBlob *)&base->metadata->data[base->offset];
+  SimpleTypeBlob *type = (SimpleTypeBlob *)&base->typelib->data[base->offset];
   
   if (type->reserved != 0)
     {
-      ErrorTypeBlob *blob = (ErrorTypeBlob *)&base->metadata->data[base->offset];
+      ErrorTypeBlob *blob = (ErrorTypeBlob *)&base->typelib->data[base->offset];
 
       if (blob->tag == GI_TYPE_TAG_ERROR)
-	return (GIErrorDomainInfo *) g_info_from_entry (base->metadata, 
+	return (GIErrorDomainInfo *) g_info_from_entry (base->typelib, 
 							blob->domains[n]);
     }
 
@@ -872,18 +872,18 @@
 g_error_domain_info_get_quark (GIErrorDomainInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  ErrorDomainBlob *blob = (ErrorDomainBlob *)&base->metadata->data[base->offset];
+  ErrorDomainBlob *blob = (ErrorDomainBlob *)&base->typelib->data[base->offset];
 
-  return g_typelib_get_string (base->metadata, blob->get_quark);
+  return g_typelib_get_string (base->typelib, blob->get_quark);
 }
 
 GIInterfaceInfo *
 g_error_domain_info_get_codes (GIErrorDomainInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  ErrorDomainBlob *blob = (ErrorDomainBlob *)&base->metadata->data[base->offset];
+  ErrorDomainBlob *blob = (ErrorDomainBlob *)&base->typelib->data[base->offset];
   
-  return (GIInterfaceInfo *) g_info_from_entry (base->metadata, blob->error_codes);
+  return (GIInterfaceInfo *) g_info_from_entry (base->typelib, blob->error_codes);
 }
 
 
@@ -892,7 +892,7 @@
 g_value_info_get_value (GIValueInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  ValueBlob *blob = (ValueBlob *)&base->metadata->data[base->offset];
+  ValueBlob *blob = (ValueBlob *)&base->typelib->data[base->offset];
 
   return (glong)blob->value;
 }
@@ -904,7 +904,7 @@
   GIFieldInfoFlags flags;
 
   GIBaseInfo *base = (GIBaseInfo *)info;
-  FieldBlob *blob = (FieldBlob *)&base->metadata->data[base->offset];
+  FieldBlob *blob = (FieldBlob *)&base->typelib->data[base->offset];
 
   flags = 0;
 
@@ -921,7 +921,7 @@
 g_field_info_get_size (GIFieldInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  FieldBlob *blob = (FieldBlob *)&base->metadata->data[base->offset];
+  FieldBlob *blob = (FieldBlob *)&base->typelib->data[base->offset];
   
   return blob->bits;
 }
@@ -930,7 +930,7 @@
 g_field_info_get_offset (GIFieldInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  FieldBlob *blob = (FieldBlob *)&base->metadata->data[base->offset];
+  FieldBlob *blob = (FieldBlob *)&base->typelib->data[base->offset];
   
   return blob->struct_offset;
 }
@@ -940,7 +940,7 @@
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
   
-  return g_type_info_new (base, base->metadata, base->offset + 8);
+  return g_type_info_new (base, base->typelib, base->offset + 8);
 }
 
 /* GIRegisteredTypeInfo functions */
@@ -948,10 +948,10 @@
 g_registered_type_info_get_type_name (GIRegisteredTypeInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  RegisteredTypeBlob *blob = (RegisteredTypeBlob *)&base->metadata->data[base->offset];
+  RegisteredTypeBlob *blob = (RegisteredTypeBlob *)&base->typelib->data[base->offset];
 
   if (blob->gtype_name)
-    return g_typelib_get_string (base->metadata, blob->gtype_name);
+    return g_typelib_get_string (base->typelib, blob->gtype_name);
 
   return NULL;
 }
@@ -960,10 +960,10 @@
 g_registered_type_info_get_type_init (GIRegisteredTypeInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  RegisteredTypeBlob *blob = (RegisteredTypeBlob *)&base->metadata->data[base->offset];
+  RegisteredTypeBlob *blob = (RegisteredTypeBlob *)&base->typelib->data[base->offset];
 
   if (blob->gtype_init)
-    return g_typelib_get_string (base->metadata, blob->gtype_init);
+    return g_typelib_get_string (base->typelib, blob->gtype_init);
 
   return NULL;
 }
@@ -980,7 +980,7 @@
     return G_TYPE_NONE;
   
   get_type_func = NULL;
-  if (!g_module_symbol (((GIBaseInfo*)info)->metadata->module,
+  if (!g_module_symbol (((GIBaseInfo*)info)->typelib->module,
                         type_init,
                         (void**) &get_type_func))
     return G_TYPE_NONE;
@@ -993,7 +993,7 @@
 g_struct_info_get_n_fields (GIStructInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  StructBlob *blob = (StructBlob *)&base->metadata->data[base->offset];
+  StructBlob *blob = (StructBlob *)&base->typelib->data[base->offset];
   
   return blob->n_fields;
 }
@@ -1003,9 +1003,9 @@
 			 gint         n)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  Header *header = (Header *)base->metadata->data;  
+  Header *header = (Header *)base->typelib->data;  
  
-  return (GIFieldInfo *) g_info_new (GI_INFO_TYPE_FIELD, base, base->metadata, 
+  return (GIFieldInfo *) g_info_new (GI_INFO_TYPE_FIELD, base, base->typelib, 
 				     base->offset + header->struct_blob_size + 
 				     n * header->field_blob_size);
 }
@@ -1014,7 +1014,7 @@
 g_struct_info_get_n_methods (GIStructInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  StructBlob *blob = (StructBlob *)&base->metadata->data[base->offset];
+  StructBlob *blob = (StructBlob *)&base->typelib->data[base->offset];
   
   return blob->n_methods;
 }
@@ -1024,15 +1024,15 @@
 			  gint         n)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  StructBlob *blob = (StructBlob *)&base->metadata->data[base->offset];
-  Header *header = (Header *)base->metadata->data;  
+  StructBlob *blob = (StructBlob *)&base->typelib->data[base->offset];
+  Header *header = (Header *)base->typelib->data;  
   gint offset;
 
   offset = base->offset + header->struct_blob_size 
     + blob->n_fields * header->field_blob_size 
     + n * header->function_blob_size;
   return (GIFunctionInfo *) g_info_new (GI_INFO_TYPE_FUNCTION, base, 
-					base->metadata, offset);
+					base->typelib, offset);
 }
 
 static GIFunctionInfo *
@@ -1042,17 +1042,17 @@
 	     const gchar  *name)
 {
   /* FIXME hash */
-  Header *header = (Header *)base->metadata->data;  
+  Header *header = (Header *)base->typelib->data;  
   gint i;
 
   for (i = 0; i < n_methods; i++)
     {
-      FunctionBlob *fblob = (FunctionBlob *)&base->metadata->data[offset];
-      const gchar *fname = (const gchar *)&base->metadata->data[fblob->name];
+      FunctionBlob *fblob = (FunctionBlob *)&base->typelib->data[offset];
+      const gchar *fname = (const gchar *)&base->typelib->data[fblob->name];
 
       if (strcmp (name, fname) == 0)
 	return (GIFunctionInfo *) g_info_new (GI_INFO_TYPE_FUNCTION, base, 
-					      base->metadata, offset);  
+					      base->typelib, offset);  
       
       offset += header->function_blob_size;
     }
@@ -1066,8 +1066,8 @@
 {
   gint offset;
   GIBaseInfo *base = (GIBaseInfo *)info;
-  Header *header = (Header *)base->metadata->data;  
-  StructBlob *blob = (StructBlob *)&base->metadata->data[base->offset];
+  Header *header = (Header *)base->typelib->data;  
+  StructBlob *blob = (StructBlob *)&base->typelib->data[base->offset];
 
   offset = base->offset + header->struct_blob_size
     + blob->n_fields * header->field_blob_size;
@@ -1079,7 +1079,7 @@
 g_enum_info_get_n_values (GIEnumInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  EnumBlob *blob = (EnumBlob *)&base->metadata->data[base->offset];
+  EnumBlob *blob = (EnumBlob *)&base->typelib->data[base->offset];
 
   return blob->n_values;
 }
@@ -1089,12 +1089,12 @@
 		       gint            n)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  Header *header = (Header *)base->metadata->data;  
+  Header *header = (Header *)base->typelib->data;  
   gint offset;
 
   offset = base->offset + header->enum_blob_size 
     + n * header->value_blob_size;
-  return (GIValueInfo *) g_info_new (GI_INFO_TYPE_VALUE, base, base->metadata, offset);
+  return (GIValueInfo *) g_info_new (GI_INFO_TYPE_VALUE, base, base->typelib, offset);
 }
 
 /* GIObjectInfo functions */
@@ -1102,10 +1102,10 @@
 g_object_info_get_parent (GIObjectInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  ObjectBlob *blob = (ObjectBlob *)&base->metadata->data[base->offset];
+  ObjectBlob *blob = (ObjectBlob *)&base->typelib->data[base->offset];
 
   if (blob->parent)
-    return (GIObjectInfo *) g_info_from_entry (base->metadata, blob->parent);
+    return (GIObjectInfo *) g_info_from_entry (base->typelib, blob->parent);
   else
     return NULL;
 }
@@ -1114,25 +1114,25 @@
 g_object_info_get_type_name (GIObjectInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  ObjectBlob *blob = (ObjectBlob *)&base->metadata->data[base->offset];
+  ObjectBlob *blob = (ObjectBlob *)&base->typelib->data[base->offset];
 
-  return g_typelib_get_string (base->metadata, blob->gtype_name);
+  return g_typelib_get_string (base->typelib, blob->gtype_name);
 }
 
 const gchar *
 g_object_info_get_type_init (GIObjectInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  ObjectBlob *blob = (ObjectBlob *)&base->metadata->data[base->offset];
+  ObjectBlob *blob = (ObjectBlob *)&base->typelib->data[base->offset];
 
-  return g_typelib_get_string (base->metadata, blob->gtype_init);
+  return g_typelib_get_string (base->typelib, blob->gtype_init);
 }
 
 gint
 g_object_info_get_n_interfaces (GIObjectInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  ObjectBlob *blob = (ObjectBlob *)&base->metadata->data[base->offset];
+  ObjectBlob *blob = (ObjectBlob *)&base->typelib->data[base->offset];
 
   return blob->n_interfaces;
 }
@@ -1142,16 +1142,16 @@
 			     gint          n)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  ObjectBlob *blob = (ObjectBlob *)&base->metadata->data[base->offset];
+  ObjectBlob *blob = (ObjectBlob *)&base->typelib->data[base->offset];
 
-  return (GIInterfaceInfo *) g_info_from_entry (base->metadata, blob->interfaces[n]);
+  return (GIInterfaceInfo *) g_info_from_entry (base->typelib, blob->interfaces[n]);
 }
 
 gint
 g_object_info_get_n_fields (GIObjectInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  ObjectBlob *blob = (ObjectBlob *)&base->metadata->data[base->offset];
+  ObjectBlob *blob = (ObjectBlob *)&base->typelib->data[base->offset];
 
   return blob->n_fields;
 }
@@ -1162,21 +1162,21 @@
 {
   gint offset;
   GIBaseInfo *base = (GIBaseInfo *)info;
-  Header *header = (Header *)base->metadata->data;  
-  ObjectBlob *blob = (ObjectBlob *)&base->metadata->data[base->offset];
+  Header *header = (Header *)base->typelib->data;  
+  ObjectBlob *blob = (ObjectBlob *)&base->typelib->data[base->offset];
   
   offset = base->offset + header->object_blob_size
     + (blob->n_interfaces + blob->n_interfaces % 2) * 2
     + n * header->field_blob_size;
   
-  return (GIFieldInfo *) g_info_new (GI_INFO_TYPE_FIELD, base, base->metadata, offset);
+  return (GIFieldInfo *) g_info_new (GI_INFO_TYPE_FIELD, base, base->typelib, offset);
 }
 
 gint
 g_object_info_get_n_properties (GIObjectInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  ObjectBlob *blob = (ObjectBlob *)&base->metadata->data[base->offset];
+  ObjectBlob *blob = (ObjectBlob *)&base->typelib->data[base->offset];
 
   return blob->n_properties;  
 }
@@ -1187,8 +1187,8 @@
 {
   gint offset;
   GIBaseInfo *base = (GIBaseInfo *)info;
-  Header *header = (Header *)base->metadata->data;  
-  ObjectBlob *blob = (ObjectBlob *)&base->metadata->data[base->offset];
+  Header *header = (Header *)base->typelib->data;  
+  ObjectBlob *blob = (ObjectBlob *)&base->typelib->data[base->offset];
   
   offset = base->offset + header->object_blob_size
     + (blob->n_interfaces + blob->n_interfaces % 2) * 2
@@ -1196,14 +1196,14 @@
     + n * header->property_blob_size;
 
   return (GIPropertyInfo *) g_info_new (GI_INFO_TYPE_PROPERTY, base, 
-					base->metadata, offset);
+					base->typelib, offset);
 }
 
 gint
 g_object_info_get_n_methods (GIObjectInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  ObjectBlob *blob = (ObjectBlob *)&base->metadata->data[base->offset];
+  ObjectBlob *blob = (ObjectBlob *)&base->typelib->data[base->offset];
 
   return blob->n_methods;
 }
@@ -1214,8 +1214,8 @@
 {
   gint offset;
   GIBaseInfo *base = (GIBaseInfo *)info;
-  Header *header = (Header *)base->metadata->data;  
-  ObjectBlob *blob = (ObjectBlob *)&base->metadata->data[base->offset];
+  Header *header = (Header *)base->typelib->data;  
+  ObjectBlob *blob = (ObjectBlob *)&base->typelib->data[base->offset];
   
   offset = base->offset + header->object_blob_size
     + (blob->n_interfaces + blob->n_interfaces % 2) * 2
@@ -1224,7 +1224,7 @@
     + n * header->function_blob_size;
 
     return (GIFunctionInfo *) g_info_new (GI_INFO_TYPE_FUNCTION, base, 
-					  base->metadata, offset);  
+					  base->typelib, offset);  
 }
 
 GIFunctionInfo *
@@ -1233,8 +1233,8 @@
 {
   gint offset;
   GIBaseInfo *base = (GIBaseInfo *)info;
-  Header *header = (Header *)base->metadata->data;  
-  ObjectBlob *blob = (ObjectBlob *)&base->metadata->data[base->offset];
+  Header *header = (Header *)base->typelib->data;  
+  ObjectBlob *blob = (ObjectBlob *)&base->typelib->data[base->offset];
 
   offset = base->offset + header->object_blob_size
     + (blob->n_interfaces + blob->n_interfaces % 2) * 2
@@ -1248,7 +1248,7 @@
 g_object_info_get_n_signals (GIObjectInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  ObjectBlob *blob = (ObjectBlob *)&base->metadata->data[base->offset];
+  ObjectBlob *blob = (ObjectBlob *)&base->typelib->data[base->offset];
 
   return blob->n_signals;
 }
@@ -1259,8 +1259,8 @@
 {
   gint offset;
   GIBaseInfo *base = (GIBaseInfo *)info;
-  Header *header = (Header *)base->metadata->data;  
-  ObjectBlob *blob = (ObjectBlob *)&base->metadata->data[base->offset];
+  Header *header = (Header *)base->typelib->data;  
+  ObjectBlob *blob = (ObjectBlob *)&base->typelib->data[base->offset];
   
   offset = base->offset + header->object_blob_size
     + (blob->n_interfaces + blob->n_interfaces % 2) * 2
@@ -1270,14 +1270,14 @@
     + n * header->signal_blob_size;
 
   return (GISignalInfo *) g_info_new (GI_INFO_TYPE_SIGNAL, base, 
-				      base->metadata, offset);  
+				      base->typelib, offset);  
 }
 
 gint
 g_object_info_get_n_vfuncs (GIObjectInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  ObjectBlob *blob = (ObjectBlob *)&base->metadata->data[base->offset];
+  ObjectBlob *blob = (ObjectBlob *)&base->typelib->data[base->offset];
   
   return blob->n_vfuncs;
 }
@@ -1288,8 +1288,8 @@
 {
   gint offset;
   GIBaseInfo *base = (GIBaseInfo *)info;
-  Header *header = (Header *)base->metadata->data;  
-  ObjectBlob *blob = (ObjectBlob *)&base->metadata->data[base->offset];
+  Header *header = (Header *)base->typelib->data;  
+  ObjectBlob *blob = (ObjectBlob *)&base->typelib->data[base->offset];
   
   offset = base->offset + header->object_blob_size
     + (blob->n_interfaces + blob->n_interfaces % 2) * 2
@@ -1300,14 +1300,14 @@
     + n * header->vfunc_blob_size;
 
   return (GIVFuncInfo *) g_info_new (GI_INFO_TYPE_VFUNC, base, 
-				     base->metadata, offset);  
+				     base->typelib, offset);  
 }
 
 gint
 g_object_info_get_n_constants (GIObjectInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  ObjectBlob *blob = (ObjectBlob *)&base->metadata->data[base->offset];
+  ObjectBlob *blob = (ObjectBlob *)&base->typelib->data[base->offset];
   
   return blob->n_constants;
 }
@@ -1318,8 +1318,8 @@
 {
   gint offset;
   GIBaseInfo *base = (GIBaseInfo *)info;
-  Header *header = (Header *)base->metadata->data;  
-  ObjectBlob *blob = (ObjectBlob *)&base->metadata->data[base->offset];
+  Header *header = (Header *)base->typelib->data;  
+  ObjectBlob *blob = (ObjectBlob *)&base->typelib->data[base->offset];
   
   offset = base->offset + header->object_blob_size
     + (blob->n_interfaces + blob->n_interfaces % 2) * 2
@@ -1331,7 +1331,7 @@
     + n * header->constant_blob_size;
 
   return (GIConstantInfo *) g_info_new (GI_INFO_TYPE_CONSTANT, base, 
-					base->metadata, offset);  
+					base->typelib, offset);  
 }
 
 
@@ -1340,7 +1340,7 @@
 g_interface_info_get_n_prerequisites (GIInterfaceInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  InterfaceBlob *blob = (InterfaceBlob *)&base->metadata->data[base->offset];
+  InterfaceBlob *blob = (InterfaceBlob *)&base->typelib->data[base->offset];
 
   return blob->n_prerequisites;
 }
@@ -1350,9 +1350,9 @@
 				   gint            n)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  InterfaceBlob *blob = (InterfaceBlob *)&base->metadata->data[base->offset];
+  InterfaceBlob *blob = (InterfaceBlob *)&base->typelib->data[base->offset];
 
-  return g_info_from_entry (base->metadata, blob->prerequisites[n]);
+  return g_info_from_entry (base->typelib, blob->prerequisites[n]);
 }
 
 
@@ -1360,7 +1360,7 @@
 g_interface_info_get_n_properties (GIInterfaceInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  InterfaceBlob *blob = (InterfaceBlob *)&base->metadata->data[base->offset];
+  InterfaceBlob *blob = (InterfaceBlob *)&base->typelib->data[base->offset];
 
   return blob->n_properties;  
 }
@@ -1371,22 +1371,22 @@
 {
   gint offset;
   GIBaseInfo *base = (GIBaseInfo *)info;
-  Header *header = (Header *)base->metadata->data;  
-  InterfaceBlob *blob = (InterfaceBlob *)&base->metadata->data[base->offset];
+  Header *header = (Header *)base->typelib->data;  
+  InterfaceBlob *blob = (InterfaceBlob *)&base->typelib->data[base->offset];
   
   offset = base->offset + header->interface_blob_size
     + (blob->n_prerequisites + (blob->n_prerequisites % 2)) * 2
     + n * header->property_blob_size;
 
   return (GIPropertyInfo *) g_info_new (GI_INFO_TYPE_PROPERTY, base, 
-					base->metadata, offset);
+					base->typelib, offset);
 }
 
 gint
 g_interface_info_get_n_methods (GIInterfaceInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  InterfaceBlob *blob = (InterfaceBlob *)&base->metadata->data[base->offset];
+  InterfaceBlob *blob = (InterfaceBlob *)&base->typelib->data[base->offset];
 
   return blob->n_methods;
 }
@@ -1397,8 +1397,8 @@
 {
   gint offset;
   GIBaseInfo *base = (GIBaseInfo *)info;
-  Header *header = (Header *)base->metadata->data;  
-  InterfaceBlob *blob = (InterfaceBlob *)&base->metadata->data[base->offset];
+  Header *header = (Header *)base->typelib->data;  
+  InterfaceBlob *blob = (InterfaceBlob *)&base->typelib->data[base->offset];
   
   offset = base->offset + header->interface_blob_size
     + (blob->n_prerequisites + (blob->n_prerequisites % 2)) * 2
@@ -1406,7 +1406,7 @@
     + n * header->function_blob_size;
   
   return (GIFunctionInfo *) g_info_new (GI_INFO_TYPE_FUNCTION, base, 
-					base->metadata, offset);  
+					base->typelib, offset);  
 }
 
 GIFunctionInfo *
@@ -1415,8 +1415,8 @@
 {
   gint offset;
   GIBaseInfo *base = (GIBaseInfo *)info;
-  Header *header = (Header *)base->metadata->data;  
-  InterfaceBlob *blob = (InterfaceBlob *)&base->metadata->data[base->offset];
+  Header *header = (Header *)base->typelib->data;  
+  InterfaceBlob *blob = (InterfaceBlob *)&base->typelib->data[base->offset];
 
   offset = base->offset + header->interface_blob_size
     + (blob->n_prerequisites + (blob->n_prerequisites % 2)) * 2
@@ -1429,7 +1429,7 @@
 g_interface_info_get_n_signals (GIInterfaceInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  InterfaceBlob *blob = (InterfaceBlob *)&base->metadata->data[base->offset];
+  InterfaceBlob *blob = (InterfaceBlob *)&base->typelib->data[base->offset];
 
   return blob->n_signals;
 }
@@ -1440,8 +1440,8 @@
 {
   gint offset;
   GIBaseInfo *base = (GIBaseInfo *)info;
-  Header *header = (Header *)base->metadata->data;  
-  InterfaceBlob *blob = (InterfaceBlob *)&base->metadata->data[base->offset];
+  Header *header = (Header *)base->typelib->data;  
+  InterfaceBlob *blob = (InterfaceBlob *)&base->typelib->data[base->offset];
   
   offset = base->offset + header->interface_blob_size 
     + (blob->n_prerequisites + (blob->n_prerequisites % 2)) * 2
@@ -1450,14 +1450,14 @@
     + n * header->signal_blob_size;
   
   return (GISignalInfo *) g_info_new (GI_INFO_TYPE_SIGNAL, base, 
-				      base->metadata, offset);  
+				      base->typelib, offset);  
 }
 
 gint
 g_interface_info_get_n_vfuncs (GIInterfaceInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  InterfaceBlob *blob = (InterfaceBlob *)&base->metadata->data[base->offset];
+  InterfaceBlob *blob = (InterfaceBlob *)&base->typelib->data[base->offset];
 
   return blob->n_vfuncs;
 }
@@ -1468,8 +1468,8 @@
 {
   gint offset;
   GIBaseInfo *base = (GIBaseInfo *)info;
-  Header *header = (Header *)base->metadata->data;  
-  InterfaceBlob *blob = (InterfaceBlob *)&base->metadata->data[base->offset];
+  Header *header = (Header *)base->typelib->data;  
+  InterfaceBlob *blob = (InterfaceBlob *)&base->typelib->data[base->offset];
   
   offset = base->offset + header->interface_blob_size 
     + (blob->n_prerequisites + (blob->n_prerequisites % 2)) * 2
@@ -1479,14 +1479,14 @@
     + n * header->vfunc_blob_size;
   
   return (GIVFuncInfo *) g_info_new (GI_INFO_TYPE_VFUNC, base, 
-				     base->metadata, offset);  
+				     base->typelib, offset);  
 }
 
 gint
 g_interface_info_get_n_constants (GIInterfaceInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  InterfaceBlob *blob = (InterfaceBlob *)&base->metadata->data[base->offset];
+  InterfaceBlob *blob = (InterfaceBlob *)&base->typelib->data[base->offset];
   
   return blob->n_constants;
 }
@@ -1497,8 +1497,8 @@
 {
   gint offset;
   GIBaseInfo *base = (GIBaseInfo *)info;
-  Header *header = (Header *)base->metadata->data;  
-  InterfaceBlob *blob = (InterfaceBlob *)&base->metadata->data[base->offset];
+  Header *header = (Header *)base->typelib->data;  
+  InterfaceBlob *blob = (InterfaceBlob *)&base->typelib->data[base->offset];
   
   offset = base->offset + header->interface_blob_size
     + (blob->n_prerequisites + (blob->n_prerequisites % 2)) * 2
@@ -1509,7 +1509,7 @@
     + n * header->constant_blob_size;
 
   return (GIConstantInfo *) g_info_new (GI_INFO_TYPE_CONSTANT, base, 
-					base->metadata, offset);  
+					base->typelib, offset);  
 }
 
 
@@ -1521,7 +1521,7 @@
 {
   GParamFlags flags;
   GIBaseInfo *base = (GIBaseInfo *)info;
-  PropertyBlob *blob = (PropertyBlob *)&base->metadata->data[base->offset];
+  PropertyBlob *blob = (PropertyBlob *)&base->typelib->data[base->offset];
   
   flags = 0;
 
@@ -1545,7 +1545,7 @@
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
 
-  return g_type_info_new (base, base->metadata, base->offset + 8);  
+  return g_type_info_new (base, base->typelib, base->offset + 8);  
 }
 
 
@@ -1556,7 +1556,7 @@
   GSignalFlags flags;
 
   GIBaseInfo *base = (GIBaseInfo *)info;
-  SignalBlob *blob = (SignalBlob *)&base->metadata->data[base->offset];
+  SignalBlob *blob = (SignalBlob *)&base->typelib->data[base->offset];
 
   flags = 0;
 
@@ -1588,7 +1588,7 @@
 g_signal_info_get_class_closure (GISignalInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  SignalBlob *blob = (SignalBlob *)&base->metadata->data[base->offset];
+  SignalBlob *blob = (SignalBlob *)&base->typelib->data[base->offset];
 
   if (blob->has_class_closure)
     return g_interface_info_get_vfunc ((GIInterfaceInfo *)base->container, blob->class_closure);
@@ -1600,7 +1600,7 @@
 g_signal_info_true_stops_emit (GISignalInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  SignalBlob *blob = (SignalBlob *)&base->metadata->data[base->offset];
+  SignalBlob *blob = (SignalBlob *)&base->typelib->data[base->offset];
 
   return blob->true_stops_emit;
 }
@@ -1612,7 +1612,7 @@
   GIVFuncInfoFlags flags;
 
   GIBaseInfo *base = (GIBaseInfo *)info;
-  VFuncBlob *blob = (VFuncBlob *)&base->metadata->data[base->offset];
+  VFuncBlob *blob = (VFuncBlob *)&base->typelib->data[base->offset];
 
   flags = 0;
 
@@ -1632,7 +1632,7 @@
 g_vfunc_info_get_offset (GIVFuncInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  VFuncBlob *blob = (VFuncBlob *)&base->metadata->data[base->offset];
+  VFuncBlob *blob = (VFuncBlob *)&base->typelib->data[base->offset];
   
   return blob->struct_offset;
 }
@@ -1641,7 +1641,7 @@
 g_vfunc_info_get_signal (GIVFuncInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  VFuncBlob *blob = (VFuncBlob *)&base->metadata->data[base->offset];
+  VFuncBlob *blob = (VFuncBlob *)&base->typelib->data[base->offset];
 
   if (blob->class_closure)
     return g_interface_info_get_signal ((GIInterfaceInfo *)base->container, blob->signal);
@@ -1656,7 +1656,7 @@
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
   
-  return g_type_info_new (base, base->metadata, base->offset + 8);
+  return g_type_info_new (base, base->typelib, base->offset + 8);
 }
 
 gint
@@ -1664,61 +1664,61 @@
 			   GArgument      *value)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  ConstantBlob *blob = (ConstantBlob *)&base->metadata->data[base->offset];
+  ConstantBlob *blob = (ConstantBlob *)&base->typelib->data[base->offset];
 
   /* FIXME non-basic types ? */
   if (blob->type.reserved == 0)
     {
       if (blob->type.pointer)
-	value->v_pointer = g_memdup (&base->metadata->data[blob->offset], blob->size);
+	value->v_pointer = g_memdup (&base->typelib->data[blob->offset], blob->size);
       else
 	{
 	  switch (blob->type.tag)
 	    {
 	    case GI_TYPE_TAG_BOOLEAN:
-	      value->v_boolean = *(gboolean*)&base->metadata->data[blob->offset];
+	      value->v_boolean = *(gboolean*)&base->typelib->data[blob->offset];
 	      break;
 	    case GI_TYPE_TAG_INT8:
-	      value->v_int8 = *(gint8*)&base->metadata->data[blob->offset];
+	      value->v_int8 = *(gint8*)&base->typelib->data[blob->offset];
 	      break;
 	    case GI_TYPE_TAG_UINT8:
-	      value->v_uint8 = *(guint8*)&base->metadata->data[blob->offset];
+	      value->v_uint8 = *(guint8*)&base->typelib->data[blob->offset];
 	      break;
 	    case GI_TYPE_TAG_INT16:
-	      value->v_int16 = *(gint16*)&base->metadata->data[blob->offset];
+	      value->v_int16 = *(gint16*)&base->typelib->data[blob->offset];
 	      break;
 	    case GI_TYPE_TAG_UINT16:
-	      value->v_uint16 = *(guint16*)&base->metadata->data[blob->offset];
+	      value->v_uint16 = *(guint16*)&base->typelib->data[blob->offset];
 	      break;
 	    case GI_TYPE_TAG_INT32:
-	      value->v_int32 = *(gint32*)&base->metadata->data[blob->offset];
+	      value->v_int32 = *(gint32*)&base->typelib->data[blob->offset];
 	      break;
 	    case GI_TYPE_TAG_UINT32:
-	      value->v_uint32 = *(guint32*)&base->metadata->data[blob->offset];
+	      value->v_uint32 = *(guint32*)&base->typelib->data[blob->offset];
 	      break;
 	    case GI_TYPE_TAG_INT64:
-	      value->v_int64 = *(gint64*)&base->metadata->data[blob->offset];
+	      value->v_int64 = *(gint64*)&base->typelib->data[blob->offset];
 	      break;
 	    case GI_TYPE_TAG_UINT64:
-	      value->v_uint64 = *(guint64*)&base->metadata->data[blob->offset];
+	      value->v_uint64 = *(guint64*)&base->typelib->data[blob->offset];
 	      break;
 	    case GI_TYPE_TAG_FLOAT:
-	      value->v_float = *(gfloat*)&base->metadata->data[blob->offset];
+	      value->v_float = *(gfloat*)&base->typelib->data[blob->offset];
 	      break;
 	    case GI_TYPE_TAG_DOUBLE:
-	      value->v_double = *(gdouble*)&base->metadata->data[blob->offset];
+	      value->v_double = *(gdouble*)&base->typelib->data[blob->offset];
 	      break;
 	    case GI_TYPE_TAG_INT:
-	      value->v_int = *(gint*)&base->metadata->data[blob->offset];
+	      value->v_int = *(gint*)&base->typelib->data[blob->offset];
 	      break;
 	    case GI_TYPE_TAG_UINT:
-	      value->v_uint = *(guint*)&base->metadata->data[blob->offset];
+	      value->v_uint = *(guint*)&base->typelib->data[blob->offset];
 	      break;
 	    case GI_TYPE_TAG_LONG:
-	      value->v_long = *(glong*)&base->metadata->data[blob->offset];
+	      value->v_long = *(glong*)&base->typelib->data[blob->offset];
 	      break;
 	    case GI_TYPE_TAG_ULONG:
-	      value->v_ulong = *(gulong*)&base->metadata->data[blob->offset];
+	      value->v_ulong = *(gulong*)&base->typelib->data[blob->offset];
 	      break;
 	    }
 	}
@@ -1732,7 +1732,7 @@
 g_union_info_get_n_fields  (GIUnionInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  UnionBlob *blob = (UnionBlob *)&base->metadata->data[base->offset];
+  UnionBlob *blob = (UnionBlob *)&base->typelib->data[base->offset];
   
   return blob->n_fields;
 }
@@ -1742,9 +1742,9 @@
 			gint         n)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  Header *header = (Header *)base->metadata->data;  
+  Header *header = (Header *)base->typelib->data;  
  
-  return (GIFieldInfo *) g_info_new (GI_INFO_TYPE_FIELD, base, base->metadata, 
+  return (GIFieldInfo *) g_info_new (GI_INFO_TYPE_FIELD, base, base->typelib, 
 				     base->offset + header->union_blob_size + 
 				     n * header->field_blob_size);
 }
@@ -1753,7 +1753,7 @@
 g_union_info_get_n_methods (GIUnionInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  UnionBlob *blob = (UnionBlob *)&base->metadata->data[base->offset];
+  UnionBlob *blob = (UnionBlob *)&base->typelib->data[base->offset];
   
   return blob->n_functions;
 }
@@ -1763,22 +1763,22 @@
 			 gint         n)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  UnionBlob *blob = (UnionBlob *)&base->metadata->data[base->offset];
-  Header *header = (Header *)base->metadata->data;  
+  UnionBlob *blob = (UnionBlob *)&base->typelib->data[base->offset];
+  Header *header = (Header *)base->typelib->data;  
   gint offset;
 
   offset = base->offset + header->union_blob_size 
     + blob->n_fields * header->field_blob_size 
     + n * header->function_blob_size;
   return (GIFunctionInfo *) g_info_new (GI_INFO_TYPE_FUNCTION, base, 
-					base->metadata, offset);
+					base->typelib, offset);
 }
 
 gboolean
 g_union_info_is_discriminated (GIUnionInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  UnionBlob *blob = (UnionBlob *)&base->metadata->data[base->offset];
+  UnionBlob *blob = (UnionBlob *)&base->typelib->data[base->offset];
   
   return blob->discriminated;
 }
@@ -1787,7 +1787,7 @@
 g_union_info_get_discriminator_offset (GIUnionInfo *info)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  UnionBlob *blob = (UnionBlob *)&base->metadata->data[base->offset];
+  UnionBlob *blob = (UnionBlob *)&base->typelib->data[base->offset];
   
   return blob->discriminator_offset;
 }
@@ -1797,7 +1797,7 @@
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
  
-  return g_type_info_new (base, base->metadata, base->offset + 24);
+  return g_type_info_new (base, base->typelib, base->offset + 24);
 }
 
 GIConstantInfo *
@@ -1805,11 +1805,11 @@
 				gint         n)
 {
   GIBaseInfo *base = (GIBaseInfo *)info;
-  UnionBlob *blob = (UnionBlob *)&base->metadata->data[base->offset];
+  UnionBlob *blob = (UnionBlob *)&base->typelib->data[base->offset];
   
   if (blob->discriminated)
     {
-      Header *header = (Header *)base->metadata->data;  
+      Header *header = (Header *)base->typelib->data;  
       gint offset;
 
       offset = base->offset + header->union_blob_size 
@@ -1818,7 +1818,7 @@
 	+ n * header->constant_blob_size;
       
       return (GIConstantInfo *) g_info_new (GI_INFO_TYPE_CONSTANT, base, 
-					    base->metadata, offset);  
+					    base->typelib, offset);  
     }
 
   return NULL;

Modified: trunk/girepository/ginvoke.c
==============================================================================
--- trunk/girepository/ginvoke.c	(original)
+++ trunk/girepository/ginvoke.c	Sat Aug  9 12:55:32 2008
@@ -163,7 +163,7 @@
   
   symbol = g_function_info_get_symbol (info);
 
-  if (!g_module_symbol (g_base_info_get_metadata((GIBaseInfo *) info)->module,
+  if (!g_module_symbol (g_base_info_get_typelib((GIBaseInfo *) info)->module,
                         symbol, &func))
     {
       GModule *entire_app;
@@ -172,7 +172,7 @@
        * We want to be able to add symbols to an app or an auxiliary
        * library to fill in gaps in an introspected library. However,
        * normally we would only look for symbols in the main library
-       * (metadata->module).
+       * (typelib->module).
        *
        * A more elaborate solution is probably possible, but as a
        * simple approach for now, if we fail to find a symbol we look
@@ -180,7 +180,7 @@
        *
        * This would not be very efficient if it happened often, since
        * we always do the failed lookup above first, but very few
-       * symbols should be outside of metadata->module so it doesn't
+       * symbols should be outside of typelib->module so it doesn't
        * matter.
        */
       entire_app = g_module_open (NULL, 0);

Modified: trunk/girepository/girepository.c
==============================================================================
--- trunk/girepository/girepository.c	(original)
+++ trunk/girepository/girepository.c	Sat Aug  9 12:55:32 2008
@@ -29,12 +29,12 @@
 #include "gtypelib.h"
 
 static GIRepository *default_repository = NULL;
-static GHashTable *default_metadata = NULL;
+static GHashTable *default_typelib = NULL;
 static GSList *search_path = NULL;
 
 struct _GIRepositoryPrivate 
 {
-  GHashTable *metadata; /* (string) namespace -> GTypelib */
+  GHashTable *typelib; /* (string) namespace -> GTypelib */
 };
 
 G_DEFINE_TYPE (GIRepository, g_irepository, G_TYPE_OBJECT);
@@ -51,7 +51,7 @@
 {
   GIRepository *repository = G_IREPOSITORY (object);
 
-  g_hash_table_destroy (repository->priv->metadata);
+  g_hash_table_destroy (repository->priv->typelib);
   
   (* G_OBJECT_CLASS (g_irepository_parent_class)->finalize) (G_OBJECT (repository));
 }
@@ -70,49 +70,49 @@
 
 const gchar *
 g_irepository_register (GIRepository *repository,
-                        GTypelib    *metadata)
+                        GTypelib    *typelib)
 {
   Header *header;
   const gchar *name;
   GHashTable *table;
   GError *error = NULL;
   
-  g_return_val_if_fail (metadata != NULL, NULL);
+  g_return_val_if_fail (typelib != NULL, NULL);
   
-  header = (Header *)metadata->data;
+  header = (Header *)typelib->data;
 
   g_return_val_if_fail (header != NULL, NULL);
 
   if (repository != NULL)
     {
-      if (repository->priv->metadata == NULL)
-	repository->priv->metadata = g_hash_table_new_full (g_str_hash, g_str_equal,
+      if (repository->priv->typelib == NULL)
+	repository->priv->typelib = g_hash_table_new_full (g_str_hash, g_str_equal,
                                                             (GDestroyNotify) NULL,
                                                             (GDestroyNotify) g_typelib_free);
-      table = repository->priv->metadata;
+      table = repository->priv->typelib;
     }
   else 
     {
-      if (default_metadata == NULL)
-	default_metadata = g_hash_table_new_full (g_str_hash, g_str_equal,
+      if (default_typelib == NULL)
+	default_typelib = g_hash_table_new_full (g_str_hash, g_str_equal,
                                                   (GDestroyNotify) NULL,
                                                   (GDestroyNotify) g_typelib_free);
-      table = default_metadata;
+      table = default_typelib;
     }
 
-  name = g_typelib_get_string (metadata, header->namespace);
+  name = g_typelib_get_string (typelib, header->namespace);
 
   if (g_hash_table_lookup (table, name))
     {
-      g_printerr ("metadata (%p) for '%s' already registered\n",
-		 metadata, name);
+      g_printerr ("typelib (%p) for '%s' already registered\n",
+		 typelib, name);
 
       return NULL;
     }
-  g_hash_table_insert (table, g_strdup(name), (void *)metadata);
+  g_hash_table_insert (table, g_strdup(name), (void *)typelib);
 
-  if (metadata->module == NULL)
-      metadata->module = g_module_open (NULL, 0); 
+  if (typelib->module == NULL)
+      typelib->module = g_module_open (NULL, 0); 
 
   if (g_getenv ("G_IREPOSITORY_VERBOSE"))
     {
@@ -130,9 +130,9 @@
   GHashTable *table;
 
   if (repository != NULL)
-    table = repository->priv->metadata;
+    table = repository->priv->typelib;
   else
-    table = default_metadata;
+    table = default_typelib;
 
   if (!g_hash_table_remove (table, namespace))
     {
@@ -147,9 +147,9 @@
   GHashTable *table;
 
   if (repository != NULL)
-    table = repository->priv->metadata;
+    table = repository->priv->typelib;
   else
-    table = default_metadata;
+    table = default_typelib;
 
   return g_hash_table_lookup (table, namespace) != NULL;
 }
@@ -160,11 +160,11 @@
   if (default_repository == NULL) 
     { 
       default_repository = g_object_new (G_TYPE_IREPOSITORY, NULL);
-      if (default_metadata == NULL)
-	default_metadata = g_hash_table_new_full (g_str_hash, g_str_equal,
+      if (default_typelib == NULL)
+	default_typelib = g_hash_table_new_full (g_str_hash, g_str_equal,
                                                   (GDestroyNotify) NULL,
                                                   (GDestroyNotify) g_typelib_free);
-      default_repository->priv->metadata = default_metadata;
+      default_repository->priv->typelib = default_typelib;
     }
 
   return default_repository; 
@@ -175,10 +175,10 @@
 		  gpointer value,
 		  gpointer data)
 {
-  guchar *metadata = ((GTypelib *) value)->data;
+  guchar *typelib = ((GTypelib *) value)->data;
   gint *n_interfaces = (gint *)data;
   
-  *n_interfaces += ((Header *)metadata)->n_local_entries;
+  *n_interfaces += ((Header *)typelib)->n_local_entries;
 }
 
 gint                   
@@ -189,16 +189,16 @@
   
   if (namespace)
     {
-      GTypelib *metadata;
+      GTypelib *typelib;
 
-      metadata = g_hash_table_lookup (repository->priv->metadata, namespace);
+      typelib = g_hash_table_lookup (repository->priv->typelib, namespace);
 
-      if (metadata)
-	n_interfaces = ((Header *)metadata->data)->n_local_entries;
+      if (typelib)
+	n_interfaces = ((Header *)typelib->data)->n_local_entries;
     }
   else
     {
-      g_hash_table_foreach (repository->priv->metadata, 
+      g_hash_table_foreach (repository->priv->typelib, 
 			    count_interfaces, &n_interfaces);
     }
 
@@ -219,7 +219,7 @@
 		gpointer data)
 {
   gint i;
-  GTypelib *metadata = (GTypelib *)value;
+  GTypelib *typelib = (GTypelib *)value;
   IfaceData *iface_data = (IfaceData *)data;
   gint index;
   gint n_entries;
@@ -229,14 +229,14 @@
   DirEntry *entry;    
 
   index = 0;
-  n_entries = ((Header *)metadata->data)->n_local_entries;
+  n_entries = ((Header *)typelib->data)->n_local_entries;
 
   if (iface_data->name)
     {
       for (i = 1; i <= n_entries; i++)
 	{
-	  entry = g_typelib_get_dir_entry (metadata, i);
-	  name = g_typelib_get_string (metadata, entry->name);
+	  entry = g_typelib_get_dir_entry (typelib, i);
+	  name = g_typelib_get_string (typelib, entry->name);
 	  if (strcmp (name, iface_data->name) == 0)
 	    {
 	      index = i;
@@ -248,12 +248,12 @@
     {
       for (i = 1; i <= n_entries; i++)
 	{
-	  entry = g_typelib_get_dir_entry (metadata, i);
+	  entry = g_typelib_get_dir_entry (typelib, i);
 	  if (entry->blob_type < 4)
 	    continue;
 	  
-	  offset = *(guint32*)&metadata->data[entry->offset + 8];
-	  type = g_typelib_get_string (metadata, offset);
+	  offset = *(guint32*)&typelib->data[entry->offset + 8];
+	  type = g_typelib_get_string (typelib, offset);
 	  if (strcmp (type, iface_data->type) == 0)
 	    {
 	      index = i;
@@ -271,9 +271,9 @@
 
   if (index != 0)
     {
-      entry = g_typelib_get_dir_entry (metadata, index);
+      entry = g_typelib_get_dir_entry (typelib, index);
       iface_data->iface = g_info_new (entry->blob_type, NULL,
-				      metadata, entry->offset);
+				      typelib, entry->offset);
     }
 }
 
@@ -291,15 +291,15 @@
 
   if (namespace)
     {
-      GTypelib *metadata;
+      GTypelib *typelib;
       
-      metadata = g_hash_table_lookup (repository->priv->metadata, namespace);
+      typelib = g_hash_table_lookup (repository->priv->typelib, namespace);
       
-      if (metadata)
-	find_interface ((void *)namespace, metadata, &data);
+      if (typelib)
+	find_interface ((void *)namespace, typelib, &data);
     }
   else
-    g_hash_table_foreach (repository->priv->metadata, find_interface, &data);
+    g_hash_table_foreach (repository->priv->typelib, find_interface, &data);
 
   return data.iface;  
 }
@@ -315,7 +315,7 @@
   data.index = -1;
   data.iface = NULL;
 
-  g_hash_table_foreach (repository->priv->metadata, find_interface, &data);
+  g_hash_table_foreach (repository->priv->typelib, find_interface, &data);
 
   return data.iface;
 }
@@ -334,15 +334,15 @@
 
   if (namespace)
     {
-      GTypelib *metadata;
+      GTypelib *typelib;
       
-      metadata = g_hash_table_lookup (repository->priv->metadata, namespace);
+      typelib = g_hash_table_lookup (repository->priv->typelib, namespace);
       
-      if (metadata)
-	find_interface ((void *)namespace, metadata, &data);
+      if (typelib)
+	find_interface ((void *)namespace, typelib, &data);
     }
   else
-    g_hash_table_foreach (repository->priv->metadata, find_interface, &data);
+    g_hash_table_foreach (repository->priv->typelib, find_interface, &data);
 
   return data.iface;
 }
@@ -364,7 +364,7 @@
   gchar **names;
   gint i;
 
-  g_hash_table_foreach (repository->priv->metadata, collect_namespaces, &list);
+  g_hash_table_foreach (repository->priv->typelib, collect_namespaces, &list);
 
   names = g_malloc0 (sizeof (gchar *) * (g_list_length (list) + 1));
   i = 0;
@@ -379,15 +379,15 @@
 g_irepository_get_shared_library (GIRepository *repository,
                                    const gchar  *namespace)
 {
-  GTypelib *metadata;
+  GTypelib *typelib;
   Header *header;
 
-  metadata = g_hash_table_lookup (repository->priv->metadata, namespace);
-  if (!metadata)
+  typelib = g_hash_table_lookup (repository->priv->typelib, namespace);
+  if (!typelib)
     return NULL;
-  header = (Header *) metadata->data;
+  header = (Header *) typelib->data;
   if (header->shared_library)
-    return g_typelib_get_string (metadata, header->shared_library);
+    return g_typelib_get_string (typelib, header->shared_library);
   else
     return NULL;
 }
@@ -423,16 +423,16 @@
   gchar *fname, *full_path;
   GMappedFile *mfile;
   GError *error1 = NULL;
-  GTypelib *metadata = NULL;
-  const gchar *metadata_namespace, *shlib_fname;
+  GTypelib *typelib = NULL;
+  const gchar *typelib_namespace, *shlib_fname;
   GModule *module;
   guint32 shlib;
   GHashTable *table;
 
   if (repository != NULL)
-    table = repository->priv->metadata;
+    table = repository->priv->typelib;
   else
-    table = default_metadata;
+    table = default_typelib;
 
   /* don't bother loading a namespace if already registered */
   if (g_hash_table_lookup (table, namespace))
@@ -454,35 +454,35 @@
       continue;
     }
     g_free (full_path);
-    metadata = g_typelib_new_from_mapped_file (mfile);
-    metadata_namespace = g_typelib_get_string (metadata, ((Header *) metadata->data)->namespace);
-    if (strcmp (metadata_namespace, namespace) != 0) {
+    typelib = g_typelib_new_from_mapped_file (mfile);
+    typelib_namespace = g_typelib_get_string (typelib, ((Header *) typelib->data)->namespace);
+    if (strcmp (typelib_namespace, namespace) != 0) {
       g_set_error (error, G_IREPOSITORY_ERROR,
                    G_IREPOSITORY_ERROR_NAMESPACE_MISMATCH,
-                   "Metadata file %s for namespace '%s' contains namespace '%s'"
+                   "Typelib file %s for namespace '%s' contains namespace '%s'"
                    " which doesn't match the file name",
-                   full_path, namespace, metadata_namespace);
+                   full_path, namespace, typelib_namespace);
       return NULL; 
     }
     break;
   }
   g_free (fname);
-  if (metadata == NULL) {
+  if (typelib == NULL) {
     g_set_error (error, G_IREPOSITORY_ERROR,
-                 G_IREPOSITORY_ERROR_METADATA_NOT_FOUND,
-                 "Metadata file for namespace '%s' was not found in search"
+                 G_IREPOSITORY_ERROR_TYPELIB_NOT_FOUND,
+                 "Typelib file for namespace '%s' was not found in search"
                  " path or could not be openened", namespace);
     return NULL;
   }
-  /* optionally load shared library and attach it to the metadata */
-  shlib = ((Header *) metadata->data)->shared_library;
+  /* optionally load shared library and attach it to the typelib */
+  shlib = ((Header *) typelib->data)->shared_library;
   if (shlib) {
-    shlib_fname = g_typelib_get_string (metadata, shlib);
+    shlib_fname = g_typelib_get_string (typelib, shlib);
     module = g_module_open (shlib_fname, G_MODULE_BIND_LAZY|G_MODULE_BIND_LOCAL);
     if (module == NULL) {
       g_set_error (error, G_IREPOSITORY_ERROR,
-                   G_IREPOSITORY_ERROR_METADATA_NOT_FOUND,
-                   "Metadata for namespace '%s' references shared library %s,"
+                   G_IREPOSITORY_ERROR_TYPELIB_NOT_FOUND,
+                   "Typelib for namespace '%s' references shared library %s,"
                    " but it could not be openened (%s)",
                    namespace, shlib_fname, g_module_error ());
       return NULL;
@@ -490,7 +490,7 @@
   }
 
   g_hash_table_remove (table, namespace);
-  return g_irepository_register (repository, metadata);
+  return g_irepository_register (repository, typelib);
 }
 
 

Modified: trunk/girepository/girepository.h
==============================================================================
--- trunk/girepository/girepository.h	(original)
+++ trunk/girepository/girepository.h	Sat Aug  9 12:55:32 2008
@@ -73,7 +73,7 @@
 GType         g_irepository_get_type      (void) G_GNUC_CONST;
 GIRepository *g_irepository_get_default   (void);
 const gchar * g_irepository_register      (GIRepository *repository,
-					   GTypelib    *metadata);
+					   GTypelib    *typelib);
 void          g_irepository_unregister    (GIRepository *repository,
 					   const gchar  *namespace);
 const gchar * g_irepository_register_file (GIRepository *repository,
@@ -94,21 +94,21 @@
 					   gint          index);
 const gchar * g_irepository_get_shared_library (GIRepository *repository,
 						const gchar  *namespace);
-/* Metadata */
+/* Typelib */
 
 GTypelib *   g_typelib_new_from_memory       (guchar       *memory,
                                                 gsize         len);
 GTypelib *   g_typelib_new_from_const_memory (const guchar *memory,
                                                 gsize         len);
 GTypelib *   g_typelib_new_from_mapped_file  (GMappedFile  *mfile);
-void          g_typelib_free                  (GTypelib    *metadata);
-void          g_typelib_set_module            (GTypelib    *metadata,
+void          g_typelib_free                  (GTypelib    *typelib);
+void          g_typelib_set_module            (GTypelib    *typelib,
                                                 GModule      *module);
-const gchar * g_typelib_get_namespace         (GTypelib    *metadata);
+const gchar * g_typelib_get_namespace         (GTypelib    *typelib);
 
 typedef enum
 {
-  G_IREPOSITORY_ERROR_METADATA_NOT_FOUND,
+  G_IREPOSITORY_ERROR_TYPELIB_NOT_FOUND,
   G_IREPOSITORY_ERROR_NAMESPACE_MISMATCH,
   G_IREPOSITORY_ERROR_LIBRARY_NOT_FOUND
 } GIRepositoryError;
@@ -156,11 +156,11 @@
 const gchar *          g_base_info_get_annotation   (GIBaseInfo   *info,
                                                      const gchar  *name);
 GIBaseInfo *           g_base_info_get_container    (GIBaseInfo   *info);
-GTypelib *            g_base_info_get_metadata     (GIBaseInfo   *info);
+GTypelib *             g_base_info_get_typelib      (GIBaseInfo   *info);
 
-GIBaseInfo *           g_info_new                   (GIInfoType     type,
-						     GIBaseInfo    *container,
-						     GTypelib     *metadata, 
+GIBaseInfo *           g_info_new                   (GIInfoType    type,
+						     GIBaseInfo   *container,
+						     GTypelib     *typelib, 
 						     guint32       offset);
 
 

Modified: trunk/girepository/girmodule.c
==============================================================================
--- trunk/girepository/girmodule.c	(original)
+++ trunk/girepository/girmodule.c	Sat Aug  9 12:55:32 2008
@@ -1,4 +1,4 @@
-/* GObject introspection: Metadata creation 
+/* GObject introspection: Typelib creation 
  *
  * Copyright (C) 2005 Matthias Clasen
  *
@@ -61,10 +61,10 @@
 }
 
 GTypelib *
-g_ir_module_build_metadata (GIrModule  *module,
+g_ir_module_build_typelib (GIrModule  *module,
 			     GList       *modules)
 {
-  guchar *metadata;
+  guchar *typelib;
   gsize length;
   gint i;
   GList *e;
@@ -190,7 +190,7 @@
 	  entry->offset = offset;
 	  entry->name = write_string (node->name, strings, data, &offset2);
 
-	  g_ir_node_build_metadata (node, module, modules, 
+	  g_ir_node_build_typelib (node, module, modules, 
 				     strings, types, data, &offset, &offset2);
 
 	  if (offset2 > old_offset + g_ir_node_get_full_size (node))
@@ -208,8 +208,8 @@
   
   g_message ("reallocating to %d bytes", offset2);
 
-  metadata = g_realloc (data, offset2);
+  typelib = g_realloc (data, offset2);
   length = header->size = offset2;
-  return g_typelib_new_from_memory (metadata, length);
+  return g_typelib_new_from_memory (typelib, length);
 }
 

Modified: trunk/girepository/girmodule.h
==============================================================================
--- trunk/girepository/girmodule.h	(original)
+++ trunk/girepository/girmodule.h	Sat Aug  9 12:55:32 2008
@@ -40,7 +40,7 @@
 				       const gchar *module_filename);
 void       g_ir_module_free           (GIrModule  *module);
 
-GTypelib * g_ir_module_build_metadata (GIrModule  *module,
+GTypelib * g_ir_module_build_typelib  (GIrModule  *module,
 				       GList       *modules);
 
 G_END_DECLS

Modified: trunk/girepository/girnode.c
==============================================================================
--- trunk/girepository/girnode.c	(original)
+++ trunk/girepository/girnode.c	Sat Aug  9 12:55:32 2008
@@ -1,4 +1,4 @@
-/* GObject introspection: Metadata creation
+/* GObject introspection: Typelib creation
  *
  * Copyright (C) 2005 Matthias Clasen
  *
@@ -1209,14 +1209,14 @@
 }
 
 void
-g_ir_node_build_metadata (GIrNode   *node,
-			  GIrModule *module,
-			  GList      *modules,
-			  GHashTable *strings,
-			  GHashTable *types,
-			  guchar     *data,
-			  guint32    *offset,
-			  guint32    *offset2)
+g_ir_node_build_typelib (GIrNode   *node,
+			 GIrModule *module,
+			 GList      *modules,
+			 GHashTable *strings,
+			 GHashTable *types,
+			 guchar     *data,
+			 guint32    *offset,
+			 guint32    *offset2)
 {
   GList *l;
   guint32 old_offset = *offset;
@@ -1224,7 +1224,7 @@
 
   g_assert (node != NULL);
 
-  g_debug ("build_metadata (%s)",
+  g_debug ("build_typelib (%s)",
 	   g_ir_node_type_to_string (node->type));
 
   switch (node->type)
@@ -1287,9 +1287,9 @@
 		      pos = *offset2 + 4;
 		      *offset2 += 8;
 		      
-		      g_ir_node_build_metadata ((GIrNode *)type->parameter_type1, 
-						 module, modules, strings, types, 
-						 data, &pos, offset2);
+		      g_ir_node_build_typelib ((GIrNode *)type->parameter_type1, 
+					       module, modules, strings, types, 
+					       data, &pos, offset2);
 		    }
 		    break;
 		    
@@ -1322,9 +1322,9 @@
 		      pos = *offset2 + 4;
 		      *offset2 += 8;
 		      
-		      g_ir_node_build_metadata ((GIrNode *)type->parameter_type1, 
-						 module, modules, strings, types,
-						 data, &pos, offset2);
+		      g_ir_node_build_typelib ((GIrNode *)type->parameter_type1, 
+					       module, modules, strings, types,
+					       data, &pos, offset2);
 		    }
 		    break;
 		    
@@ -1342,12 +1342,12 @@
 		      pos = *offset2 + 4;
 		      *offset2 += 12;
 		      
-		      g_ir_node_build_metadata ((GIrNode *)type->parameter_type1, 
-						 module, modules, strings, types, 
-						 data, &pos, offset2);
-		      g_ir_node_build_metadata ((GIrNode *)type->parameter_type2, 
-						 module, modules, strings, types, 
-						 data, &pos, offset2);
+		      g_ir_node_build_typelib ((GIrNode *)type->parameter_type1, 
+					       module, modules, strings, types, 
+					       data, &pos, offset2);
+		      g_ir_node_build_typelib ((GIrNode *)type->parameter_type2, 
+					       module, modules, strings, types, 
+					       data, &pos, offset2);
 		    }
 		    break;
 		    
@@ -1395,9 +1395,9 @@
 	blob->bits = 0;
 	blob->struct_offset = field->offset;
 
-        g_ir_node_build_metadata ((GIrNode *)field->type, 
-				   module, modules, strings, types,
-				   data, offset, offset2);
+        g_ir_node_build_typelib ((GIrNode *)field->type, 
+				 module, modules, strings, types,
+				 data, offset, offset2);
       }
       break;
 
@@ -1415,9 +1415,9 @@
  	blob->construct_only = prop->construct_only;
 	blob->reserved = 0;
 
-        g_ir_node_build_metadata ((GIrNode *)prop->type, 
-				   module, modules, strings, types,
-				   data, offset, offset2);
+        g_ir_node_build_typelib ((GIrNode *)prop->type, 
+				 module, modules, strings, types,
+				 data, offset, offset2);
       }
       break;
 
@@ -1447,9 +1447,9 @@
 	blob->symbol = write_string (function->symbol, strings, data, offset2);
 	blob->signature = signature;
 	
-        g_ir_node_build_metadata ((GIrNode *)function->result->type, 
-				   module, modules, strings, types,
-				   data, &signature, offset2);
+        g_ir_node_build_typelib ((GIrNode *)function->result->type, 
+				 module, modules, strings, types,
+				 data, &signature, offset2);
 
 	blob2->may_return_null = function->result->null_ok;
 	blob2->caller_owns_return_value = function->result->transfer;
@@ -1463,9 +1463,9 @@
 	  {
 	    GIrNode *param = (GIrNode *)l->data;
 
-	    g_ir_node_build_metadata (param, 
-				      module, modules, strings, types,
-				      data, &signature, offset2);
+	    g_ir_node_build_typelib (param, 
+				     module, modules, strings, types,
+				     data, &signature, offset2);
 	  }
       }
       break;
@@ -1490,9 +1490,9 @@
 	blob->name = write_string (node->name, strings, data, offset2);
 	blob->signature = signature;
 	
-        g_ir_node_build_metadata ((GIrNode *)function->result->type, 
-				   module, modules, strings, types,
-				   data, &signature, offset2);
+        g_ir_node_build_typelib ((GIrNode *)function->result->type, 
+				 module, modules, strings, types,
+				 data, &signature, offset2);
 
 	blob2->may_return_null = function->result->null_ok;
 	blob2->caller_owns_return_value = function->result->transfer;
@@ -1506,9 +1506,9 @@
 	  {
 	    GIrNode *param = (GIrNode *)l->data;
 
-	    g_ir_node_build_metadata (param, 
-				       module, modules, strings, types,
-				       data, &signature, offset2);
+	    g_ir_node_build_typelib (param, 
+				     module, modules, strings, types,
+				     data, &signature, offset2);
 	  }
       }
       break;
@@ -1542,9 +1542,9 @@
 	blob->name = write_string (node->name, strings, data, offset2);
 	blob->signature = signature;
 	
-        g_ir_node_build_metadata ((GIrNode *)signal->result->type, 
-				   module, modules, strings, types,
-				   data, &signature, offset2);
+        g_ir_node_build_typelib ((GIrNode *)signal->result->type, 
+				 module, modules, strings, types,
+				 data, &signature, offset2);
 
 	blob2->may_return_null = signal->result->null_ok;
 	blob2->caller_owns_return_value = signal->result->transfer;
@@ -1558,8 +1558,8 @@
 	  {
 	    GIrNode *param = (GIrNode *)l->data;
 
-	    g_ir_node_build_metadata (param, module, modules, strings, types,
-				       data, &signature, offset2);
+	    g_ir_node_build_typelib (param, module, modules, strings, types,
+				     data, &signature, offset2);
 	  }
       }
       break;
@@ -1589,9 +1589,9 @@
 	blob->reserved2 = 0;
 	blob->signature = signature;
 	
-        g_ir_node_build_metadata ((GIrNode *)vfunc->result->type, 
-				   module, modules, strings, types,
-				   data, &signature, offset2);
+        g_ir_node_build_typelib ((GIrNode *)vfunc->result->type, 
+				 module, modules, strings, types,
+				 data, &signature, offset2);
 
 	blob2->may_return_null = vfunc->result->null_ok;
 	blob2->caller_owns_return_value = vfunc->result->transfer;
@@ -1605,8 +1605,8 @@
 	  {
 	    GIrNode *param = (GIrNode *)l->data;
 
-	    g_ir_node_build_metadata (param, module, modules, strings, 
-				       types, data, &signature, offset2);
+	    g_ir_node_build_typelib (param, module, modules, strings, 
+				     types, data, &signature, offset2);
 	  }
       }
       break;
@@ -1629,8 +1629,8 @@
 	blob->return_value = param->retval;
 	blob->reserved = 0;
 
-        g_ir_node_build_metadata ((GIrNode *)param->type, module, modules, 
-				   strings, types, data, offset, offset2);
+        g_ir_node_build_typelib ((GIrNode *)param->type, module, modules, 
+				 strings, types, data, offset, offset2);
       }
       break;
 
@@ -1658,8 +1658,8 @@
 	    if (member->type == G_IR_NODE_FIELD)
 	      {
 		blob->n_fields++;
-		g_ir_node_build_metadata (member, module, modules, strings, 
-					   types, data, offset, offset2);
+		g_ir_node_build_typelib (member, module, modules, strings, 
+					 types, data, offset, offset2);
 	      }
 	  }
 
@@ -1670,8 +1670,8 @@
 	    if (member->type == G_IR_NODE_FUNCTION)
 	      {
 		blob->n_methods++;
-		g_ir_node_build_metadata (member, module, modules, strings, 
-					   types, data, offset, offset2);
+		g_ir_node_build_typelib (member, module, modules, strings, 
+					 types, data, offset, offset2);
 	      }
 	  }
       }
@@ -1701,8 +1701,8 @@
 	    if (member->type == G_IR_NODE_FIELD)
 	      {
 		blob->n_fields++;
-		g_ir_node_build_metadata (member, module, modules, strings, 
-					   types, data, offset, offset2);
+		g_ir_node_build_typelib (member, module, modules, strings, 
+					 types, data, offset, offset2);
 	      }
 	  }
 
@@ -1713,8 +1713,8 @@
 	    if (member->type == G_IR_NODE_FUNCTION)
 	      {
 		blob->n_methods++;
-		g_ir_node_build_metadata (member, module, modules, strings, 
-					   types, data, offset, offset2);
+		g_ir_node_build_typelib (member, module, modules, strings, 
+					 types, data, offset, offset2);
 	      }
 	  }
       }
@@ -1751,9 +1751,9 @@
 	  {
 	    *offset += 24;
 	    blob->discriminated = TRUE;
-	    g_ir_node_build_metadata ((GIrNode *)union_->discriminator_type, 
-				       module, modules, strings, types,
-				       data, offset, offset2);
+	    g_ir_node_build_typelib ((GIrNode *)union_->discriminator_type, 
+				     module, modules, strings, types,
+				     data, offset, offset2);
 	  }
 	else 
 	  {
@@ -1770,8 +1770,8 @@
 	    if (member->type == G_IR_NODE_FIELD)
 	      {
 		blob->n_fields++;
-		g_ir_node_build_metadata (member, module, modules, strings, 
-					   types, data, offset, offset2);
+		g_ir_node_build_typelib (member, module, modules, strings, 
+					 types, data, offset, offset2);
 	      }
 	  }
 
@@ -1782,8 +1782,8 @@
 	    if (member->type == G_IR_NODE_FUNCTION)
 	      {
 		blob->n_functions++;
-		g_ir_node_build_metadata (member, module, modules, strings, 
-					   types, data, offset, offset2);
+		g_ir_node_build_typelib (member, module, modules, strings, 
+					 types, data, offset, offset2);
 	      }
 	  }
 
@@ -1793,8 +1793,8 @@
 	      {
 		GIrNode *member = (GIrNode *)l->data;
 		
-		g_ir_node_build_metadata (member, module, modules, strings, 
-					   types, data, offset, offset2);
+		g_ir_node_build_typelib (member, module, modules, strings, 
+					 types, data, offset, offset2);
 	      }
 	  }
       }
@@ -1837,8 +1837,8 @@
 	    GIrNode *value = (GIrNode *)l->data;
 
 	    blob->n_values++;
-	    g_ir_node_build_metadata (value, module, modules, strings, types,
-				       data, offset, offset2);
+	    g_ir_node_build_typelib (value, module, modules, strings, types,
+				     data, offset, offset2);
 	  }
       }
       break;
@@ -1883,8 +1883,8 @@
 	    if (member->type == G_IR_NODE_FIELD)
 	      {
 		blob->n_fields++;
-		g_ir_node_build_metadata (member, module, modules, strings, 
-					   types, data, offset, offset2);
+		g_ir_node_build_typelib (member, module, modules, strings, 
+					 types, data, offset, offset2);
 	      }
 	  }
 
@@ -1896,8 +1896,8 @@
 	    if (member->type == G_IR_NODE_PROPERTY)
 	      {
 		blob->n_properties++;
-		g_ir_node_build_metadata (member, module, modules, strings, 
-					   types, data, offset, offset2);
+		g_ir_node_build_typelib (member, module, modules, strings, 
+					 types, data, offset, offset2);
 	      }
 	  }
 
@@ -1909,8 +1909,8 @@
 	    if (member->type == G_IR_NODE_FUNCTION)
 	      {
 		blob->n_methods++;
-		g_ir_node_build_metadata (member, module, modules, strings, 
-					   types, data, offset, offset2);
+		g_ir_node_build_typelib (member, module, modules, strings, 
+					 types, data, offset, offset2);
 	      }
 	  }
 
@@ -1922,8 +1922,8 @@
 	    if (member->type == G_IR_NODE_SIGNAL)
 	      {
 		blob->n_signals++;
-		g_ir_node_build_metadata (member, module, modules, strings, 
-					   types, data, offset, offset2);
+		g_ir_node_build_typelib (member, module, modules, strings, 
+					 types, data, offset, offset2);
 	      }
 	  }
 
@@ -1935,8 +1935,8 @@
 	    if (member->type == G_IR_NODE_VFUNC)
 	      {
 		blob->n_vfuncs++;
-		g_ir_node_build_metadata (member, module, modules, strings, 
-					   types, data, offset, offset2);
+		g_ir_node_build_typelib (member, module, modules, strings, 
+					 types, data, offset, offset2);
 	      }
 	  }
 
@@ -1948,8 +1948,8 @@
 	    if (member->type == G_IR_NODE_CONSTANT)
 	      {
 		blob->n_constants++;
-		g_ir_node_build_metadata (member, module, modules, strings, 
-					   types, data, offset, offset2);
+		g_ir_node_build_typelib (member, module, modules, strings, 
+					 types, data, offset, offset2);
 	      }
 	  }
       }
@@ -1989,8 +1989,8 @@
 	    if (member->type == G_IR_NODE_PROPERTY)
 	      {
 		blob->n_properties++;
-		g_ir_node_build_metadata (member, module, modules, strings, 
-					   types, data, offset, offset2);
+		g_ir_node_build_typelib (member, module, modules, strings, 
+					 types, data, offset, offset2);
 	      }
 	  }
 
@@ -2002,8 +2002,8 @@
 	    if (member->type == G_IR_NODE_FUNCTION)
 	      {
 		blob->n_methods++;
-		g_ir_node_build_metadata (member, module, modules, strings, 
-					   types, data, offset, offset2);
+		g_ir_node_build_typelib (member, module, modules, strings, 
+					 types, data, offset, offset2);
 	      }
 	  }
 
@@ -2015,8 +2015,8 @@
 	    if (member->type == G_IR_NODE_SIGNAL)
 	      {
 		blob->n_signals++;
-		g_ir_node_build_metadata (member, module, modules, strings, 
-					   types, data, offset, offset2);
+		g_ir_node_build_typelib (member, module, modules, strings, 
+					 types, data, offset, offset2);
 	      }
 	  }
 
@@ -2028,8 +2028,8 @@
 	    if (member->type == G_IR_NODE_VFUNC)
 	      {
 		blob->n_vfuncs++;
-		g_ir_node_build_metadata (member, module, modules, strings, 
-					   types, data, offset, offset2);
+		g_ir_node_build_typelib (member, module, modules, strings, 
+					 types, data, offset, offset2);
 	      }
 	  }
 
@@ -2041,8 +2041,8 @@
 	    if (member->type == G_IR_NODE_CONSTANT)
 	      {
 		blob->n_constants++;
-		g_ir_node_build_metadata (member, module, modules, strings, 
-					   types, data, offset, offset2);
+		g_ir_node_build_typelib (member, module, modules, strings, 
+					 types, data, offset, offset2);
 	      }
 	  }
       }
@@ -2165,8 +2165,8 @@
 	  }
 	*offset2 += ALIGN_VALUE (blob->size, 4);
 	
-	g_ir_node_build_metadata ((GIrNode *)constant->type, module, modules, 
-				   strings, types, data, &pos, offset2);
+	g_ir_node_build_typelib ((GIrNode *)constant->type, module, modules, 
+				 strings, types, data, &pos, offset2);
       }
       break;
     default:
@@ -2182,8 +2182,8 @@
 }
 
 /* if str is already in the pool, return previous location, otherwise write str
- * to the metadata at offset, put it in the pool and update offset. If the 
- * metadata is not large enough to hold the string, reallocate it.
+ * to the typelib at offset, put it in the pool and update offset. If the 
+ * typelib is not large enough to hold the string, reallocate it.
  */
 guint32 
 write_string (const gchar *str,

Modified: trunk/girepository/girnode.h
==============================================================================
--- trunk/girepository/girnode.h	(original)
+++ trunk/girepository/girnode.h	Sat Aug  9 12:55:32 2008
@@ -309,23 +309,23 @@
 void      g_ir_node_free            (GIrNode    *node);
 guint32   g_ir_node_get_size        (GIrNode    *node);
 guint32   g_ir_node_get_full_size   (GIrNode    *node);
-void      g_ir_node_build_metadata  (GIrNode    *node,
-				      GIrModule  *module,
-				      GList       *modules,
-                                      GHashTable  *strings,
-                                      GHashTable  *types,
-				      guchar      *data,
-				      guint32     *offset,
-                                      guint32     *offset2);
+void      g_ir_node_build_typelib   (GIrNode    *node,
+				     GIrModule  *module,
+				     GList       *modules,
+				     GHashTable  *strings,
+				     GHashTable  *types,
+				     guchar      *data,
+				     guint32     *offset,
+				     guint32     *offset2);
 int       g_ir_node_cmp             (GIrNode    *node,
-				      GIrNode    *other);
+				     GIrNode    *other);
 gboolean  g_ir_node_can_have_member (GIrNode    *node);
 void      g_ir_node_add_member      (GIrNode         *node,
-				      GIrNodeFunction *member);
-guint32   write_string               (const gchar *str,
-				      GHashTable  *strings, 
-				      guchar      *data,
-				      guint32     *offset);
+				     GIrNodeFunction *member);
+guint32   write_string              (const gchar *str,
+				     GHashTable  *strings, 
+				     guchar      *data,
+				     guint32     *offset);
 
 const gchar * g_ir_node_param_direction_string (GIrNodeParam * node);
 

Modified: trunk/girepository/gtypelib.c
==============================================================================
--- trunk/girepository/gtypelib.c	(original)
+++ trunk/girepository/gtypelib.c	Sat Aug  9 12:55:32 2008
@@ -1,5 +1,5 @@
-/* GObject introspection: metadata validation, auxiliary functions 
- * related to the binary metadata format
+/* GObject introspection: typelib validation, auxiliary functions 
+ * related to the binary typelib format
  *
  * Copyright (C) 2005 Matthias Clasen
  *
@@ -32,12 +32,12 @@
 
 
 DirEntry *
-g_typelib_get_dir_entry (GTypelib *metadata,
+g_typelib_get_dir_entry (GTypelib *typelib,
 			  guint16    index)
 {
-  Header *header = (Header *)metadata->data;
+  Header *header = (Header *)typelib->data;
 
-  return (DirEntry *)&metadata->data[header->directory + (index - 1) * header->entry_blob_size];
+  return (DirEntry *)&typelib->data[header->directory + (index - 1) * header->entry_blob_size];
 }
 
 void    
@@ -97,12 +97,12 @@
 }
 
 static gboolean 
-validate_header (GTypelib  *metadata,
+validate_header (GTypelib  *typelib,
 		 GError    **error)
 {
   Header *header;
 
-  if (metadata->len < sizeof (Header))
+  if (typelib->len < sizeof (Header))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -111,7 +111,7 @@
       return FALSE;
     }
 
-  header = (Header *)metadata->data;
+  header = (Header *)typelib->data;
 
   if (strncmp (header->magic, G_IR_MAGIC, 16) != 0)
     {
@@ -142,12 +142,12 @@
       return FALSE; 
     }
 
-  if (header->size != metadata->len)
+  if (header->size != typelib->len)
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
 		   G_TYPELIB_ERROR_INVALID_HEADER,
-		   "Metadata size mismatch");
+		   "Typelib size mismatch");
       return FALSE; 
     }
 
@@ -204,7 +204,7 @@
       return FALSE; 
     }
 
-  if (!is_name (metadata->data, header->namespace))
+  if (!is_name (typelib->data, header->namespace))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -216,14 +216,14 @@
   return TRUE;
 }
 
-static gboolean validate_type_blob (GTypelib     *metadata,
+static gboolean validate_type_blob (GTypelib     *typelib,
 				    guint32        offset,
 				    guint32        signature_offset,
 				    gboolean       return_type,
 				    GError       **error);
 
 static gboolean
-validate_array_type_blob (GTypelib     *metadata,
+validate_array_type_blob (GTypelib     *typelib,
 			  guint32        offset,
 			  guint32        signature_offset,
 			  gboolean       return_type,
@@ -231,7 +231,7 @@
 {
   ArrayTypeBlob *blob;
 
-  blob = (ArrayTypeBlob*)&metadata->data[offset];
+  blob = (ArrayTypeBlob*)&typelib->data[offset];
 
   if (!blob->pointer)
     {
@@ -244,7 +244,7 @@
 
   /* FIXME validate length */
 
-  if (!validate_type_blob (metadata,
+  if (!validate_type_blob (typelib,
 			   offset + G_STRUCT_OFFSET (ArrayTypeBlob, type),
 			   0, FALSE, error))
     return FALSE;
@@ -253,7 +253,7 @@
 }
 
 static gboolean
-validate_iface_type_blob (GTypelib     *metadata,
+validate_iface_type_blob (GTypelib     *typelib,
 			  guint32        offset,
 			  guint32        signature_offset,
 			  gboolean       return_type,
@@ -262,9 +262,9 @@
   InterfaceTypeBlob *blob;
   Header *header;
 
-  header = (Header *)metadata->data;
+  header = (Header *)typelib->data;
 
-  blob = (InterfaceTypeBlob*)&metadata->data[offset];
+  blob = (InterfaceTypeBlob*)&typelib->data[offset];
 
   if (blob->interface == 0 || blob->interface > header->n_entries)
     {
@@ -279,7 +279,7 @@
 }
 
 static gboolean
-validate_param_type_blob (GTypelib     *metadata,
+validate_param_type_blob (GTypelib     *typelib,
 			  guint32        offset,
 			  guint32        signature_offset,
 			  gboolean       return_type,
@@ -289,7 +289,7 @@
   ParamTypeBlob *blob;
   gint i;
 
-  blob = (ParamTypeBlob*)&metadata->data[offset];
+  blob = (ParamTypeBlob*)&typelib->data[offset];
 
   if (!blob->pointer)
     {
@@ -311,7 +311,7 @@
   
   for (i = 0; i < n_params; i++)
     {
-      if (!validate_type_blob (metadata,
+      if (!validate_type_blob (typelib,
 			       offset + sizeof (ParamTypeBlob) +
 			       i * sizeof (SimpleTypeBlob),
 			       0, FALSE, error))
@@ -322,7 +322,7 @@
 }
 
 static gboolean
-validate_error_type_blob (GTypelib     *metadata,
+validate_error_type_blob (GTypelib     *typelib,
 			  guint32        offset,
 			  guint32        signature_offset,
 			  gboolean       return_type,
@@ -333,9 +333,9 @@
   gint i;
   DirEntry *entry;
 
-  blob = (ErrorTypeBlob*)&metadata->data[offset];
+  blob = (ErrorTypeBlob*)&typelib->data[offset];
 
-  header = (Header *)metadata->data;
+  header = (Header *)typelib->data;
 
   if (!blob->pointer)
     {
@@ -357,7 +357,7 @@
 	  return FALSE;	        
 	}
 
-      entry = g_typelib_get_dir_entry (metadata, blob->domains[i]);
+      entry = g_typelib_get_dir_entry (typelib, blob->domains[i]);
 
       if (entry->blob_type != BLOB_TYPE_ERROR_DOMAIN &&
 	  (entry->local || entry->blob_type != BLOB_TYPE_INVALID))
@@ -374,7 +374,7 @@
 }
 
 static gboolean
-validate_type_blob (GTypelib     *metadata,
+validate_type_blob (GTypelib     *typelib,
 		    guint32        offset,
 		    guint32        signature_offset,
 		    gboolean       return_type,
@@ -383,7 +383,7 @@
   SimpleTypeBlob *simple;
   InterfaceTypeBlob *iface;
   
-  simple = (SimpleTypeBlob *)&metadata->data[offset];
+  simple = (SimpleTypeBlob *)&typelib->data[offset];
 
   if (simple->reserved == 0 && 
       simple->reserved2 == 0)
@@ -410,33 +410,33 @@
       return TRUE;
     }
 
-  iface = (InterfaceTypeBlob*)&metadata->data[simple->offset];
+  iface = (InterfaceTypeBlob*)&typelib->data[simple->offset];
 
   switch (iface->tag)
     {
     case TYPE_TAG_ARRAY:
-      if (!validate_array_type_blob (metadata, simple->offset, 
+      if (!validate_array_type_blob (typelib, simple->offset, 
 				     signature_offset, return_type, error))
 	return FALSE;
       break;
     case TYPE_TAG_INTERFACE:
-      if (!validate_iface_type_blob (metadata, simple->offset, 
+      if (!validate_iface_type_blob (typelib, simple->offset, 
 				     signature_offset, return_type, error))
 	return FALSE;
       break;
     case TYPE_TAG_LIST:
     case TYPE_TAG_SLIST:
-      if (!validate_param_type_blob (metadata, simple->offset, 
+      if (!validate_param_type_blob (typelib, simple->offset, 
 				     signature_offset, return_type, 1, error))
 	return FALSE;
       break;
     case TYPE_TAG_HASH:
-      if (!validate_param_type_blob (metadata, simple->offset, 
+      if (!validate_param_type_blob (typelib, simple->offset, 
 				     signature_offset, return_type, 2, error))
 	return FALSE;
       break;
     case TYPE_TAG_ERROR:
-      if (!validate_error_type_blob (metadata, simple->offset, 
+      if (!validate_error_type_blob (typelib, simple->offset, 
 				     signature_offset, return_type, error))
 	return FALSE;
       break;
@@ -452,14 +452,14 @@
 }
 
 static gboolean
-validate_arg_blob (GTypelib     *metadata,
+validate_arg_blob (GTypelib     *typelib,
 		   guint32        offset,
 		   guint32        signature_offset,
 		   GError       **error)
 {
   ArgBlob *blob;
 
-  if (metadata->len < offset + sizeof (ArgBlob))
+  if (typelib->len < offset + sizeof (ArgBlob))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -468,9 +468,9 @@
       return FALSE;
     }
 
-  blob = (ArgBlob*) &metadata->data[offset];
+  blob = (ArgBlob*) &typelib->data[offset];
 
-  if (!is_name (metadata->data, blob->name))
+  if (!is_name (typelib->data, blob->name))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -479,7 +479,7 @@
       return FALSE; 
     }
  
-  if (!validate_type_blob (metadata, 
+  if (!validate_type_blob (typelib, 
 			   offset + G_STRUCT_OFFSET (ArgBlob, arg_type), 
 			   signature_offset, FALSE, error))
     return FALSE;
@@ -488,14 +488,14 @@
 }
 
 static gboolean
-validate_signature_blob (GTypelib     *metadata,
+validate_signature_blob (GTypelib     *typelib,
 			 guint32        offset,
 			 GError       **error)
 {
   SignatureBlob *blob;
   gint i;
 
-  if (metadata->len < offset + sizeof (SignatureBlob))
+  if (typelib->len < offset + sizeof (SignatureBlob))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -504,11 +504,11 @@
       return FALSE;
     }
 
-  blob = (SignatureBlob*) &metadata->data[offset];
+  blob = (SignatureBlob*) &typelib->data[offset];
 
   if (blob->return_type.offset != 0)
     {
-      if (!validate_type_blob (metadata, 
+      if (!validate_type_blob (typelib, 
 			       offset + G_STRUCT_OFFSET (SignatureBlob, return_type), 
 			       offset, TRUE, error))
 	return FALSE;
@@ -516,7 +516,7 @@
 
   for (i = 0; i < blob->n_arguments; i++)
     {
-      if (!validate_arg_blob (metadata, 
+      if (!validate_arg_blob (typelib, 
 			      offset + sizeof (SignatureBlob) + 
 			      i * sizeof (ArgBlob), 
 			      offset, 
@@ -530,14 +530,14 @@
 }
 
 static gboolean
-validate_function_blob (GTypelib     *metadata,
+validate_function_blob (GTypelib     *typelib,
 			guint32        offset,
 			guint16        container_type,
 			GError       **error)
 {
   FunctionBlob *blob;
 
-  if (metadata->len < offset + sizeof (FunctionBlob))
+  if (typelib->len < offset + sizeof (FunctionBlob))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -546,7 +546,7 @@
       return FALSE;
     }
 
-  blob = (FunctionBlob*) &metadata->data[offset];
+  blob = (FunctionBlob*) &typelib->data[offset];
 
   if (blob->blob_type != BLOB_TYPE_FUNCTION)
     {
@@ -557,7 +557,7 @@
       return FALSE;
     }
 
-  if (!is_name (metadata->data, blob->name))
+  if (!is_name (typelib->data, blob->name))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -566,7 +566,7 @@
       return FALSE; 
     }
   
-  if (!is_name (metadata->data, blob->symbol))
+  if (!is_name (typelib->data, blob->symbol))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -624,20 +624,20 @@
   /* FIXME: validate "this" argument for methods */
   /* FIXME: validate return type for constructors */
 
-  if (!validate_signature_blob (metadata, blob->signature, error))
+  if (!validate_signature_blob (typelib, blob->signature, error))
     return FALSE;
 	
   return TRUE;
 }
 
 static gboolean
-validate_callback_blob (GTypelib     *metadata,
+validate_callback_blob (GTypelib     *typelib,
 			guint32        offset,
 			GError       **error)
 {
   CallbackBlob *blob;
 
-  if (metadata->len < offset + sizeof (CallbackBlob))
+  if (typelib->len < offset + sizeof (CallbackBlob))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -646,7 +646,7 @@
       return FALSE;
     }
 
-  blob = (CallbackBlob*) &metadata->data[offset];
+  blob = (CallbackBlob*) &typelib->data[offset];
 
   if (blob->blob_type != BLOB_TYPE_CALLBACK)
     {
@@ -657,7 +657,7 @@
       return FALSE;
     }
 
-  if (!is_name (metadata->data, blob->name))
+  if (!is_name (typelib->data, blob->name))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -666,14 +666,14 @@
       return FALSE; 
     }
   
-  if (!validate_signature_blob (metadata, blob->signature, error))
+  if (!validate_signature_blob (typelib, blob->signature, error))
     return FALSE;
 	
   return TRUE;
 }
 
 static gboolean
-validate_constant_blob (GTypelib     *metadata,
+validate_constant_blob (GTypelib     *typelib,
 			guint32        offset,
 			GError       **error)
 {
@@ -688,7 +688,7 @@
   ConstantBlob *blob;
   SimpleTypeBlob *type;
 
-  if (metadata->len < offset + sizeof (ConstantBlob))
+  if (typelib->len < offset + sizeof (ConstantBlob))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -697,7 +697,7 @@
       return FALSE;
     }
 
-  blob = (ConstantBlob*) &metadata->data[offset];
+  blob = (ConstantBlob*) &typelib->data[offset];
 
   if (blob->blob_type != BLOB_TYPE_CONSTANT)
     {
@@ -708,7 +708,7 @@
       return FALSE;
     }
 
-  if (!is_name (metadata->data, blob->name))
+  if (!is_name (typelib->data, blob->name))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -717,7 +717,7 @@
       return FALSE; 
     }
   
-  if (!validate_type_blob (metadata, offset + G_STRUCT_OFFSET (ConstantBlob, type), 
+  if (!validate_type_blob (typelib, offset + G_STRUCT_OFFSET (ConstantBlob, type), 
 			   0, FALSE, error))
     return FALSE;
 
@@ -730,7 +730,7 @@
       return FALSE;
     }
   
-  type = (SimpleTypeBlob *)&metadata->data[offset + G_STRUCT_OFFSET (ConstantBlob, type)];
+  type = (SimpleTypeBlob *)&typelib->data[offset + G_STRUCT_OFFSET (ConstantBlob, type)];
   if (type->reserved == 0)
     {
       if (type->tag == 0)
@@ -758,13 +758,13 @@
 }
 
 static gboolean
-validate_value_blob (GTypelib     *metadata,
+validate_value_blob (GTypelib     *typelib,
 		     guint32        offset,
 		     GError       **error)
 {
   ValueBlob *blob;
 
-  if (metadata->len < offset + sizeof (ValueBlob))
+  if (typelib->len < offset + sizeof (ValueBlob))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -773,9 +773,9 @@
       return FALSE;
     }
 
-  blob = (ValueBlob*) &metadata->data[offset];
+  blob = (ValueBlob*) &typelib->data[offset];
 
-  if (!is_name (metadata->data, blob->name))
+  if (!is_name (typelib->data, blob->name))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -788,13 +788,13 @@
 }
 
 static gboolean
-validate_field_blob (GTypelib     *metadata,
+validate_field_blob (GTypelib     *typelib,
 		     guint32        offset,
 		     GError       **error)
 {
   FieldBlob *blob;
 
-  if (metadata->len < offset + sizeof (FieldBlob))
+  if (typelib->len < offset + sizeof (FieldBlob))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -803,9 +803,9 @@
       return FALSE;
     }
 
-  blob = (FieldBlob*) &metadata->data[offset];
+  blob = (FieldBlob*) &typelib->data[offset];
   
-  if (!is_name (metadata->data, blob->name))
+  if (!is_name (typelib->data, blob->name))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -814,7 +814,7 @@
       return FALSE; 
     }
     
-  if (!validate_type_blob (metadata,
+  if (!validate_type_blob (typelib,
 			   offset + G_STRUCT_OFFSET (FieldBlob, type), 
 			   0, FALSE, error))
     return FALSE;
@@ -823,13 +823,13 @@
 }
 
 static gboolean
-validate_property_blob (GTypelib     *metadata,
+validate_property_blob (GTypelib     *typelib,
 			guint32        offset,
 			GError       **error)
 {
   PropertyBlob *blob;
 
-  if (metadata->len < offset + sizeof (PropertyBlob))
+  if (typelib->len < offset + sizeof (PropertyBlob))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -838,9 +838,9 @@
       return FALSE;
     }
 
-  blob = (PropertyBlob*) &metadata->data[offset];
+  blob = (PropertyBlob*) &typelib->data[offset];
   
-  if (!is_name (metadata->data, blob->name))
+  if (!is_name (typelib->data, blob->name))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -849,7 +849,7 @@
       return FALSE; 
     }
     
-  if (!validate_type_blob (metadata,
+  if (!validate_type_blob (typelib,
 			   offset + G_STRUCT_OFFSET (PropertyBlob, type), 
 			   0, FALSE, error))
     return FALSE;
@@ -858,7 +858,7 @@
 }
 
 static gboolean
-validate_signal_blob (GTypelib     *metadata,
+validate_signal_blob (GTypelib     *typelib,
 		      guint32        offset,
 		      guint32        container_offset,
 		      GError       **error)
@@ -866,7 +866,7 @@
   SignalBlob *blob;
   gint n_signals;
 
-  if (metadata->len < offset + sizeof (SignalBlob))
+  if (typelib->len < offset + sizeof (SignalBlob))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -875,9 +875,9 @@
       return FALSE;
     }
 
-  blob = (SignalBlob*) &metadata->data[offset];
+  blob = (SignalBlob*) &typelib->data[offset];
 
-  if (!is_name (metadata->data, blob->name))
+  if (!is_name (typelib->data, blob->name))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -899,11 +899,11 @@
 
   if (blob->has_class_closure)
     {
-      if (((CommonBlob*)&metadata->data[container_offset])->blob_type == BLOB_TYPE_OBJECT)
+      if (((CommonBlob*)&typelib->data[container_offset])->blob_type == BLOB_TYPE_OBJECT)
 	{
 	  ObjectBlob *object;
 
-	  object = (ObjectBlob*)&metadata->data[container_offset];
+	  object = (ObjectBlob*)&typelib->data[container_offset];
 	  
 	  n_signals = object->n_signals;
 	}
@@ -911,7 +911,7 @@
 	{
 	  InterfaceBlob *iface;
 	  
-	  iface = (InterfaceBlob*)&metadata->data[container_offset];
+	  iface = (InterfaceBlob*)&typelib->data[container_offset];
 	  
 	  n_signals = iface->n_signals;
 	}
@@ -926,14 +926,14 @@
 	}
     }
 
-  if (!validate_signature_blob (metadata, blob->signature, error))
+  if (!validate_signature_blob (typelib, blob->signature, error))
     return FALSE;
   
   return TRUE;
 }
 
 static gboolean
-validate_vfunc_blob (GTypelib     *metadata,
+validate_vfunc_blob (GTypelib     *typelib,
 		     guint32        offset,
 		     guint32        container_offset,
 		     GError       **error)
@@ -941,7 +941,7 @@
   VFuncBlob *blob;
   gint n_vfuncs;
 
-  if (metadata->len < offset + sizeof (VFuncBlob))
+  if (typelib->len < offset + sizeof (VFuncBlob))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -950,9 +950,9 @@
       return FALSE;
     }
 
-  blob = (VFuncBlob*) &metadata->data[offset];
+  blob = (VFuncBlob*) &typelib->data[offset];
 
-  if (!is_name (metadata->data, blob->name))
+  if (!is_name (typelib->data, blob->name))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -963,11 +963,11 @@
   
   if (blob->class_closure)
     {
-      if (((CommonBlob*)&metadata->data[container_offset])->blob_type == BLOB_TYPE_OBJECT)
+      if (((CommonBlob*)&typelib->data[container_offset])->blob_type == BLOB_TYPE_OBJECT)
 	{
 	  ObjectBlob *object;
 
-	  object = (ObjectBlob*)&metadata->data[container_offset];
+	  object = (ObjectBlob*)&typelib->data[container_offset];
 	  
 	  n_vfuncs = object->n_vfuncs;
 	}
@@ -975,7 +975,7 @@
 	{
 	  InterfaceBlob *iface;
 	  
-	  iface = (InterfaceBlob*)&metadata->data[container_offset];
+	  iface = (InterfaceBlob*)&typelib->data[container_offset];
 	  
 	  n_vfuncs = iface->n_vfuncs;
 	}
@@ -990,14 +990,14 @@
 	}
     }
 
-  if (!validate_signature_blob (metadata, blob->signature, error))
+  if (!validate_signature_blob (typelib, blob->signature, error))
     return FALSE;
   
   return TRUE;
 }
 
 static gboolean
-validate_struct_blob (GTypelib     *metadata,
+validate_struct_blob (GTypelib     *typelib,
 		      guint32        offset,
 		      guint16        blob_type,
 		      GError       **error)
@@ -1005,7 +1005,7 @@
   StructBlob *blob;
   gint i;
 
-  if (metadata->len < offset + sizeof (StructBlob))
+  if (typelib->len < offset + sizeof (StructBlob))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -1014,7 +1014,7 @@
       return FALSE;
     }
 
-  blob = (StructBlob*) &metadata->data[offset];
+  blob = (StructBlob*) &typelib->data[offset];
 
   if (blob->blob_type != blob_type)
     {
@@ -1035,7 +1035,7 @@
       return FALSE;
     }
 
-  if (!is_name (metadata->data, blob->name))
+  if (!is_name (typelib->data, blob->name))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -1046,7 +1046,7 @@
   
   if (blob_type == BLOB_TYPE_BOXED)
     {
-      if (!is_name (metadata->data, blob->gtype_name))
+      if (!is_name (typelib->data, blob->gtype_name))
 	{
 	  g_set_error (error,
 		       G_TYPELIB_ERROR,
@@ -1055,7 +1055,7 @@
 	  return FALSE; 
 	}
 
-      if (!is_name (metadata->data, blob->gtype_init))
+      if (!is_name (typelib->data, blob->gtype_init))
 	{
 	  g_set_error (error,
 		       G_TYPELIB_ERROR,
@@ -1076,7 +1076,7 @@
 	}
     }
 
-  if (metadata->len < offset + sizeof (StructBlob) + 
+  if (typelib->len < offset + sizeof (StructBlob) + 
             blob->n_fields * sizeof (FieldBlob) +
             blob->n_methods * sizeof (FunctionBlob))
     {
@@ -1089,7 +1089,7 @@
 
   for (i = 0; i < blob->n_fields; i++)
     {
-      if (!validate_field_blob (metadata, 
+      if (!validate_field_blob (typelib, 
 				offset + sizeof (StructBlob) + 
 				i * sizeof (FieldBlob), 
 				error))
@@ -1098,7 +1098,7 @@
 
   for (i = 0; i < blob->n_methods; i++)
     {
-      if (!validate_function_blob (metadata, 
+      if (!validate_function_blob (typelib, 
 				   offset + sizeof (StructBlob) + 
 				   blob->n_fields * sizeof (FieldBlob) + 
 				   i * sizeof (FunctionBlob), 
@@ -1111,7 +1111,7 @@
 }
 
 static gboolean
-validate_enum_blob (GTypelib     *metadata,
+validate_enum_blob (GTypelib     *typelib,
 		    guint32        offset,
 		    guint16        blob_type,
 		    GError       **error)
@@ -1120,7 +1120,7 @@
   ValueBlob *v1, *v2;
   gint i, j; 
 
-  if (metadata->len < offset + sizeof (EnumBlob))
+  if (typelib->len < offset + sizeof (EnumBlob))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -1129,7 +1129,7 @@
       return FALSE;
     }
 
-  blob = (EnumBlob*) &metadata->data[offset];
+  blob = (EnumBlob*) &typelib->data[offset];
 
   if (blob->blob_type != blob_type)
     {
@@ -1142,7 +1142,7 @@
   
   if (!blob->unregistered)
     {
-      if (!is_name (metadata->data, blob->gtype_name))
+      if (!is_name (typelib->data, blob->gtype_name))
 	{
 	  g_set_error (error,
 		       G_TYPELIB_ERROR,
@@ -1151,7 +1151,7 @@
 	  return FALSE; 
 	}
 
-      if (!is_name (metadata->data, blob->gtype_init))
+      if (!is_name (typelib->data, blob->gtype_init))
 	{
 	  g_set_error (error,
 		       G_TYPELIB_ERROR,
@@ -1172,7 +1172,7 @@
 	}
     }
 
-  if (!is_name (metadata->data, blob->name))
+  if (!is_name (typelib->data, blob->name))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -1181,7 +1181,7 @@
       return FALSE; 
     }
   
-  if (metadata->len < offset + sizeof (EnumBlob) + 
+  if (typelib->len < offset + sizeof (EnumBlob) + 
       blob->n_values * sizeof (ValueBlob))
     {
       g_set_error (error,
@@ -1193,17 +1193,17 @@
   
   for (i = 0; i < blob->n_values; i++)
     {
-      if (!validate_value_blob (metadata, 
+      if (!validate_value_blob (typelib, 
 				offset + sizeof (EnumBlob) + 
 				i * sizeof (ValueBlob), 
 				error))
 	return FALSE;
 
-      v1 = (ValueBlob *)&metadata->data[offset + sizeof (EnumBlob) + 
+      v1 = (ValueBlob *)&typelib->data[offset + sizeof (EnumBlob) + 
                                         i * sizeof (ValueBlob)];
       for (j = 0; j < i; j++) 
 	{
-	  v2 = (ValueBlob *)&metadata->data[offset + sizeof (EnumBlob) + 
+	  v2 = (ValueBlob *)&typelib->data[offset + sizeof (EnumBlob) + 
                                             j * sizeof (ValueBlob)];
 
 	  if (v1->value == v2->value)
@@ -1222,7 +1222,7 @@
 }
 
 static gboolean
-validate_object_blob (GTypelib     *metadata,
+validate_object_blob (GTypelib     *typelib,
 		      guint32        offset,
 		      GError       **error)
 {
@@ -1231,9 +1231,9 @@
   gint i;
   guint32 offset2;
 
-  header = (Header *)metadata->data;
+  header = (Header *)typelib->data;
 
-  if (metadata->len < offset + sizeof (ObjectBlob))
+  if (typelib->len < offset + sizeof (ObjectBlob))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -1242,7 +1242,7 @@
       return FALSE;
     }
 
-  blob = (ObjectBlob*) &metadata->data[offset];
+  blob = (ObjectBlob*) &typelib->data[offset];
 
   if (blob->blob_type != BLOB_TYPE_OBJECT)
     {
@@ -1253,7 +1253,7 @@
       return FALSE;
     }
   
-  if (!is_name (metadata->data, blob->gtype_name))
+  if (!is_name (typelib->data, blob->gtype_name))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -1262,7 +1262,7 @@
       return FALSE; 
     }
   
-  if (!is_name (metadata->data, blob->gtype_init))
+  if (!is_name (typelib->data, blob->gtype_init))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -1271,7 +1271,7 @@
       return FALSE; 
     }
   
-  if (!is_name (metadata->data, blob->name))
+  if (!is_name (typelib->data, blob->name))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -1293,7 +1293,7 @@
     {
       DirEntry *entry;
 
-      entry = g_typelib_get_dir_entry (metadata, blob->parent);
+      entry = g_typelib_get_dir_entry (typelib, blob->parent);
       if (entry->blob_type != BLOB_TYPE_OBJECT &&
 	  (entry->local || entry->blob_type != 0))
 	{
@@ -1305,7 +1305,7 @@
 	}
     }
   
-  if (metadata->len < offset + sizeof (ObjectBlob) + 
+  if (typelib->len < offset + sizeof (ObjectBlob) + 
             (blob->n_interfaces + blob->n_interfaces % 2) * 2 +
             blob->n_fields * sizeof (FieldBlob) +
             blob->n_properties * sizeof (PropertyBlob) +
@@ -1329,7 +1329,7 @@
       guint16 iface;
       DirEntry *entry;
 
-      iface = *(guint16*)&metadata->data[offset2];
+      iface = *(guint16*)&typelib->data[offset2];
       if (iface == 0 || iface > header->n_entries)
 	{
 	  g_set_error (error,
@@ -1339,7 +1339,7 @@
 	  return FALSE; 
 	}
       
-      entry = g_typelib_get_dir_entry (metadata, iface);
+      entry = g_typelib_get_dir_entry (typelib, iface);
 
       if (entry->blob_type != BLOB_TYPE_INTERFACE &&
 	  (entry->local || entry->blob_type != 0))
@@ -1356,37 +1356,37 @@
 
   for (i = 0; i < blob->n_fields; i++, offset2 += sizeof (FieldBlob))
     {
-      if (!validate_field_blob (metadata, offset2, error))
+      if (!validate_field_blob (typelib, offset2, error))
 	return FALSE;
     }
 
   for (i = 0; i < blob->n_properties; i++, offset2 += sizeof (PropertyBlob))
     {
-      if (!validate_property_blob (metadata, offset2, error))
+      if (!validate_property_blob (typelib, offset2, error))
 	return FALSE;
     }
 
   for (i = 0; i < blob->n_methods; i++, offset2 += sizeof (FunctionBlob))
     {
-      if (!validate_function_blob (metadata, offset2, BLOB_TYPE_OBJECT, error))
+      if (!validate_function_blob (typelib, offset2, BLOB_TYPE_OBJECT, error))
 	return FALSE;
     }
 
   for (i = 0; i < blob->n_signals; i++, offset2 += sizeof (SignalBlob))
     {
-      if (!validate_signal_blob (metadata, offset2, offset, error))
+      if (!validate_signal_blob (typelib, offset2, offset, error))
 	return FALSE;
     }
 
   for (i = 0; i < blob->n_vfuncs; i++, offset2 += sizeof (VFuncBlob))
     {
-      if (!validate_vfunc_blob (metadata, offset2, offset, error))
+      if (!validate_vfunc_blob (typelib, offset2, offset, error))
 	return FALSE;
     }
 
   for (i = 0; i < blob->n_constants; i++, offset2 += sizeof (ConstantBlob))
     {
-      if (!validate_constant_blob (metadata, offset2, error))
+      if (!validate_constant_blob (typelib, offset2, error))
 	return FALSE;
     }
 
@@ -1394,7 +1394,7 @@
 }
 
 static gboolean
-validate_interface_blob (GTypelib     *metadata,
+validate_interface_blob (GTypelib     *typelib,
 			 guint32        offset,
 			 GError       **error)
 {
@@ -1403,9 +1403,9 @@
   gint i;
   guint32 offset2;
   
-  header = (Header *)metadata->data;
+  header = (Header *)typelib->data;
 
-  if (metadata->len < offset + sizeof (InterfaceBlob))
+  if (typelib->len < offset + sizeof (InterfaceBlob))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -1414,7 +1414,7 @@
       return FALSE;
     }
 
-  blob = (InterfaceBlob*) &metadata->data[offset];
+  blob = (InterfaceBlob*) &typelib->data[offset];
 
   if (blob->blob_type != BLOB_TYPE_INTERFACE)
     {
@@ -1425,7 +1425,7 @@
       return FALSE;
     }
   
-  if (!is_name (metadata->data, blob->gtype_name))
+  if (!is_name (typelib->data, blob->gtype_name))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -1434,7 +1434,7 @@
       return FALSE; 
     }
   
-  if (!is_name (metadata->data, blob->gtype_init))
+  if (!is_name (typelib->data, blob->gtype_init))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -1443,7 +1443,7 @@
       return FALSE; 
     }
   
-  if (!is_name (metadata->data, blob->name))
+  if (!is_name (typelib->data, blob->name))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -1452,7 +1452,7 @@
       return FALSE; 
     }
   
-  if (metadata->len < offset + sizeof (InterfaceBlob) + 
+  if (typelib->len < offset + sizeof (InterfaceBlob) + 
             (blob->n_prerequisites + blob->n_prerequisites % 2) * 2 +
             blob->n_properties * sizeof (PropertyBlob) +
             blob->n_methods * sizeof (FunctionBlob) +
@@ -1475,7 +1475,7 @@
       DirEntry *entry;
       guint16 req;
 
-      req = *(guint16*)&metadata->data[offset2];
+      req = *(guint16*)&typelib->data[offset2];
       if (req == 0 || req > header->n_entries)
 	{
 	  g_set_error (error,
@@ -1485,7 +1485,7 @@
 	  return FALSE; 
 	}
 
-      entry = g_typelib_get_dir_entry (metadata, req);
+      entry = g_typelib_get_dir_entry (typelib, req);
       if (entry->blob_type != BLOB_TYPE_INTERFACE &&
 	  entry->blob_type != BLOB_TYPE_OBJECT &&
 	  (entry->local || entry->blob_type != 0))
@@ -1502,31 +1502,31 @@
 
   for (i = 0; i < blob->n_properties; i++, offset2 += sizeof (PropertyBlob))
     {
-      if (!validate_property_blob (metadata, offset2, error))
+      if (!validate_property_blob (typelib, offset2, error))
 	return FALSE;
     }
 
   for (i = 0; i < blob->n_methods; i++, offset2 += sizeof (FunctionBlob))
     {
-      if (!validate_function_blob (metadata, offset2, BLOB_TYPE_INTERFACE, error))
+      if (!validate_function_blob (typelib, offset2, BLOB_TYPE_INTERFACE, error))
 	return FALSE;
     }
   
   for (i = 0; i < blob->n_signals; i++, offset2 += sizeof (SignalBlob))
     {
-      if (!validate_signal_blob (metadata, offset2, offset, error))
+      if (!validate_signal_blob (typelib, offset2, offset, error))
 	return FALSE;
     }
   
   for (i = 0; i < blob->n_vfuncs; i++, offset2 += sizeof (VFuncBlob))
     {
-      if (!validate_vfunc_blob (metadata, offset2, offset, error))
+      if (!validate_vfunc_blob (typelib, offset2, offset, error))
 	return FALSE;
     }
 
   for (i = 0; i < blob->n_constants; i++, offset2 += sizeof (ConstantBlob))
     {
-      if (!validate_constant_blob (metadata, offset2, error))
+      if (!validate_constant_blob (typelib, offset2, error))
 	return FALSE;
     }
 
@@ -1534,7 +1534,7 @@
 }
 
 static gboolean
-validate_errordomain_blob (GTypelib     *metadata,
+validate_errordomain_blob (GTypelib     *typelib,
 			   guint32        offset,
 			   GError       **error)
 {
@@ -1542,7 +1542,7 @@
 }
 
 static gboolean
-validate_union_blob (GTypelib     *metadata,
+validate_union_blob (GTypelib     *typelib,
 		     guint32        offset,
 		     GError       **error)
 {
@@ -1550,13 +1550,13 @@
 }
 
 static gboolean
-validate_blob (GTypelib     *metadata,
+validate_blob (GTypelib     *typelib,
 	       guint32        offset,
 	       GError       **error)
 {
   CommonBlob *common;
 
-  if (metadata->len < offset + sizeof (CommonBlob))
+  if (typelib->len < offset + sizeof (CommonBlob))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -1565,46 +1565,46 @@
       return FALSE;
     }
 
-  common = (CommonBlob*)&metadata->data[offset];
+  common = (CommonBlob*)&typelib->data[offset];
   
   switch (common->blob_type)
     {
     case BLOB_TYPE_FUNCTION:
-      if (!validate_function_blob (metadata, offset, 0, error))
+      if (!validate_function_blob (typelib, offset, 0, error))
 	return FALSE;
       break;
     case BLOB_TYPE_CALLBACK:
-      if (!validate_callback_blob (metadata, offset, error))
+      if (!validate_callback_blob (typelib, offset, error))
 	return FALSE;
       break;
     case BLOB_TYPE_STRUCT:
     case BLOB_TYPE_BOXED:
-      if (!validate_struct_blob (metadata, offset, common->blob_type, error))
+      if (!validate_struct_blob (typelib, offset, common->blob_type, error))
 	return FALSE;
       break;
     case BLOB_TYPE_ENUM:
     case BLOB_TYPE_FLAGS:
-      if (!validate_enum_blob (metadata, offset, common->blob_type, error))
+      if (!validate_enum_blob (typelib, offset, common->blob_type, error))
 	return FALSE;
       break;
     case BLOB_TYPE_OBJECT:
-      if (!validate_object_blob (metadata, offset, error))
+      if (!validate_object_blob (typelib, offset, error))
 	return FALSE;
       break;
     case BLOB_TYPE_INTERFACE:
-      if (!validate_interface_blob (metadata, offset, error))
+      if (!validate_interface_blob (typelib, offset, error))
 	return FALSE;
       break;
     case BLOB_TYPE_CONSTANT:
-      if (!validate_constant_blob (metadata, offset, error))
+      if (!validate_constant_blob (typelib, offset, error))
 	return FALSE;
       break;
     case BLOB_TYPE_ERROR_DOMAIN:
-      if (!validate_errordomain_blob (metadata, offset, error))
+      if (!validate_errordomain_blob (typelib, offset, error))
 	return FALSE;
       break;
     case BLOB_TYPE_UNION:
-      if (!validate_union_blob (metadata, offset, error))
+      if (!validate_union_blob (typelib, offset, error))
 	return FALSE;
       break;
     default:
@@ -1619,14 +1619,14 @@
 }
 
 static gboolean 
-validate_directory (GTypelib     *metadata,
+validate_directory (GTypelib     *typelib,
 		    GError       **error)
 {
-  Header *header = (Header *)metadata->data;
+  Header *header = (Header *)typelib->data;
   DirEntry *entry;
   gint i;
   
-  if (metadata->len < header->directory + header->n_entries * sizeof (DirEntry))
+  if (typelib->len < header->directory + header->n_entries * sizeof (DirEntry))
     {
       g_set_error (error,
 		   G_TYPELIB_ERROR,
@@ -1637,9 +1637,9 @@
 
   for (i = 0; i < header->n_entries; i++)
     {
-      entry = g_typelib_get_dir_entry (metadata, i + 1);
+      entry = g_typelib_get_dir_entry (typelib, i + 1);
 
-      if (!is_name (metadata->data, entry->name))
+      if (!is_name (typelib->data, entry->name))
 	{
 	  g_set_error (error,
 		       G_TYPELIB_ERROR,
@@ -1678,7 +1678,7 @@
 	      return FALSE;
 	    }
 
-	  if (!validate_blob (metadata, entry->offset, error))
+	  if (!validate_blob (typelib, entry->offset, error))
 	    return FALSE;
 	}
       else
@@ -1692,7 +1692,7 @@
 	      return FALSE;
 	    }
 
-	  if (!is_name (metadata->data, entry->offset))
+	  if (!is_name (typelib->data, entry->offset))
 	    {
 	      g_set_error (error,
 			   G_TYPELIB_ERROR,
@@ -1707,10 +1707,10 @@
 }
 
 static gboolean
-validate_annotations (GTypelib     *metadata, 
+validate_annotations (GTypelib     *typelib, 
 		      GError       **error)
 {
-  Header *header = (Header *)metadata->data;
+  Header *header = (Header *)typelib->data;
 
   if (header->size < header->annotations + header->n_annotations * sizeof (AnnotationBlob))
     {
@@ -1725,16 +1725,16 @@
 }
 
 gboolean 
-g_typelib_validate (GTypelib     *metadata,
+g_typelib_validate (GTypelib     *typelib,
 		     GError       **error)
 {
-  if (!validate_header (metadata, error))
+  if (!validate_header (typelib, error))
     return FALSE;
 
-  if (!validate_directory (metadata, error))
+  if (!validate_directory (typelib, error))
     return FALSE;
 
-  if (!validate_annotations (metadata, error))
+  if (!validate_annotations (typelib, error))
     return FALSE;
 
   return TRUE;
@@ -1745,38 +1745,38 @@
 {
   static GQuark quark = 0;
   if (quark == 0)
-    quark = g_quark_from_static_string ("g-metadata-error-quark");
+    quark = g_quark_from_static_string ("g-typelib-error-quark");
   return quark;
 }
 
 static const char*
-find_some_symbol (GTypelib *metadata)
+find_some_symbol (GTypelib *typelib)
 {
-  Header *header = (Header *) metadata->data;
+  Header *header = (Header *) typelib->data;
   gint i;
 
   for (i = 0; i < header->n_entries; i++)
     {
       DirEntry *entry;
       
-      entry = g_typelib_get_dir_entry (metadata, i + 1);
+      entry = g_typelib_get_dir_entry (typelib, i + 1);
 
       switch (entry->blob_type)
         {
         case BLOB_TYPE_FUNCTION:
           {
-            FunctionBlob *blob = (FunctionBlob *) &metadata->data[entry->offset];
+            FunctionBlob *blob = (FunctionBlob *) &typelib->data[entry->offset];
             
             if (blob->symbol)
-              return g_typelib_get_string (metadata, blob->symbol);
+              return g_typelib_get_string (typelib, blob->symbol);
           }
           break;
         case BLOB_TYPE_OBJECT:
           {
-            RegisteredTypeBlob *blob = (RegisteredTypeBlob *) &metadata->data[entry->offset];
+            RegisteredTypeBlob *blob = (RegisteredTypeBlob *) &typelib->data[entry->offset];
             
             if (blob->gtype_init)
-              return g_typelib_get_string (metadata, blob->gtype_init);
+              return g_typelib_get_string (typelib, blob->gtype_init);
           }
           break;
         default:
@@ -1788,16 +1788,16 @@
 }
 
 static inline void
-_g_typelib_init (GTypelib *metadata)
+_g_typelib_init (GTypelib *typelib)
 {
   Header *header;
 
-  header = (Header *) metadata->data;
+  header = (Header *) typelib->data;
   if (header->shared_library)
     {
       const gchar *shlib;
 
-      shlib = g_typelib_get_string (metadata, header->shared_library);
+      shlib = g_typelib_get_string (typelib, header->shared_library);
       /* note that NULL shlib means to open the main app, which is allowed */
 
       /* If we do have a shared lib, first be sure the main app isn't already linked to it */
@@ -1805,11 +1805,11 @@
         {
           const char *symbol_in_module;
            
-          symbol_in_module = find_some_symbol (metadata);
+          symbol_in_module = find_some_symbol (typelib);
           if (symbol_in_module != NULL)
             {
-              metadata->module = g_module_open (NULL, G_MODULE_BIND_LAZY);
-              if (metadata->module == NULL)
+              typelib->module = g_module_open (NULL, G_MODULE_BIND_LAZY);
+              if (typelib->module == NULL)
                 {
                   g_warning ("Could not open main app as GModule: %s",
                              g_module_error ());
@@ -1817,21 +1817,21 @@
               else
                 {
                   void *sym;
-                  if (!g_module_symbol (metadata->module, symbol_in_module, &sym))
+                  if (!g_module_symbol (typelib->module, symbol_in_module, &sym))
                     {
                       /* we will try opening the shlib, symbol is not in app already */
-                      g_module_close (metadata->module);
-                      metadata->module = NULL;
+                      g_module_close (typelib->module);
+                      typelib->module = NULL;
                     }
                 }
             }
           else
             {
-              g_warning ("Could not find any symbols in metadata");
+              g_warning ("Could not find any symbols in typelib");
             }
         }
      
-      if (metadata->module == NULL)
+      if (typelib->module == NULL)
         {
           /* Glade's autoconnect feature and OpenGL's extension mechanism
            * as used by Clutter rely on dlopen(NULL) to work as a means of
@@ -1842,9 +1842,9 @@
            * load modules globally for now.
            */
           
-          metadata->module = g_module_open (shlib, G_MODULE_BIND_LAZY);
-          if (metadata->module == NULL)
-            g_warning ("Failed to load shared library referenced by the metadata: %s",
+          typelib->module = g_module_open (shlib, G_MODULE_BIND_LAZY);
+          if (typelib->module == NULL)
+            g_warning ("Failed to load shared library referenced by the typelib: %s",
                        g_module_error ());
         }
     }
@@ -1852,11 +1852,11 @@
 
 /**
  * g_typelib_new_from_memory:
- * @memory: address of memory chunk containing the metadata
- * @len: length of memory chunk containing the metadata
+ * @memory: address of memory chunk containing the typelib
+ * @len: length of memory chunk containing the typelib
  * 
  * Creates a new #GTypelib from a memory location.  The memory block
- * pointed to by @metadata will be automatically g_free()d when the
+ * pointed to by @typelib will be automatically g_free()d when the
  * repository is destroyed.
  * 
  * Return value: the new #GTypelib
@@ -1876,8 +1876,8 @@
 
 /**
  * g_typelib_new_from_const_memory:
- * @memory: address of memory chunk containing the metadata
- * @len: length of memory chunk containing the metadata
+ * @memory: address of memory chunk containing the typelib
+ * @len: length of memory chunk containing the typelib
  * 
  * Creates a new #GTypelib from a memory location.
  * 
@@ -1920,40 +1920,40 @@
 
 /**
  * g_typelib_free:
- * @metadata: a #GTypelib
+ * @typelib: a #GTypelib
  * 
  * Free a #GTypelib.
  **/
 void
-g_typelib_free (GTypelib *metadata)
+g_typelib_free (GTypelib *typelib)
 {
-  if (metadata->mfile)
-    g_mapped_file_free (metadata->mfile);
+  if (typelib->mfile)
+    g_mapped_file_free (typelib->mfile);
   else
-    if (metadata->owns_memory)
-      g_free (metadata->data);
-  if (metadata->module)
-    g_module_close (metadata->module);
-  g_free (metadata);
+    if (typelib->owns_memory)
+      g_free (typelib->data);
+  if (typelib->module)
+    g_module_close (typelib->module);
+  g_free (typelib);
 }
 
 /**
  * g_typelib_set_module:
- * @metadata: a #GTypelib instance
+ * @typelib: a #GTypelib instance
  * @module: a #GModule; takes ownership of this module
  * 
- * Sets the target module for all symbols referenced by the metadata.
+ * Sets the target module for all symbols referenced by the typelib.
  **/
 void
-g_typelib_set_module (GTypelib *metadata, GModule *module)
+g_typelib_set_module (GTypelib *typelib, GModule *module)
 {
-  if (metadata->module)
-    g_module_close (metadata->module);
-  metadata->module = module;
+  if (typelib->module)
+    g_module_close (typelib->module);
+  typelib->module = module;
 }
 
 const gchar *
-g_typelib_get_namespace(GTypelib *metadata)
+g_typelib_get_namespace(GTypelib *typelib)
 {
-  return g_typelib_get_string (metadata, ((Header *) metadata->data)->namespace);
+  return g_typelib_get_string (typelib, ((Header *) typelib->data)->namespace);
 }

Modified: trunk/girepository/gtypelib.h
==============================================================================
--- trunk/girepository/gtypelib.h	(original)
+++ trunk/girepository/gtypelib.h	Sat Aug  9 12:55:32 2008
@@ -1,5 +1,5 @@
 /* GObject introspection: struct definitions for the binary
- * metadata format, validation
+ * typelib format, validation
  *
  * Copyright (C) 2005 Matthias Clasen
  *
@@ -521,12 +521,12 @@
   GModule *module;
 };
 
-DirEntry *g_typelib_get_dir_entry (GTypelib *metadata,
-				    guint16            index);
+DirEntry *g_typelib_get_dir_entry (GTypelib *typelib,
+				   guint16   index);
 
 void      g_typelib_check_sanity (void);
 
-#define   g_typelib_get_string(metadata,offset) ((const gchar*)&(metadata->data)[(offset)])
+#define   g_typelib_get_string(typelib,offset) ((const gchar*)&(typelib->data)[(offset)])
 
 
 typedef enum
@@ -542,8 +542,8 @@
 
 GQuark g_typelib_error_quark (void);
 
-gboolean g_typelib_validate (GTypelib  *metadata,
-			      GError    **error);
+gboolean g_typelib_validate (GTypelib  *typelib,
+			     GError    **error);
 
 
 G_END_DECLS

Modified: trunk/tests/invoke/invoke.c
==============================================================================
--- trunk/tests/invoke/invoke.c	(original)
+++ trunk/tests/invoke/invoke.c	Sat Aug  9 12:55:32 2008
@@ -44,7 +44,7 @@
       name = g_irepository_register_file (rep, "test", &error);
       if (error)
 	{
-	  g_error ("Unable to load metadata 'test': %s", error->message);
+	  g_error ("Unable to load typelib 'test': %s", error->message);
 	  return;
 	}
       g_print ("Loaded %s from test.gmeta\n", name);
@@ -202,7 +202,7 @@
   /* test error handling */
 
 #if 0
-  /* "broken" is in the metadata but not in the .so*/
+  /* "broken" is in the typelib but not in the .so*/
   info = g_irepository_find_by_name (rep, "test", "broken");  
   g_assert (g_base_info_get_type (info) == GI_INFO_TYPE_FUNCTION);
   function = (GIFunctionInfo *)info;

Modified: trunk/tools/compiler.c
==============================================================================
--- trunk/tools/compiler.c	(original)
+++ trunk/tools/compiler.c	Sat Aug  9 12:55:32 2008
@@ -1,4 +1,4 @@
-/* GObject introspection: Metadata compiler
+/* GObject introspection: Typelib compiler
  *
  * Copyright (C) 2005 Matthias Clasen
  *
@@ -39,19 +39,19 @@
 gboolean verbose = FALSE;
 
 static gchar *
-format_output (GTypelib *metadata)
+format_output (GTypelib *typelib)
 {
   GString *result;
   gint i;
 
-  result = g_string_sized_new (6 * metadata->len);
+  result = g_string_sized_new (6 * typelib->len);
 
   g_string_append_printf (result, "#include <stdlib.h>\n");
   g_string_append_printf (result, "#include <girepository.h>\n\n");
   
   g_string_append_printf (result, "const unsigned char _G_TYPELIB[] = \n{");
 
-  for (i = 0; i < metadata->len; i++)
+  for (i = 0; i < typelib->len; i++)
     {
       if (i > 0)
 	g_string_append (result, ", ");
@@ -59,39 +59,39 @@
       if (i % 10 == 0)
 	g_string_append (result, "\n\t");
       
-      g_string_append_printf (result, "0x%.2x", metadata->data[i]);      
+      g_string_append_printf (result, "0x%.2x", typelib->data[i]);      
     }
 
   g_string_append_printf (result, "\n};\n\n");
   g_string_append_printf (result, "const gsize _G_TYPELIB_SIZE = %u;\n\n",
-			  (guint)metadata->len);
+			  (guint)typelib->len);
 
   if (!no_init)
     {
       g_string_append_printf (result,
 			      "__attribute__((constructor)) void\n"
-			      "register_metadata (void)\n"
+			      "register_typelib (void)\n"
 			      "{\n"
-			      "\tGTypelib *metadata;\n"
-			      "\tmetadata = g_typelib_new_from_const_memory (_G_TYPELIB, _G_TYPELIB_SIZE);\n"
-			      "\tg_irepository_register (NULL, metadata);\n"
+			      "\tGTypelib *typelib;\n"
+			      "\ttypelib = g_typelib_new_from_const_memory (_G_TYPELIB, _G_TYPELIB_SIZE);\n"
+			      "\tg_irepository_register (NULL, typelib);\n"
 			      "}\n\n");
 
       g_string_append_printf (result,
 			      "__attribute__((destructor)) void\n"
-			      "unregister_metadata (void)\n"
+			      "unregister_typelib (void)\n"
 			      "{\n"
 			      "\tg_irepository_unregister (NULL, \"%s\");\n"
 			      "}\n",
-			      g_typelib_get_namespace (metadata));
+			      g_typelib_get_namespace (typelib));
     }
 
   return g_string_free (result, FALSE);
 }
 
 static void
-write_out_metadata (gchar *prefix,
-		    GTypelib *metadata)
+write_out_typelib (gchar *prefix,
+		   GTypelib *typelib)
 {
   FILE *file;
 
@@ -120,12 +120,12 @@
     }
 
   if (raw)
-    fwrite (metadata->data, 1, metadata->len, file);
+    fwrite (typelib->data, 1, typelib->len, file);
   else
     {
       gchar *code;
 
-      code = format_output (metadata);
+      code = format_output (typelib);
       fputs (code, file);
       g_free (code);
     }
@@ -148,7 +148,7 @@
 
 static GOptionEntry options[] = 
 {
-  { "raw", 0, 0, G_OPTION_ARG_NONE, &raw, "emit raw metadata", NULL },
+  { "raw", 0, 0, G_OPTION_ARG_NONE, &raw, "emit raw typelib", NULL },
   { "code", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &raw, "emit C code", NULL },
   { "no-init", 0, 0, G_OPTION_ARG_NONE, &no_init, "do not create _init() function", NULL },
   { "output", 'o', 0, G_OPTION_ARG_FILENAME, &output, "output file", "FILE" }, 
@@ -217,7 +217,7 @@
     {
       GIrModule *module = m->data;
       gchar *prefix;
-      GTypelib *metadata;
+      GTypelib *typelib;
 
       if (mname && strcmp (mname, module->name) != 0)
 	continue;
@@ -230,15 +230,15 @@
 
       g_debug ("[building] module %s", module->name);
 
-      metadata = g_ir_module_build_metadata (module, modules);
-      if (metadata == NULL)
+      typelib = g_ir_module_build_typelib (module, modules);
+      if (typelib == NULL)
 	{
-	  g_error ("Failed to build metadata for module '%s'\n", module->name);
+	  g_error ("Failed to build typelib for module '%s'\n", module->name);
 
 	  continue;
 	}
-      if (!g_typelib_validate (metadata, &error))
-	g_error ("Invalid metadata for module '%s': %s", 
+      if (!g_typelib_validate (typelib, &error))
+	g_error ("Invalid typelib for module '%s': %s", 
 		 module->name, error->message);
 
       if (!mname && (m->next || m->prev) && output)
@@ -246,9 +246,9 @@
       else
 	prefix = NULL;
 
-      write_out_metadata (prefix, metadata);
-      g_typelib_free (metadata);
-      metadata = NULL;
+      write_out_typelib (prefix, typelib);
+      g_typelib_free (typelib);
+      typelib = NULL;
 
       /* when writing to stdout, stop after the first module */
       if (m->next && !output && !mname)

Modified: trunk/tools/generate.c
==============================================================================
--- trunk/tools/generate.c	(original)
+++ trunk/tools/generate.c	Sat Aug  9 12:55:32 2008
@@ -1097,35 +1097,35 @@
 }
 
 static const guchar *
-load_metadata (const gchar  *filename,
+load_typelib (const gchar  *filename,
 	       GModule     **dlhandle,
                gsize        *len)
 {
-  guchar *metadata;
-  gsize *metadata_size;
+  guchar *typelib;
+  gsize *typelib_size;
   GModule *handle; 
 
   handle = g_module_open (filename, G_MODULE_BIND_LOCAL|G_MODULE_BIND_LAZY);
-  if (!g_module_symbol (handle, "_G_TYPELIB", (gpointer *) &metadata))
+  if (!g_module_symbol (handle, "_G_TYPELIB", (gpointer *) &typelib))
     {
-      g_printerr ("Could not load metadata from '%s': %s\n", 
+      g_printerr ("Could not load typelib from '%s': %s\n", 
 		  filename, g_module_error ());
       return NULL;
     }
   
-  if (!g_module_symbol (handle, "_G_TYPELIB_SIZE", (gpointer *) &metadata_size))
+  if (!g_module_symbol (handle, "_G_TYPELIB_SIZE", (gpointer *) &typelib_size))
     {
-      g_printerr ("Could not load metadata from '%s': %s\n", 
+      g_printerr ("Could not load typelib from '%s': %s\n", 
 		  filename, g_module_error ());
       return NULL;
     }
 
-  *len = *metadata_size;
+  *len = *typelib_size;
   
   if (dlhandle)
     *dlhandle = handle;
 
-  return metadata;
+  return typelib;
 }
 
 int 
@@ -1140,7 +1140,7 @@
   GTypelib *data;
   GOptionEntry options[] = 
     {
-      { "raw", 0, 0, G_OPTION_ARG_NONE, &raw, "handle raw metadata", NULL },
+      { "raw", 0, 0, G_OPTION_ARG_NONE, &raw, "handle raw typelib", NULL },
       { "output", 'o', 0, G_OPTION_ARG_FILENAME, &output, "output file", "FILE" }, 
       { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &input, NULL, NULL },
       { NULL, }
@@ -1164,12 +1164,12 @@
   for (i = 0; input[i]; i++)
     {
       GModule *dlhandle = NULL;
-      const guchar *metadata;
+      const guchar *typelib;
       gsize len;
 
       if (raw)
 	{
-	  if (!g_file_get_contents (input[i], (gchar **)&metadata, &len, &error))
+	  if (!g_file_get_contents (input[i], (gchar **)&typelib, &len, &error))
 	    {
 	      g_fprintf (stderr, "failed to read '%s': %s\n", 
 			 input[i], error->message);
@@ -1179,10 +1179,10 @@
 	}
       else
 	{
-	  metadata = load_metadata (input[i], &dlhandle, &len);
-	  if (!metadata)
+	  typelib = load_typelib (input[i], &dlhandle, &len);
+	  if (!typelib)
 	    {
-	      g_fprintf (stderr, "failed to load metadata from '%s'\n", 
+	      g_fprintf (stderr, "failed to load typelib from '%s'\n", 
 			 input[i]);
 	      continue;
 	    }
@@ -1193,11 +1193,11 @@
       else
 	needs_prefix = FALSE;
 
-      data = g_typelib_new_from_const_memory (metadata, len);
+      data = g_typelib_new_from_const_memory (typelib, len);
       {
         GError *error = NULL;
         if (!g_typelib_validate (data, &error)) {
-          g_printerr ("metadata not valid: %s\n", error->message);
+          g_printerr ("typelib not valid: %s\n", error->message);
           g_clear_error (&error);
         }
       }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]