Bug 560252 - Compute field offsets before writing typelib

girnode.h: Store the total size and alignment for
 GIrNodeStruct/Boxed/Union.

giroffset.c: New file implementing computation of structure
 field offsets.

girnode.c: Compute structure field offsets before writing types
 into the typelib.

docs/typelib-format.txt: Document that a field offset of 0xFFFF
means "unknown". Also fix description of the discriminator_offset
field for unions.

svn path=/trunk/; revision=876
This commit is contained in:
Owen Taylor
2008-11-11 05:10:36 +00:00
parent 6d9212674a
commit 31a7f413d6
4 changed files with 436 additions and 1 deletions

View File

@@ -271,6 +271,9 @@ struct _GIrNodeBoxed
gchar *gtype_name;
gchar *gtype_init;
gint alignment;
gint size;
GList *members;
};
@@ -284,6 +287,9 @@ struct _GIrNodeStruct
gchar *gtype_name;
gchar *gtype_init;
gint alignment;
gint size;
GList *members;
};
@@ -300,6 +306,9 @@ struct _GIrNodeUnion
gchar *gtype_name;
gchar *gtype_init;
gint alignment;
gint size;
gint discriminator_offset;
GIrNodeType *discriminator_type;
};
@@ -348,6 +357,13 @@ gboolean g_ir_find_node (GIrModule *module,
GIrNode **node_out,
GIrModule **module_out);
/* In giroffsets.c */
void g_ir_node_compute_offsets (GIrNode *node,
GIrModule *module,
GList *modules);
G_END_DECLS
#endif /* __G_IR_NODE_H__ */