1 /* GObject introspection: struct definitions for the binary
2 * metadata 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_METADATA_H__
23 #define __G_METADATA_H__
26 #include "girepository.h"
30 #define G_IDL_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,
155 guint transfer_ownership
: 1;
156 guint transfer_container_ownership
: 1;
157 guint return_value
: 1;
160 SimpleTypeBlob arg_type
;
165 SimpleTypeBlob return_type
;
167 guint may_return_null
: 1;
168 guint caller_owns_return_value
: 1;
169 guint caller_owns_return_container
: 1;
179 guint16 blob_type
; /* 1 */
181 guint deprecated
: 1;
189 guint16 blob_type
; /* 1 */
191 guint deprecated
: 1;
194 guint constructor
: 1;
195 guint wraps_vfunc
: 1;
206 guint16 blob_type
; /* 2 */
208 guint deprecated
: 1;
230 guint zero_terminated
:1;
248 SimpleTypeBlob type
[];
265 guint16 blob_type
; /* 10 */
267 guint deprecated
: 1;
279 guint deprecated
: 1;
294 guint16 struct_offset
;
302 guint deprecated
: 1;
303 guint unregistered
:15;
308 } RegisteredTypeBlob
;
314 guint deprecated
: 1;
315 guint unregistered
: 1;
327 /* variable-length parts of the blob */
329 FunctionBlob methods
[];
336 guint deprecated
: 1;
337 guint unregistered
: 1;
338 guint discriminated
: 1;
348 gint32 discriminator_offset
;
349 SimpleTypeBlob discriminator_type
;
353 FunctionBlob functions
[];
354 ConstantBlob discriminator_values
[]
362 guint deprecated
: 1;
363 guint unregistered
: 1;
381 guint deprecated
: 1;
385 guint construct_only
: 1;
394 guint deprecated
: 1;
397 guint run_cleanup
: 1;
398 guint no_recurse
: 1;
402 guint has_class_closure
: 1;
403 guint true_stops_emit
: 1;
406 guint16 class_closure
;
417 guint must_chain_up
: 1;
418 guint must_be_implemented
: 1;
419 guint must_not_be_implemented
: 1;
420 guint class_closure
: 1;
424 guint16 struct_offset
;
431 guint16 blob_type
; /* 7 */
432 guint deprecated
: 1;
441 guint16 n_interfaces
;
443 guint16 n_properties
;
449 guint16 interfaces
[];
452 /* variable-length parts of the blob */
454 PropertyBlob properties
[];
455 FunctionBlob methods
[];
456 SignalBlob signals
[];
458 ConstantBlob constants
[];
465 guint deprecated
: 1;
472 guint16 n_prerequisites
;
473 guint16 n_properties
;
479 guint16 prerequisites
[];
482 /* variable-length parts of the blob */
483 PropertyBlob properties
[];
484 FunctionBlob methods
[];
485 SignalBlob signals
[];
487 ConstantBlob constants
[];
495 guint deprecated
: 1;
516 gboolean owns_memory
;
521 DirEntry
*g_metadata_get_dir_entry (GMetadata
*metadata
,
524 void g_metadata_check_sanity (void);
526 #define g_metadata_get_string(metadata,offset) ((const gchar*)&(metadata->data)[(offset)])
531 G_METADATA_ERROR_INVALID
,
532 G_METADATA_ERROR_INVALID_HEADER
,
533 G_METADATA_ERROR_INVALID_DIRECTORY
,
534 G_METADATA_ERROR_INVALID_ENTRY
,
535 G_METADATA_ERROR_INVALID_BLOB
538 #define G_METADATA_ERROR (g_metadata_error_quark ())
540 GQuark
g_metadata_error_quark (void);
542 gboolean
g_metadata_validate (GMetadata
*metadata
,
548 #endif /* __G_METADATA_H__ */