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;
64 guint32 shared_library;
66 guint16 entry_blob_size;
67 guint16 function_blob_size;
68 guint16 callback_blob_size;
69 guint16 signal_blob_size;
70 guint16 vfunc_blob_size;
71 guint16 arg_blob_size;
72 guint16 property_blob_size;
73 guint16 field_blob_size;
74 guint16 value_blob_size;
75 guint16 annotation_blob_size;
76 guint16 constant_blob_size;
77 guint16 error_domain_blob_size;
79 guint16 signature_blob_size;
80 guint16 enum_blob_size;
81 guint16 struct_blob_size;
82 guint16 object_blob_size;
83 guint16 interface_blob_size;
84 guint16 union_blob_size;
124 guint transfer_ownership : 1;
125 guint transfer_container_ownership : 1;
126 guint return_value : 1;
129 SimpleTypeBlob arg_type;
134 SimpleTypeBlob return_type;
136 guint16 may_return_null : 1;
137 guint16 caller_owns_return_value : 1;
138 guint16 caller_owns_return_container : 1;
139 guint16 reserved :13;
148 guint16 blob_type; /* 1 */
150 guint16 deprecated : 1;
151 guint16 reserved :15;
158 guint16 blob_type; /* 1 */
160 guint16 deprecated : 1;
163 guint16 constructor : 1;
164 guint16 wraps_vfunc : 1;
165 guint16 reserved : 1;
175 guint16 blob_type; /* 2 */
177 guint16 deprecated : 1;
178 guint16 reserved :15;
199 guint16 zero_terminated :1;
200 guint16 has_length :1;
201 guint16 reserved2 :6;
217 SimpleTypeBlob type[];
234 guint16 blob_type; /* 10 */
236 guint16 deprecated : 1;
237 guint16 reserved :15;
248 guint32 deprecated : 1;
249 guint32 reserved :31;
263 guint16 struct_offset;
271 guint16 deprecated : 1;
272 guint16 unregistered :15;
277 } RegisteredTypeBlob;
283 guint16 deprecated : 1;
284 guint16 unregistered : 1;
285 guint16 reserved :14;
296 /* variable-length parts of the blob */
298 FunctionBlob methods[];
305 guint16 deprecated : 1;
306 guint16 unregistered : 1;
307 guint16 discriminated : 1;
308 guint16 reserved :13;
317 gint32 discriminator_offset;
318 SimpleTypeBlob discriminator_type;
322 FunctionBlob functions[];
323 ConstantBlob discriminator_values[]
331 guint16 deprecated : 1;
332 guint16 unregistered : 1;
333 guint16 reserved :14;
350 guint32 deprecated : 1;
351 guint32 readable : 1;
352 guint32 writable : 1;
353 guint32 construct : 1;
354 guint32 construct_only : 1;
355 guint32 reserved :27;
363 guint16 deprecated : 1;
364 guint16 run_first : 1;
365 guint16 run_last : 1;
366 guint16 run_cleanup : 1;
367 guint16 no_recurse : 1;
368 guint16 detailed : 1;
370 guint16 no_hooks : 1;
371 guint16 has_class_closure : 1;
372 guint16 true_stops_emit : 1;
373 guint16 reserved : 6;
375 guint16 class_closure;
386 guint16 must_chain_up : 1;
387 guint16 must_be_implemented : 1;
388 guint16 must_not_be_implemented : 1;
389 guint16 class_closure : 1;
390 guint16 reserved :12;
393 guint16 struct_offset;
400 guint16 blob_type; /* 7 */
401 guint16 deprecated : 1;
402 guint16 reserved :15;
410 guint16 n_interfaces;
412 guint16 n_properties;
418 guint16 interfaces[];
421 /* variable-length parts of the blob */
423 PropertyBlob properties[];
424 FunctionBlob methods[];
425 SignalBlob signals[];
427 ConstantBlob constants[];
434 guint16 deprecated : 1;
435 guint16 reserved :15;
441 guint16 n_prerequisites;
442 guint16 n_properties;
448 guint16 prerequisites[];
451 /* variable-length parts of the blob */
452 PropertyBlob properties[];
453 FunctionBlob methods[];
454 SignalBlob signals[];
456 ConstantBlob constants[];
464 guint16 deprecated : 1;
465 guint16 reserved :15;
485 gboolean owns_memory;
490 DirEntry *g_typelib_get_dir_entry (GTypelib *typelib,
493 void g_typelib_check_sanity (void);
495 #define g_typelib_get_string(typelib,offset) ((const gchar*)&(typelib->data)[(offset)])
500 G_TYPELIB_ERROR_INVALID,
501 G_TYPELIB_ERROR_INVALID_HEADER,
502 G_TYPELIB_ERROR_INVALID_DIRECTORY,
503 G_TYPELIB_ERROR_INVALID_ENTRY,
504 G_TYPELIB_ERROR_INVALID_BLOB
507 #define G_TYPELIB_ERROR (g_typelib_error_quark ())
509 GQuark g_typelib_error_quark (void);
511 gboolean g_typelib_validate (GTypelib *typelib,
517 #endif /* __G_TYPELIB_H__ */