mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-23 17:38:54 +02:00
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:
16
girnode.h
16
girnode.h
@@ -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__ */
|
||||
|
Reference in New Issue
Block a user