1 /* GObject introspection: struct definitions for the binary
2 * typelib format, validation
4 * Copyright (C) 2005 Matthias Clasen
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
22 #ifndef __G_TYPELIB_H__
23 #define __G_TYPELIB_H__
26 #include "girepository.h"
30 #define G_IR_MAGIC "GOBJ\nMETADATA\r\n\032"
44 BLOB_TYPE_ERROR_DOMAIN,
55 guint16 n_local_entries;
57 guint32 n_annotations;
62 guint32 shared_library;
64 guint16 entry_blob_size;
65 guint16 function_blob_size;
66 guint16 callback_blob_size;
67 guint16 signal_blob_size;
68 guint16 vfunc_blob_size;
69 guint16 arg_blob_size;
70 guint16 property_blob_size;
71 guint16 field_blob_size;
72 guint16 value_blob_size;
73 guint16 annotation_blob_size;
74 guint16 constant_blob_size;
75 guint16 error_domain_blob_size;
77 guint16 signature_blob_size;
78 guint16 enum_blob_size;
79 guint16 struct_blob_size;
80 guint16 object_blob_size;
81 guint16 interface_blob_size;
82 guint16 union_blob_size;
99 #define TYPE_POINTER_MASK 1 << 7
100 #define TYPE_TAG_MASK 63
105 TYPE_TAG_BOOLEAN = 1,
121 TYPE_TAG_DOUBLE = 17,
123 TYPE_TAG_FILENAME = 19,
125 TYPE_TAG_INTERFACE = 21,
130 TYPE_TAG_STRING = 26,
131 TYPE_TAG_SEQUENCE = 27,
158 guint transfer_ownership : 1;
159 guint transfer_container_ownership : 1;
160 guint return_value : 1;
163 SimpleTypeBlob arg_type;
168 SimpleTypeBlob return_type;
170 guint may_return_null : 1;
171 guint caller_owns_return_value : 1;
172 guint caller_owns_return_container : 1;
182 guint16 blob_type; /* 1 */
184 guint deprecated : 1;
192 guint16 blob_type; /* 1 */
194 guint deprecated : 1;
197 guint constructor : 1;
198 guint wraps_vfunc : 1;
209 guint16 blob_type; /* 2 */
211 guint deprecated : 1;
233 guint zero_terminated :1;
251 SimpleTypeBlob type[];
268 guint16 blob_type; /* 10 */
270 guint deprecated : 1;
282 guint deprecated : 1;
297 guint16 struct_offset;
305 guint deprecated : 1;
306 guint unregistered :15;
311 } RegisteredTypeBlob;
317 guint deprecated : 1;
318 guint unregistered : 1;
330 /* variable-length parts of the blob */
332 FunctionBlob methods[];
339 guint deprecated : 1;
340 guint unregistered : 1;
341 guint discriminated : 1;
351 gint32 discriminator_offset;
352 SimpleTypeBlob discriminator_type;
356 FunctionBlob functions[];
357 ConstantBlob discriminator_values[]
365 guint deprecated : 1;
366 guint unregistered : 1;
384 guint deprecated : 1;
388 guint construct_only : 1;
397 guint deprecated : 1;
400 guint run_cleanup : 1;
401 guint no_recurse : 1;
405 guint has_class_closure : 1;
406 guint true_stops_emit : 1;
409 guint16 class_closure;
420 guint must_chain_up : 1;
421 guint must_be_implemented : 1;
422 guint must_not_be_implemented : 1;
423 guint class_closure : 1;
427 guint16 struct_offset;
434 guint16 blob_type; /* 7 */
435 guint deprecated : 1;
444 guint16 n_interfaces;
446 guint16 n_properties;
452 guint16 interfaces[];
455 /* variable-length parts of the blob */
457 PropertyBlob properties[];
458 FunctionBlob methods[];
459 SignalBlob signals[];
461 ConstantBlob constants[];
468 guint deprecated : 1;
475 guint16 n_prerequisites;
476 guint16 n_properties;
482 guint16 prerequisites[];
485 /* variable-length parts of the blob */
486 PropertyBlob properties[];
487 FunctionBlob methods[];
488 SignalBlob signals[];
490 ConstantBlob constants[];
498 guint deprecated : 1;
519 gboolean owns_memory;
524 DirEntry *g_typelib_get_dir_entry (GTypelib *typelib,
527 void g_typelib_check_sanity (void);
529 #define g_typelib_get_string(typelib,offset) ((const gchar*)&(typelib->data)[(offset)])
534 G_TYPELIB_ERROR_INVALID,
535 G_TYPELIB_ERROR_INVALID_HEADER,
536 G_TYPELIB_ERROR_INVALID_DIRECTORY,
537 G_TYPELIB_ERROR_INVALID_ENTRY,
538 G_TYPELIB_ERROR_INVALID_BLOB
541 #define G_TYPELIB_ERROR (g_typelib_error_quark ())
543 GQuark g_typelib_error_quark (void);
545 gboolean g_typelib_validate (GTypelib *typelib,
551 #endif /* __G_TYPELIB_H__ */