summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@src.gnome.org>2008-11-16 21:15:54 +0000
committerOwen Taylor <otaylor@src.gnome.org>2008-11-16 21:15:54 +0000
commitc68cef1ba60d2a7563cf8d191aa8c10453467ed7 (patch)
treece1a0be4a4ff0044870989ebe03d430bf59998a7 /docs
parenta5d45df66370320ec2ae493383ba1388157182da (diff)
downloadgobject-introspection-c68cef1ba60d2a7563cf8d191aa8c10453467ed7.tar.gz
Bug 560825 – Add size and alignment to typelib
Include the size and alignment of structures and unions in the typelib, and add getter methods to retrieve them from GIStructInfo/GIUnionInfo. * docs/typelib-format.txt girepository/gtypelib.h girepository/girnode.c girepository/girmodule.c girepository/gtypelib.c: Add size and alignment to StructBlob and UnionBlob. * girepository/ginfo.c girepository/girepository.h: Add g_[struct|union]_get[size|alignment](). * test/offsets/gen-gitestoffsets: Test overall structure size and alignment. svn path=/trunk/; revision=930
Diffstat (limited to 'docs')
-rw-r--r--docs/typelib-format.txt20
1 files changed, 18 insertions, 2 deletions
diff --git a/docs/typelib-format.txt b/docs/typelib-format.txt
index 80b29c9b..fa76393e 100644
--- a/docs/typelib-format.txt
+++ b/docs/typelib-format.txt
@@ -812,11 +812,14 @@ struct StructBlob
guint16 blob_type; /* 3: struct, 4: boxed */
guint deprecated : 1;
guint unregistered : 1;
- guint reserved :14;
+ guint alignment : 6;
+ guint reserved : 8;
guint32 name;
GTypeBlob gtype;
+ guint32 size;
+
guint16 n_fields;
guint16 n_functions;
@@ -827,6 +830,11 @@ struct StructBlob
unregistered:
If this is set, the type is not registered with GType.
+alignment:
+ The byte boundary that the struct is aligned to in memory
+
+size: The size of the struct in bytes.
+
gtype: For types which are registered with GType, contains the
information about the GType. Otherwise unused.
@@ -1045,11 +1053,14 @@ struct UnionBlob
guint deprecated : 1;
guint unregistered : 1;
guint discriminated : 1;
- guint reserved :13;
+ guint alignment : 6;
+ guint reserved : 7;
guint32 name;
GTypeBlob gtype;
+ guint32 size;
+
guint16 n_fields;
guint16 n_functions;
@@ -1067,6 +1078,11 @@ unregistered:
discriminated:
Is set if the union is discriminated
+alignment:
+ The byte boundary that the union is aligned to in memory
+
+size: The size of the union in bytes.
+
gtype: For types which are registered with GType, contains the
information about the GType. Otherwise unused.