Enumerations can be negative
[gnome.gobject-introspection] / girepository / gtypelib.h
index 2827543..f02dcfc 100644 (file)
@@ -303,6 +303,20 @@ typedef struct {
  * @offset:  Offset relative to header->types that points to a TypeBlob. 
  * Unlike other offsets, this is in words (ie 32bit units) rather
  * than bytes.
+ *
+ * The SimpleTypeBlob is the general purpose "reference to a type" construct, used
+ * in method parameters, returns, callback definitions, fields, constants, etc.
+ * It's actually just a 32 bit integer which you can see from the union definition.
+ * This is for efficiency reasons, since there are so many references to types.
+ *
+ * SimpleTypeBlob is divided into two cases; first, if "reserved" and "reserved2", the
+ * type tag for a basic type is embedded in the "tag" bits.  This allows e.g.
+ * GI_TYPE_TAG_UTF8, GI_TYPE_TAG_INT and the like to be embedded directly without
+ * taking up extra space.
+ *
+ * References to "interfaces" (objects, interfaces) are more complicated;  In this case,
+ * the integer is actually an offset into the directory (see above).  Because the header
+ * is larger than 2^8=256 bits, all offsets will have one of the upper 24 bits set.
  */
 typedef union
 {
@@ -600,7 +614,7 @@ typedef struct {
   guint32 deprecated : 1;
   guint32 reserved   :31;
   guint32 name;
-  guint32 value;
+  gint32 value;
 } ValueBlob;
 
 /**
@@ -608,6 +622,7 @@ typedef struct {
  * @name: The name of the field.
  * @readable:
  * @writable: How the field may be accessed.
+ * @has_embedded_type: An anonymous type follows the FieldBlob.
  * @bits: If this field is part of a bitfield, the number of bits which it
  * uses, otherwise 0.
  * @struct_offset:
@@ -620,7 +635,8 @@ typedef struct {
 
   guint8         readable :1; 
   guint8         writable :1;
-  guint8         reserved :6;
+  guint8         has_embedded_type :1;
+  guint8         reserved :5;
   guint8         bits;
 
   guint16        struct_offset;
@@ -1021,6 +1037,7 @@ struct _GTypelib {
   gboolean owns_memory;
   GMappedFile *mfile;
   GList *modules;
+  gboolean open_attempted;
 };
 
 DirEntry *g_typelib_get_dir_entry (GTypelib *typelib,