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;
65 guint32 shared_library;
67 guint16 entry_blob_size;
68 guint16 function_blob_size;
69 guint16 callback_blob_size;
70 guint16 signal_blob_size;
71 guint16 vfunc_blob_size;
72 guint16 arg_blob_size;
73 guint16 property_blob_size;
74 guint16 field_blob_size;
75 guint16 value_blob_size;
76 guint16 annotation_blob_size;
77 guint16 constant_blob_size;
78 guint16 error_domain_blob_size;
80 guint16 signature_blob_size;
81 guint16 enum_blob_size;
82 guint16 struct_blob_size;
83 guint16 object_blob_size;
84 guint16 interface_blob_size;
85 guint16 union_blob_size;
125 guint transfer_ownership : 1;
126 guint transfer_container_ownership : 1;
127 guint return_value : 1;
130 SimpleTypeBlob arg_type;
135 SimpleTypeBlob return_type;
137 guint16 may_return_null : 1;
138 guint16 caller_owns_return_value : 1;
139 guint16 caller_owns_return_container : 1;
140 guint16 reserved :13;
149 guint16 blob_type; /* 1 */
151 guint16 deprecated : 1;
152 guint16 reserved :15;
159 guint16 blob_type; /* 1 */
161 guint16 deprecated : 1;
164 guint16 constructor : 1;
165 guint16 wraps_vfunc : 1;
166 guint16 reserved : 1;
176 guint16 blob_type; /* 2 */
178 guint16 deprecated : 1;
179 guint16 reserved :15;
200 guint16 zero_terminated :1;
201 guint16 has_length :1;
202 guint16 reserved2 :6;
218 SimpleTypeBlob type[];
235 guint16 blob_type; /* 10 */
237 guint16 deprecated : 1;
238 guint16 reserved :15;
249 guint32 deprecated : 1;
250 guint32 reserved :31;
264 guint16 struct_offset;
272 guint16 deprecated : 1;
273 guint16 unregistered :15;
278 } RegisteredTypeBlob;
284 guint16 deprecated : 1;
285 guint16 unregistered : 1;
286 guint16 reserved :14;
297 /* variable-length parts of the blob */
299 FunctionBlob methods[];
306 guint16 deprecated : 1;
307 guint16 unregistered : 1;
308 guint16 discriminated : 1;
309 guint16 reserved :13;
318 gint32 discriminator_offset;
319 SimpleTypeBlob discriminator_type;
323 FunctionBlob functions[];
324 ConstantBlob discriminator_values[]
332 guint16 deprecated : 1;
333 guint16 unregistered : 1;
334 guint16 reserved :14;
351 guint32 deprecated : 1;
352 guint32 readable : 1;
353 guint32 writable : 1;
354 guint32 construct : 1;
355 guint32 construct_only : 1;
356 guint32 reserved :27;
364 guint16 deprecated : 1;
365 guint16 run_first : 1;
366 guint16 run_last : 1;
367 guint16 run_cleanup : 1;
368 guint16 no_recurse : 1;
369 guint16 detailed : 1;
371 guint16 no_hooks : 1;
372 guint16 has_class_closure : 1;
373 guint16 true_stops_emit : 1;
374 guint16 reserved : 6;
376 guint16 class_closure;
387 guint16 must_chain_up : 1;
388 guint16 must_be_implemented : 1;
389 guint16 must_not_be_implemented : 1;
390 guint16 class_closure : 1;
391 guint16 reserved :12;
394 guint16 struct_offset;
401 guint16 blob_type; /* 7 */
402 guint16 deprecated : 1;
403 guint16 reserved :15;
411 guint16 n_interfaces;
413 guint16 n_properties;
419 guint16 interfaces[];
422 /* variable-length parts of the blob */
424 PropertyBlob properties[];
425 FunctionBlob methods[];
426 SignalBlob signals[];
428 ConstantBlob constants[];
435 guint16 deprecated : 1;
436 guint16 reserved :15;
442 guint16 n_prerequisites;
443 guint16 n_properties;
449 guint16 prerequisites[];
452 /* variable-length parts of the blob */
453 PropertyBlob properties[];
454 FunctionBlob methods[];
455 SignalBlob signals[];
457 ConstantBlob constants[];
465 guint16 deprecated : 1;
466 guint16 reserved :15;
486 gboolean owns_memory;
491 DirEntry *g_typelib_get_dir_entry (GTypelib *typelib,
494 void g_typelib_check_sanity (void);
496 #define g_typelib_get_string(typelib,offset) ((const gchar*)&(typelib->data)[(offset)])
501 G_TYPELIB_ERROR_INVALID,
502 G_TYPELIB_ERROR_INVALID_HEADER,
503 G_TYPELIB_ERROR_INVALID_DIRECTORY,
504 G_TYPELIB_ERROR_INVALID_ENTRY,
505 G_TYPELIB_ERROR_INVALID_BLOB
508 #define G_TYPELIB_ERROR (g_typelib_error_quark ())
510 GQuark g_typelib_error_quark (void);
512 gboolean g_typelib_validate (GTypelib *typelib,
518 #endif /* __G_TYPELIB_H__ */