summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@src.gnome.org>2008-11-18 12:29:10 +0000
committerOwen Taylor <otaylor@src.gnome.org>2008-11-18 12:29:10 +0000
commita26517953e7fefedc8a450f8c727f787296d8823 (patch)
tree4e5b83362f094e7288ed7c45934275e17db8343b /docs
parent6cea68fc58343509c7012ef7b5fec86a115e6fb4 (diff)
downloadgobject-introspection-a26517953e7fefedc8a450f8c727f787296d8823.tar.gz
Add "storage type" to the typelib data for enums
In order to set and get enum and flag fields in structures, we need to know the integral type that the enumeration is stored as. We are already computing that at compile time in order to compute struct offsets, so the easiest thing to do is to save that in the typelib. * docs/typelib-format.txt girepository/girnode.[ch] girepository/giroffsets.c girepository/gtypelib.h: Add 'storage_type' to the typelib format for EnumBlob and compute and save it at compile time. * girepository/girepository.h girepository/ginfo.c: Add g_enum_info_get_storage_type(). * girepository/gfield.c: Implement reading and writing enum and flags fields based on the storage type. http://bugzilla.gnome.org/show_bug.cgi?id=561296 svn path=/trunk/; revision=944
Diffstat (limited to 'docs')
-rw-r--r--docs/typelib-format.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/docs/typelib-format.txt b/docs/typelib-format.txt
index fa76393e..d7cfedae 100644
--- a/docs/typelib-format.txt
+++ b/docs/typelib-format.txt
@@ -856,7 +856,8 @@ struct EnumBlob
guint16 blob_type; /* 5: enum, 6: flags */
guint deprecated : 1;
guint unregistered : 1;
- guint reserved :14;
+ guint storage_type : 5;
+ guint reserved : 9;
guint32 name;
GTypeBlob gtype;
@@ -870,6 +871,10 @@ struct EnumBlob
unregistered:
If this is set, the type is not registered with GType.
+storage_type:
+ The tag of the type used for the enum in the C ABI
+ (will be a signed or unsigned integral type)
+
gtype: For types which are registered with GType, contains the
information about the GType. Otherwise unused.