From 9c10f3ec02657ada4b1f238675013b166478834d Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 8 Nov 2023 12:52:23 +0000 Subject: [PATCH 1/5] girepository: Remove backwards compatibility symbol renames MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After bumping the major version number, we don’t need backwards compatibility any more. Signed-off-by: Philip Withnall Helps: #3155 --- girepository/gitypes.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/girepository/gitypes.h b/girepository/gitypes.h index 704dbf054..4df37900c 100644 --- a/girepository/gitypes.h +++ b/girepository/gitypes.h @@ -501,12 +501,4 @@ typedef enum GI_FUNCTION_THROWS = 1 << 5 } GIFunctionInfoFlags; -#ifndef __GI_SCANNER__ -#ifndef __GTK_DOC_IGNORE__ -/* backwards compatibility */ -typedef GIArgument GArgument; -typedef struct _GITypelib GTypelib; -#endif -#endif - G_END_DECLS From f4db8af9de41eb3a03a30f37aee811d2ea54b7a6 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 8 Nov 2023 15:04:59 +0000 Subject: [PATCH 2/5] gitypeinfo: Remove deprecated API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s not needed after a major version bump. Signed-off-by: Philip Withnall Helps: #3155 --- girepository/gitypeinfo.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/girepository/gitypeinfo.h b/girepository/gitypeinfo.h index 8460dab0e..1f884d97f 100644 --- a/girepository/gitypeinfo.h +++ b/girepository/gitypeinfo.h @@ -41,16 +41,6 @@ G_BEGIN_DECLS #define GI_IS_TYPE_INFO(info) \ (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_TYPE) -/** - * G_TYPE_TAG_IS_BASIC - * @tag: a type tag - * - * Checks if @tag is a basic type. - * - * Deprecated: 1.72: Use GI_TYPE_TAG_IS_BASIC() instead - */ -#define G_TYPE_TAG_IS_BASIC(tag) GI_TYPE_TAG_IS_BASIC(tag) - /** * GI_TYPE_TAG_IS_BASIC * @tag: a type tag From b32da06a7c15d5f03ae03b10d88af4af0ab82dca Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 8 Nov 2023 14:17:52 +0000 Subject: [PATCH 3/5] girepository: Rename symbols to the GI namespace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rather than a mix of structs being in `GI` and their methods being in `g_`. We’ve chosen not to use the `g_` namespace because a number of the libgirepository class names are quite generic, so we’d end up with confusing symbols like `GScopeType` and `GArgument`. Signed-off-by: Philip Withnall Helps: #3155 --- girepository/gdump.c | 4 +- girepository/giarginfo.c | 60 +- girepository/giarginfo.h | 28 +- girepository/gibaseinfo.c | 172 ++--- girepository/gibaseinfo.h | 44 +- girepository/gicallableinfo.c | 184 +++--- girepository/gicallableinfo.h | 70 +- girepository/giconstantinfo.c | 28 +- girepository/giconstantinfo.h | 12 +- girepository/gienuminfo.c | 44 +- girepository/gienuminfo.h | 24 +- girepository/gifieldinfo.c | 134 ++-- girepository/gifieldinfo.h | 22 +- girepository/gifunctioninfo.c | 100 +-- girepository/gifunctioninfo.h | 52 +- girepository/giinterfaceinfo.c | 142 ++-- girepository/giinterfaceinfo.h | 52 +- girepository/giobjectinfo.c | 314 ++++----- girepository/giobjectinfo.h | 110 ++-- girepository/gipropertyinfo.c | 44 +- girepository/gipropertyinfo.h | 12 +- girepository/giregisteredtypeinfo.c | 32 +- girepository/giregisteredtypeinfo.h | 22 +- girepository/girepository-private.h | 58 +- girepository/girepository.c | 274 ++++---- girepository/girepository.h | 142 ++-- girepository/girffi.c | 114 ++-- girepository/girffi.h | 34 +- girepository/girmodule-private.h | 32 +- girepository/girmodule.c | 116 ++-- girepository/girnode-private.h | 216 +++--- girepository/girnode.c | 979 ++++++++++++++-------------- girepository/giroffsets.c | 162 ++--- girepository/girparser-private.h | 28 +- girepository/girparser.c | 508 +++++++-------- girepository/girwriter-private.h | 8 +- girepository/girwriter.c | 444 ++++++------- girepository/gisignalinfo.c | 14 +- girepository/gisignalinfo.h | 8 +- girepository/gistructinfo.c | 96 +-- girepository/gistructinfo.h | 34 +- girepository/gitypeinfo.c | 92 +-- girepository/gitypeinfo.h | 38 +- girepository/gitypelib-internal.h | 74 +-- girepository/gitypelib.c | 440 ++++++------- girepository/gitypelib.h | 26 +- girepository/giunioninfo.c | 92 +-- girepository/giunioninfo.h | 34 +- girepository/givfuncinfo.c | 120 ++-- girepository/givfuncinfo.h | 32 +- 50 files changed, 2960 insertions(+), 2961 deletions(-) diff --git a/girepository/gdump.c b/girepository/gdump.c index a805427f8..126bc41c9 100644 --- a/girepository/gdump.c +++ b/girepository/gdump.c @@ -526,7 +526,7 @@ dump_error_quark (GQuark quark, const char *symbol, GOutputStream *out) } /** - * g_irepository_dump: + * gi_repository_dump: * @arg: Comma-separated pair of input and output filenames * @error: a %GError * @@ -549,7 +549,7 @@ static gboolean dump_irepository (const char *arg, GError **error) #else gboolean -g_irepository_dump (const char *arg, GError **error) +gi_repository_dump (const char *arg, GError **error) #endif { GHashTable *output_types; diff --git a/girepository/giarginfo.c b/girepository/giarginfo.c index 4e4e4560f..bb0bef115 100644 --- a/girepository/giarginfo.c +++ b/girepository/giarginfo.c @@ -44,7 +44,7 @@ */ /** - * g_arg_info_get_direction: + * gi_arg_info_get_direction: * @info: a #GIArgInfo * * Obtain the direction of the argument. Check #GIDirection for possible @@ -53,7 +53,7 @@ * Returns: the direction */ GIDirection -g_arg_info_get_direction (GIArgInfo *info) +gi_arg_info_get_direction (GIArgInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; ArgBlob *blob; @@ -72,7 +72,7 @@ g_arg_info_get_direction (GIArgInfo *info) } /** - * g_arg_info_is_return_value: + * gi_arg_info_is_return_value: * @info: a #GIArgInfo * * Obtain if the argument is a return value. It can either be a @@ -81,7 +81,7 @@ g_arg_info_get_direction (GIArgInfo *info) * Returns: %TRUE if it is a return value */ gboolean -g_arg_info_is_return_value (GIArgInfo *info) +gi_arg_info_is_return_value (GIArgInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; ArgBlob *blob; @@ -95,7 +95,7 @@ g_arg_info_is_return_value (GIArgInfo *info) } /** - * g_arg_info_is_caller_allocates: + * gi_arg_info_is_caller_allocates: * @info: a #GIArgInfo * * Obtain if the argument is a pointer to a struct or object that will @@ -106,7 +106,7 @@ g_arg_info_is_return_value (GIArgInfo *info) * Returns: %TRUE if caller is required to have allocated the argument */ gboolean -g_arg_info_is_caller_allocates (GIArgInfo *info) +gi_arg_info_is_caller_allocates (GIArgInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; ArgBlob *blob; @@ -120,7 +120,7 @@ g_arg_info_is_caller_allocates (GIArgInfo *info) } /** - * g_arg_info_is_optional: + * gi_arg_info_is_optional: * @info: a #GIArgInfo * * Obtain if the argument is optional. For 'out' arguments this means @@ -129,7 +129,7 @@ g_arg_info_is_caller_allocates (GIArgInfo *info) * Returns: %TRUE if it is an optional argument */ gboolean -g_arg_info_is_optional (GIArgInfo *info) +gi_arg_info_is_optional (GIArgInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; ArgBlob *blob; @@ -143,19 +143,19 @@ g_arg_info_is_optional (GIArgInfo *info) } /** - * g_arg_info_may_be_null: + * gi_arg_info_may_be_null: * @info: a #GIArgInfo * * Obtain if the type of the argument includes the possibility of %NULL. * For 'in' values this means that %NULL is a valid value. For 'out' * values, this means that %NULL may be returned. * - * See also g_arg_info_is_optional(). + * See also gi_arg_info_is_optional(). * * Returns: %TRUE if the value may be %NULL */ gboolean -g_arg_info_may_be_null (GIArgInfo *info) +gi_arg_info_may_be_null (GIArgInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; ArgBlob *blob; @@ -169,7 +169,7 @@ g_arg_info_may_be_null (GIArgInfo *info) } /** - * g_arg_info_is_skip: + * gi_arg_info_is_skip: * @info: a #GIArgInfo * * Obtain if an argument is only useful in C. @@ -178,7 +178,7 @@ g_arg_info_may_be_null (GIArgInfo *info) * Since: 1.30 */ gboolean -g_arg_info_is_skip (GIArgInfo *info) +gi_arg_info_is_skip (GIArgInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; ArgBlob *blob; @@ -192,7 +192,7 @@ g_arg_info_is_skip (GIArgInfo *info) } /** - * g_arg_info_get_ownership_transfer: + * gi_arg_info_get_ownership_transfer: * @info: a #GIArgInfo * * Obtain the ownership transfer for this argument. @@ -201,7 +201,7 @@ g_arg_info_is_skip (GIArgInfo *info) * Returns: the transfer */ GITransfer -g_arg_info_get_ownership_transfer (GIArgInfo *info) +gi_arg_info_get_ownership_transfer (GIArgInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; ArgBlob *blob; @@ -220,7 +220,7 @@ g_arg_info_get_ownership_transfer (GIArgInfo *info) } /** - * g_arg_info_get_scope: + * gi_arg_info_get_scope: * @info: a #GIArgInfo * * Obtain the scope type for this argument. The scope type explains @@ -231,7 +231,7 @@ g_arg_info_get_ownership_transfer (GIArgInfo *info) * Returns: the scope type */ GIScopeType -g_arg_info_get_scope (GIArgInfo *info) +gi_arg_info_get_scope (GIArgInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; ArgBlob *blob; @@ -245,7 +245,7 @@ g_arg_info_get_scope (GIArgInfo *info) } /** - * g_arg_info_get_closure: + * gi_arg_info_get_closure: * @info: a #GIArgInfo * * Obtain the index of the user data argument. This is only valid @@ -254,7 +254,7 @@ g_arg_info_get_scope (GIArgInfo *info) * Returns: index of the user data argument or -1 if there is none */ gint -g_arg_info_get_closure (GIArgInfo *info) +gi_arg_info_get_closure (GIArgInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; ArgBlob *blob; @@ -268,7 +268,7 @@ g_arg_info_get_closure (GIArgInfo *info) } /** - * g_arg_info_get_destroy: + * gi_arg_info_get_destroy: * @info: a #GIArgInfo * * Obtains the index of the #GDestroyNotify argument. This is only valid @@ -277,7 +277,7 @@ g_arg_info_get_closure (GIArgInfo *info) * Returns: index of the #GDestroyNotify argument or -1 if there is none */ gint -g_arg_info_get_destroy (GIArgInfo *info) +gi_arg_info_get_destroy (GIArgInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; ArgBlob *blob; @@ -291,45 +291,45 @@ g_arg_info_get_destroy (GIArgInfo *info) } /** - * g_arg_info_get_type: + * gi_arg_info_get_type: * @info: a #GIArgInfo * * Obtain the type information for @info. * * Returns: (transfer full): the #GITypeInfo holding the type - * information for @info, free it with g_base_info_unref() + * information for @info, free it with gi_base_info_unref() * when done. */ GITypeInfo * -g_arg_info_get_type (GIArgInfo *info) +gi_arg_info_get_type (GIArgInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; g_return_val_if_fail (info != NULL, NULL); g_return_val_if_fail (GI_IS_ARG_INFO (info), NULL); - return _g_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + G_STRUCT_OFFSET (ArgBlob, arg_type)); + return _gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + G_STRUCT_OFFSET (ArgBlob, arg_type)); } /** - * g_arg_info_load_type: + * gi_arg_info_load_type: * @info: a #GIArgInfo * @type: (out caller-allocates): Initialized with information about type of @info * * Obtain information about a the type of given argument @info; this - * function is a variant of g_arg_info_get_type() designed for stack + * function is a variant of gi_arg_info_get_type() designed for stack * allocation. * * The initialized @type must not be referenced after @info is deallocated. */ void -g_arg_info_load_type (GIArgInfo *info, - GITypeInfo *type) +gi_arg_info_load_type (GIArgInfo *info, + GITypeInfo *type) { GIRealInfo *rinfo = (GIRealInfo*) info; g_return_if_fail (info != NULL); g_return_if_fail (GI_IS_ARG_INFO (info)); - _g_type_info_init (type, (GIBaseInfo*)info, rinfo->typelib, rinfo->offset + G_STRUCT_OFFSET (ArgBlob, arg_type)); + _gi_type_info_init (type, (GIBaseInfo*)info, rinfo->typelib, rinfo->offset + G_STRUCT_OFFSET (ArgBlob, arg_type)); } diff --git a/girepository/giarginfo.h b/girepository/giarginfo.h index 395535277..685949721 100644 --- a/girepository/giarginfo.h +++ b/girepository/giarginfo.h @@ -39,43 +39,43 @@ G_BEGIN_DECLS * Checks if @info is a GIArgInfo. */ #define GI_IS_ARG_INFO(info) \ - (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_ARG) + (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_ARG) GI_AVAILABLE_IN_ALL -GIDirection g_arg_info_get_direction (GIArgInfo *info); +GIDirection gi_arg_info_get_direction (GIArgInfo *info); GI_AVAILABLE_IN_ALL -gboolean g_arg_info_is_return_value (GIArgInfo *info); +gboolean gi_arg_info_is_return_value (GIArgInfo *info); GI_AVAILABLE_IN_ALL -gboolean g_arg_info_is_optional (GIArgInfo *info); +gboolean gi_arg_info_is_optional (GIArgInfo *info); GI_AVAILABLE_IN_ALL -gboolean g_arg_info_is_caller_allocates (GIArgInfo *info); +gboolean gi_arg_info_is_caller_allocates (GIArgInfo *info); GI_AVAILABLE_IN_ALL -gboolean g_arg_info_may_be_null (GIArgInfo *info); +gboolean gi_arg_info_may_be_null (GIArgInfo *info); GI_AVAILABLE_IN_ALL -gboolean g_arg_info_is_skip (GIArgInfo *info); +gboolean gi_arg_info_is_skip (GIArgInfo *info); GI_AVAILABLE_IN_ALL -GITransfer g_arg_info_get_ownership_transfer (GIArgInfo *info); +GITransfer gi_arg_info_get_ownership_transfer (GIArgInfo *info); GI_AVAILABLE_IN_ALL -GIScopeType g_arg_info_get_scope (GIArgInfo *info); +GIScopeType gi_arg_info_get_scope (GIArgInfo *info); GI_AVAILABLE_IN_ALL -gint g_arg_info_get_closure (GIArgInfo *info); +gint gi_arg_info_get_closure (GIArgInfo *info); GI_AVAILABLE_IN_ALL -gint g_arg_info_get_destroy (GIArgInfo *info); +gint gi_arg_info_get_destroy (GIArgInfo *info); GI_AVAILABLE_IN_ALL -GITypeInfo * g_arg_info_get_type (GIArgInfo *info); +GITypeInfo * gi_arg_info_get_type (GIArgInfo *info); GI_AVAILABLE_IN_ALL -void g_arg_info_load_type (GIArgInfo *info, - GITypeInfo *type); +void gi_arg_info_load_type (GIArgInfo *info, + GITypeInfo *type); G_END_DECLS diff --git a/girepository/gibaseinfo.c b/girepository/gibaseinfo.c index 9103a4415..8f29c2d14 100644 --- a/girepository/gibaseinfo.c +++ b/girepository/gibaseinfo.c @@ -38,26 +38,26 @@ /* GBoxed registration of BaseInfo. */ GType -g_base_info_gtype_get_type (void) +gi_base_info_gtype_get_type (void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GIBaseInfo", - (GBoxedCopyFunc) g_base_info_ref, - (GBoxedFreeFunc) g_base_info_unref); + (GBoxedCopyFunc) gi_base_info_ref, + (GBoxedFreeFunc) gi_base_info_unref); return our_type; } /* info creation */ GIBaseInfo * -_g_info_new_full (GIInfoType type, - GIRepository *repository, - GIBaseInfo *container, - GITypelib *typelib, - guint32 offset) +_gi_info_new_full (GIInfoType type, + GIRepository *repository, + GIBaseInfo *container, + GITypelib *typelib, + guint32 offset) { GIRealInfo *info; @@ -65,11 +65,11 @@ _g_info_new_full (GIInfoType type, info = g_slice_new (GIRealInfo); - _g_info_init (info, type, repository, container, typelib, offset); + _gi_info_init (info, type, repository, container, typelib, offset); info->ref_count = 1; if (container && ((GIRealInfo *) container)->ref_count != INVALID_REFCOUNT) - g_base_info_ref (info->container); + gi_base_info_ref (info->container); g_object_ref (info->repository); @@ -77,7 +77,7 @@ _g_info_new_full (GIInfoType type, } /** - * g_info_new: + * gi_info_new: * @type: TODO * @container: TODO * @typelib: TODO @@ -88,21 +88,21 @@ _g_info_new_full (GIInfoType type, * Returns: TODO */ GIBaseInfo * -g_info_new (GIInfoType type, - GIBaseInfo *container, - GITypelib *typelib, - guint32 offset) +gi_info_new (GIInfoType type, + GIBaseInfo *container, + GITypelib *typelib, + guint32 offset) { - return _g_info_new_full (type, ((GIRealInfo*)container)->repository, container, typelib, offset); + return _gi_info_new_full (type, ((GIRealInfo*)container)->repository, container, typelib, offset); } void -_g_info_init (GIRealInfo *info, - GIInfoType type, - GIRepository *repository, - GIBaseInfo *container, - GITypelib *typelib, - guint32 offset) +_gi_info_init (GIRealInfo *info, + GIInfoType type, + GIRepository *repository, + GIBaseInfo *container, + GITypelib *typelib, + guint32 offset) { memset (info, 0, sizeof (GIRealInfo)); @@ -116,26 +116,26 @@ _g_info_init (GIRealInfo *info, if (container) info->container = container; - g_assert (G_IS_IREPOSITORY (repository)); + g_assert (GI_IS_REPOSITORY (repository)); info->repository = repository; } GIBaseInfo * -_g_info_from_entry (GIRepository *repository, - GITypelib *typelib, - guint16 index) +_gi_info_from_entry (GIRepository *repository, + GITypelib *typelib, + guint16 index) { GIBaseInfo *result; - DirEntry *entry = g_typelib_get_dir_entry (typelib, index); + DirEntry *entry = gi_typelib_get_dir_entry (typelib, index); if (entry->local) - result = _g_info_new_full (entry->blob_type, repository, NULL, typelib, entry->offset); + result = _gi_info_new_full (entry->blob_type, repository, NULL, typelib, entry->offset); else { - const gchar *namespace = g_typelib_get_string (typelib, entry->offset); - const gchar *name = g_typelib_get_string (typelib, entry->name); + const gchar *namespace = gi_typelib_get_string (typelib, entry->offset); + const gchar *name = gi_typelib_get_string (typelib, entry->name); - result = g_irepository_find_by_name (repository, namespace, name); + result = gi_repository_find_by_name (repository, namespace, name); if (result == NULL) { GIUnresolvedInfo *unresolved; @@ -158,27 +158,27 @@ _g_info_from_entry (GIRepository *repository, } GITypeInfo * -_g_type_info_new (GIBaseInfo *container, - GITypelib *typelib, - guint32 offset) +_gi_type_info_new (GIBaseInfo *container, + GITypelib *typelib, + guint32 offset) { SimpleTypeBlob *type = (SimpleTypeBlob *)&typelib->data[offset]; - return (GITypeInfo *) g_info_new (GI_INFO_TYPE_TYPE, container, typelib, - (type->flags.reserved == 0 && type->flags.reserved2 == 0) ? offset : type->offset); + return (GITypeInfo *) gi_info_new (GI_INFO_TYPE_TYPE, container, typelib, + (type->flags.reserved == 0 && type->flags.reserved2 == 0) ? offset : type->offset); } void -_g_type_info_init (GIBaseInfo *info, - GIBaseInfo *container, - GITypelib *typelib, - guint32 offset) +_gi_type_info_init (GIBaseInfo *info, + GIBaseInfo *container, + GITypelib *typelib, + guint32 offset) { GIRealInfo *rinfo = (GIRealInfo*)container; SimpleTypeBlob *type = (SimpleTypeBlob *)&typelib->data[offset]; - _g_info_init ((GIRealInfo*)info, GI_INFO_TYPE_TYPE, rinfo->repository, container, typelib, - (type->flags.reserved == 0 && type->flags.reserved2 == 0) ? offset : type->offset); + _gi_info_init ((GIRealInfo*)info, GI_INFO_TYPE_TYPE, rinfo->repository, container, typelib, + (type->flags.reserved == 0 && type->flags.reserved2 == 0) ? offset : type->offset); } /* GIBaseInfo functions */ @@ -199,20 +199,20 @@ _g_type_info_init (GIBaseInfo *info, * ]| * * Most #GIRepository APIs returning a #GIBaseInfo is actually - * creating a new struct; in other words, g_base_info_unref() has to + * creating a new struct; in other words, gi_base_info_unref() has to * be called when done accessing the data. * * #GIBaseInfo structuress are normally accessed by calling either - * g_irepository_find_by_name(), g_irepository_find_by_gtype() or - * g_irepository_get_info(). + * gi_repository_find_by_name(), gi_repository_find_by_gtype() or + * gi_repository_get_info(). * * |[ * GIBaseInfo *button_info = - * g_irepository_find_by_name (NULL, "Gtk", "Button"); + * gi_repository_find_by_name (NULL, "Gtk", "Button"); * * // ... use button_info ... * - * g_base_info_unref (button_info); + * gi_base_info_unref (button_info); * ]| * * ## Hierarchy @@ -230,7 +230,7 @@ _g_type_info_init (GIBaseInfo *info, */ /** - * g_base_info_ref: (skip) + * gi_base_info_ref: (skip) * @info: a #GIBaseInfo * * Increases the reference count of @info. @@ -238,7 +238,7 @@ _g_type_info_init (GIBaseInfo *info, * Returns: the same @info. */ GIBaseInfo * -g_base_info_ref (GIBaseInfo *info) +gi_base_info_ref (GIBaseInfo *info) { GIRealInfo *rinfo = (GIRealInfo*)info; @@ -249,14 +249,14 @@ g_base_info_ref (GIBaseInfo *info) } /** - * g_base_info_unref: (skip) + * gi_base_info_unref: (skip) * @info: a #GIBaseInfo * * Decreases the reference count of @info. When its reference count * drops to 0, the info is freed. */ void -g_base_info_unref (GIBaseInfo *info) +gi_base_info_unref (GIBaseInfo *info) { GIRealInfo *rinfo = (GIRealInfo*)info; @@ -266,7 +266,7 @@ g_base_info_unref (GIBaseInfo *info) return; if (rinfo->container && ((GIRealInfo *) rinfo->container)->ref_count != INVALID_REFCOUNT) - g_base_info_unref (rinfo->container); + gi_base_info_unref (rinfo->container); if (rinfo->repository) g_object_unref (rinfo->repository); @@ -278,7 +278,7 @@ g_base_info_unref (GIBaseInfo *info) } /** - * g_base_info_get_type: + * gi_base_info_get_type: * @info: a #GIBaseInfo * * Obtain the info type of the GIBaseInfo. @@ -286,14 +286,14 @@ g_base_info_unref (GIBaseInfo *info) * Returns: the info type of @info */ GIInfoType -g_base_info_get_type (GIBaseInfo *info) +gi_base_info_get_type (GIBaseInfo *info) { return ((GIRealInfo*)info)->type; } /** - * g_base_info_get_name: + * gi_base_info_get_name: * @info: a #GIBaseInfo * * Obtain the name of the @info. What the name represents depends on @@ -303,7 +303,7 @@ g_base_info_get_type (GIBaseInfo *info) * Returns: the name of @info or %NULL if it lacks a name. */ const gchar * -g_base_info_get_name (GIBaseInfo *info) +gi_base_info_get_name (GIBaseInfo *info) { GIRealInfo *rinfo = (GIRealInfo*)info; g_assert (rinfo->ref_count > 0); @@ -323,7 +323,7 @@ g_base_info_get_name (GIBaseInfo *info) { CommonBlob *blob = (CommonBlob *)&rinfo->typelib->data[rinfo->offset]; - return g_typelib_get_string (rinfo->typelib, blob->name); + return gi_typelib_get_string (rinfo->typelib, blob->name); } break; @@ -331,7 +331,7 @@ g_base_info_get_name (GIBaseInfo *info) { ValueBlob *blob = (ValueBlob *)&rinfo->typelib->data[rinfo->offset]; - return g_typelib_get_string (rinfo->typelib, blob->name); + return gi_typelib_get_string (rinfo->typelib, blob->name); } break; @@ -339,7 +339,7 @@ g_base_info_get_name (GIBaseInfo *info) { SignalBlob *blob = (SignalBlob *)&rinfo->typelib->data[rinfo->offset]; - return g_typelib_get_string (rinfo->typelib, blob->name); + return gi_typelib_get_string (rinfo->typelib, blob->name); } break; @@ -347,7 +347,7 @@ g_base_info_get_name (GIBaseInfo *info) { PropertyBlob *blob = (PropertyBlob *)&rinfo->typelib->data[rinfo->offset]; - return g_typelib_get_string (rinfo->typelib, blob->name); + return gi_typelib_get_string (rinfo->typelib, blob->name); } break; @@ -355,7 +355,7 @@ g_base_info_get_name (GIBaseInfo *info) { VFuncBlob *blob = (VFuncBlob *)&rinfo->typelib->data[rinfo->offset]; - return g_typelib_get_string (rinfo->typelib, blob->name); + return gi_typelib_get_string (rinfo->typelib, blob->name); } break; @@ -363,7 +363,7 @@ g_base_info_get_name (GIBaseInfo *info) { FieldBlob *blob = (FieldBlob *)&rinfo->typelib->data[rinfo->offset]; - return g_typelib_get_string (rinfo->typelib, blob->name); + return gi_typelib_get_string (rinfo->typelib, blob->name); } break; @@ -371,7 +371,7 @@ g_base_info_get_name (GIBaseInfo *info) { ArgBlob *blob = (ArgBlob *)&rinfo->typelib->data[rinfo->offset]; - return g_typelib_get_string (rinfo->typelib, blob->name); + return gi_typelib_get_string (rinfo->typelib, blob->name); } break; case GI_INFO_TYPE_UNRESOLVED: @@ -392,7 +392,7 @@ g_base_info_get_name (GIBaseInfo *info) } /** - * g_base_info_get_namespace: + * gi_base_info_get_namespace: * @info: a #GIBaseInfo * * Obtain the namespace of @info. @@ -400,7 +400,7 @@ g_base_info_get_name (GIBaseInfo *info) * Returns: the namespace */ const gchar * -g_base_info_get_namespace (GIBaseInfo *info) +gi_base_info_get_namespace (GIBaseInfo *info) { GIRealInfo *rinfo = (GIRealInfo*) info; Header *header = (Header *)rinfo->typelib->data; @@ -414,11 +414,11 @@ g_base_info_get_namespace (GIBaseInfo *info) return unresolved->namespace; } - return g_typelib_get_string (rinfo->typelib, header->namespace); + return gi_typelib_get_string (rinfo->typelib, header->namespace); } /** - * g_base_info_is_deprecated: + * gi_base_info_is_deprecated: * @info: a #GIBaseInfo * * Obtain whether the @info is represents a metadata which is @@ -427,7 +427,7 @@ g_base_info_get_namespace (GIBaseInfo *info) * Returns: %TRUE if deprecated */ gboolean -g_base_info_is_deprecated (GIBaseInfo *info) +gi_base_info_is_deprecated (GIBaseInfo *info) { GIRealInfo *rinfo = (GIRealInfo*) info; switch (rinfo->type) @@ -485,7 +485,7 @@ g_base_info_is_deprecated (GIBaseInfo *info) } /** - * g_base_info_get_attribute: + * gi_base_info_get_attribute: * @info: a #GIBaseInfo * @name: a freeform string naming an attribute * @@ -494,12 +494,12 @@ g_base_info_is_deprecated (GIBaseInfo *info) * Returns: The value of the attribute, or %NULL if no such attribute exists */ const gchar * -g_base_info_get_attribute (GIBaseInfo *info, - const gchar *name) +gi_base_info_get_attribute (GIBaseInfo *info, + const gchar *name) { GIAttributeIter iter = { 0, }; gchar *curname, *curvalue; - while (g_base_info_iterate_attributes (info, &iter, &curname, &curvalue)) + while (gi_base_info_iterate_attributes (info, &iter, &curname, &curvalue)) { if (strcmp (name, curname) == 0) return (const gchar*) curvalue; @@ -562,7 +562,7 @@ _attribute_blob_find_first (GIBaseInfo *info, } /** - * g_base_info_iterate_attributes: + * gi_base_info_iterate_attributes: * @info: a #GIBaseInfo * @iterator: (inout): a #GIAttributeIter structure, must be initialized; see below * @name: (out) (transfer none): Returned name, must not be freed @@ -585,7 +585,7 @@ _attribute_blob_find_first (GIBaseInfo *info, * GIAttributeIter iter = { 0, }; * char *name; * char *value; - * while (g_base_info_iterate_attributes (info, &iter, &name, &value)) + * while (gi_base_info_iterate_attributes (info, &iter, &name, &value)) * { * g_print ("attribute name: %s value: %s", name, value); * } @@ -595,10 +595,10 @@ _attribute_blob_find_first (GIBaseInfo *info, * Returns: %TRUE if there are more attributes */ gboolean -g_base_info_iterate_attributes (GIBaseInfo *info, - GIAttributeIter *iterator, - gchar **name, - gchar **value) +gi_base_info_iterate_attributes (GIBaseInfo *info, + GIAttributeIter *iterator, + gchar **name, + gchar **value) { GIRealInfo *rinfo = (GIRealInfo *)info; Header *header = (Header *)rinfo->typelib->data; @@ -615,15 +615,15 @@ g_base_info_iterate_attributes (GIBaseInfo *info, if (next == NULL || next->offset != rinfo->offset || next >= after) return FALSE; - *name = (gchar*) g_typelib_get_string (rinfo->typelib, next->name); - *value = (gchar*) g_typelib_get_string (rinfo->typelib, next->value); + *name = (gchar*) gi_typelib_get_string (rinfo->typelib, next->name); + *value = (gchar*) gi_typelib_get_string (rinfo->typelib, next->value); iterator->data = next + 1; return TRUE; } /** - * g_base_info_get_container: + * gi_base_info_get_container: * @info: a #GIBaseInfo * * Obtain the container of the @info. The container is the parent @@ -633,13 +633,13 @@ g_base_info_iterate_attributes (GIBaseInfo *info, * Returns: (transfer none): the container */ GIBaseInfo * -g_base_info_get_container (GIBaseInfo *info) +gi_base_info_get_container (GIBaseInfo *info) { return ((GIRealInfo*)info)->container; } /** - * g_base_info_get_typelib: + * gi_base_info_get_typelib: * @info: a #GIBaseInfo * * Obtain the typelib this @info belongs to @@ -647,13 +647,13 @@ g_base_info_get_container (GIBaseInfo *info) * Returns: (transfer none): the typelib. */ GITypelib * -g_base_info_get_typelib (GIBaseInfo *info) +gi_base_info_get_typelib (GIBaseInfo *info) { return ((GIRealInfo*)info)->typelib; } /** - * g_base_info_equal: + * gi_base_info_equal: * @info1: a #GIBaseInfo * @info2: a #GIBaseInfo * @@ -666,7 +666,7 @@ g_base_info_get_typelib (GIBaseInfo *info) * Returns: %TRUE if and only if @info1 equals @info2. */ gboolean -g_base_info_equal (GIBaseInfo *info1, GIBaseInfo *info2) +gi_base_info_equal (GIBaseInfo *info1, GIBaseInfo *info2) { /* Compare the TypeLib pointers, which are mmapped. */ GIRealInfo *rinfo1 = (GIRealInfo*)info1; diff --git a/girepository/gibaseinfo.h b/girepository/gibaseinfo.h index 2a2012528..b6998293f 100644 --- a/girepository/gibaseinfo.h +++ b/girepository/gibaseinfo.h @@ -48,54 +48,54 @@ typedef struct { gpointer data4; } GIAttributeIter; -#define GI_TYPE_BASE_INFO (g_base_info_gtype_get_type ()) +#define GI_TYPE_BASE_INFO (gi_base_info_gtype_get_type ()) GI_AVAILABLE_IN_ALL -GType g_base_info_gtype_get_type (void) G_GNUC_CONST; +GType gi_base_info_gtype_get_type (void) G_GNUC_CONST; GI_AVAILABLE_IN_ALL -GIBaseInfo * g_base_info_ref (GIBaseInfo *info); +GIBaseInfo * gi_base_info_ref (GIBaseInfo *info); GI_AVAILABLE_IN_ALL -void g_base_info_unref (GIBaseInfo *info); +void gi_base_info_unref (GIBaseInfo *info); GI_AVAILABLE_IN_ALL -GIInfoType g_base_info_get_type (GIBaseInfo *info); +GIInfoType gi_base_info_get_type (GIBaseInfo *info); GI_AVAILABLE_IN_ALL -const gchar * g_base_info_get_name (GIBaseInfo *info); +const gchar * gi_base_info_get_name (GIBaseInfo *info); GI_AVAILABLE_IN_ALL -const gchar * g_base_info_get_namespace (GIBaseInfo *info); +const gchar * gi_base_info_get_namespace (GIBaseInfo *info); GI_AVAILABLE_IN_ALL -gboolean g_base_info_is_deprecated (GIBaseInfo *info); +gboolean gi_base_info_is_deprecated (GIBaseInfo *info); GI_AVAILABLE_IN_ALL -const gchar * g_base_info_get_attribute (GIBaseInfo *info, - const gchar *name); +const gchar * gi_base_info_get_attribute (GIBaseInfo *info, + const gchar *name); GI_AVAILABLE_IN_ALL -gboolean g_base_info_iterate_attributes (GIBaseInfo *info, - GIAttributeIter *iterator, - char **name, - char **value); +gboolean gi_base_info_iterate_attributes (GIBaseInfo *info, + GIAttributeIter *iterator, + char **name, + char **value); GI_AVAILABLE_IN_ALL -GIBaseInfo * g_base_info_get_container (GIBaseInfo *info); +GIBaseInfo * gi_base_info_get_container (GIBaseInfo *info); GI_AVAILABLE_IN_ALL -GITypelib * g_base_info_get_typelib (GIBaseInfo *info); +GITypelib * gi_base_info_get_typelib (GIBaseInfo *info); GI_AVAILABLE_IN_ALL -gboolean g_base_info_equal (GIBaseInfo *info1, - GIBaseInfo *info2); +gboolean gi_base_info_equal (GIBaseInfo *info1, + GIBaseInfo *info2); GI_AVAILABLE_IN_ALL -GIBaseInfo * g_info_new (GIInfoType type, - GIBaseInfo *container, - GITypelib *typelib, - guint32 offset); +GIBaseInfo * gi_info_new (GIInfoType type, + GIBaseInfo *container, + GITypelib *typelib, + guint32 offset); G_END_DECLS diff --git a/girepository/gicallableinfo.c b/girepository/gicallableinfo.c index 88dd367aa..336d44d6f 100644 --- a/girepository/gicallableinfo.c +++ b/girepository/gicallableinfo.c @@ -82,7 +82,7 @@ signature_offset (GICallableInfo *info) } /** - * g_callable_info_can_throw_gerror: + * gi_callable_info_can_throw_gerror: * @info: a #GICallableInfo * * TODO @@ -91,7 +91,7 @@ signature_offset (GICallableInfo *info) * Returns: %TRUE if this #GICallableInfo can throw a #GError */ gboolean -g_callable_info_can_throw_gerror (GICallableInfo *info) +gi_callable_info_can_throw_gerror (GICallableInfo *info) { GIRealInfo *rinfo = (GIRealInfo*)info; SignatureBlob *signature; @@ -127,7 +127,7 @@ g_callable_info_can_throw_gerror (GICallableInfo *info) } /** - * g_callable_info_is_method: + * gi_callable_info_is_method: * @info: a #GICallableInfo * * Determines if the callable info is a method. For #GIVFuncInfos, @@ -135,7 +135,7 @@ g_callable_info_can_throw_gerror (GICallableInfo *info) * this is always true. Otherwise, this looks at the %GI_FUNCTION_IS_METHOD * flag on the #GIFunctionInfo. * - * Concretely, this function returns whether g_callable_info_get_n_args() + * Concretely, this function returns whether gi_callable_info_get_n_args() * matches the number of arguments in the raw C method. For methods, there * is one more C argument than is exposed by introspection: the "self" * or "this" object. @@ -144,7 +144,7 @@ g_callable_info_can_throw_gerror (GICallableInfo *info) * Since: 1.34 */ gboolean -g_callable_info_is_method (GICallableInfo *info) +gi_callable_info_is_method (GICallableInfo *info) { GIRealInfo *rinfo = (GIRealInfo*)info; switch (rinfo->type) { @@ -165,16 +165,16 @@ g_callable_info_is_method (GICallableInfo *info) } /** - * g_callable_info_get_return_type: + * gi_callable_info_get_return_type: * @info: a #GICallableInfo * * Obtain the return type of a callable item as a #GITypeInfo. * * Returns: (transfer full): the #GITypeInfo. Free the struct by calling - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GITypeInfo * -g_callable_info_get_return_type (GICallableInfo *info) +gi_callable_info_get_return_type (GICallableInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; guint32 offset; @@ -184,24 +184,24 @@ g_callable_info_get_return_type (GICallableInfo *info) offset = signature_offset (info); - return _g_type_info_new ((GIBaseInfo*)info, rinfo->typelib, offset); + return _gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, offset); } /** - * g_callable_info_load_return_type: + * gi_callable_info_load_return_type: * @info: a #GICallableInfo * @type: (out caller-allocates): Initialized with return type of @info * * Obtain information about a return value of callable; this - * function is a variant of g_callable_info_get_return_type() designed for stack + * function is a variant of gi_callable_info_get_return_type() designed for stack * allocation. * * The initialized @type must not be referenced after @info is deallocated. */ void -g_callable_info_load_return_type (GICallableInfo *info, - GITypeInfo *type) +gi_callable_info_load_return_type (GICallableInfo *info, + GITypeInfo *type) { GIRealInfo *rinfo = (GIRealInfo *)info; guint32 offset; @@ -211,11 +211,11 @@ g_callable_info_load_return_type (GICallableInfo *info, offset = signature_offset (info); - _g_type_info_init (type, (GIBaseInfo*)info, rinfo->typelib, offset); + _gi_type_info_init (type, (GIBaseInfo*)info, rinfo->typelib, offset); } /** - * g_callable_info_may_return_null: + * gi_callable_info_may_return_null: * @info: a #GICallableInfo * * See if a callable could return %NULL. @@ -223,7 +223,7 @@ g_callable_info_load_return_type (GICallableInfo *info, * Returns: %TRUE if callable could return %NULL */ gboolean -g_callable_info_may_return_null (GICallableInfo *info) +gi_callable_info_may_return_null (GICallableInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; SignatureBlob *blob; @@ -237,7 +237,7 @@ g_callable_info_may_return_null (GICallableInfo *info) } /** - * g_callable_info_skip_return: + * gi_callable_info_skip_return: * @info: a #GICallableInfo * * See if a callable's return value is only useful in C. @@ -245,7 +245,7 @@ g_callable_info_may_return_null (GICallableInfo *info) * Returns: %TRUE if return value is only useful in C. */ gboolean -g_callable_info_skip_return (GICallableInfo *info) +gi_callable_info_skip_return (GICallableInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; SignatureBlob *blob; @@ -259,7 +259,7 @@ g_callable_info_skip_return (GICallableInfo *info) } /** - * g_callable_info_get_caller_owns: + * gi_callable_info_get_caller_owns: * @info: a #GICallableInfo * * See whether the caller owns the return value of this callable. @@ -268,7 +268,7 @@ g_callable_info_skip_return (GICallableInfo *info) * Returns: the transfer mode for the return value of the callable */ GITransfer -g_callable_info_get_caller_owns (GICallableInfo *info) +gi_callable_info_get_caller_owns (GICallableInfo *info) { GIRealInfo *rinfo = (GIRealInfo*) info; SignatureBlob *blob; @@ -287,7 +287,7 @@ g_callable_info_get_caller_owns (GICallableInfo *info) } /** - * g_callable_info_get_instance_ownership_transfer: + * gi_callable_info_get_instance_ownership_transfer: * @info: a #GICallableInfo * * Obtains the ownership transfer for the instance argument. @@ -297,7 +297,7 @@ g_callable_info_get_caller_owns (GICallableInfo *info) * Returns: the transfer mode of the instance argument */ GITransfer -g_callable_info_get_instance_ownership_transfer (GICallableInfo *info) +gi_callable_info_get_instance_ownership_transfer (GICallableInfo *info) { GIRealInfo *rinfo = (GIRealInfo*) info; SignatureBlob *blob; @@ -314,7 +314,7 @@ g_callable_info_get_instance_ownership_transfer (GICallableInfo *info) } /** - * g_callable_info_get_n_args: + * gi_callable_info_get_n_args: * @info: a #GICallableInfo * * Obtain the number of arguments (both IN and OUT) for this callable. @@ -322,7 +322,7 @@ g_callable_info_get_instance_ownership_transfer (GICallableInfo *info) * Returns: The number of arguments this callable expects. */ gint -g_callable_info_get_n_args (GICallableInfo *info) +gi_callable_info_get_n_args (GICallableInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; gint offset; @@ -338,18 +338,18 @@ g_callable_info_get_n_args (GICallableInfo *info) } /** - * g_callable_info_get_arg: + * gi_callable_info_get_arg: * @info: a #GICallableInfo * @n: the argument index to fetch * * Obtain information about a particular argument of this callable. * * Returns: (transfer full): the #GIArgInfo. Free it with - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GIArgInfo * -g_callable_info_get_arg (GICallableInfo *info, - gint n) +gi_callable_info_get_arg (GICallableInfo *info, + gint n) { GIRealInfo *rinfo = (GIRealInfo *)info; Header *header; @@ -361,26 +361,26 @@ g_callable_info_get_arg (GICallableInfo *info, offset = signature_offset (info); header = (Header *)rinfo->typelib->data; - return (GIArgInfo *) g_info_new (GI_INFO_TYPE_ARG, (GIBaseInfo*)info, rinfo->typelib, - offset + header->signature_blob_size + n * header->arg_blob_size); + return (GIArgInfo *) gi_info_new (GI_INFO_TYPE_ARG, (GIBaseInfo*)info, rinfo->typelib, + offset + header->signature_blob_size + n * header->arg_blob_size); } /** - * g_callable_info_load_arg: + * gi_callable_info_load_arg: * @info: a #GICallableInfo * @n: the argument index to fetch * @arg: (out caller-allocates): Initialize with argument number @n * * Obtain information about a particular argument of this callable; this - * function is a variant of g_callable_info_get_arg() designed for stack + * function is a variant of gi_callable_info_get_arg() designed for stack * allocation. * * The initialized @arg must not be referenced after @info is deallocated. */ void -g_callable_info_load_arg (GICallableInfo *info, - gint n, - GIArgInfo *arg) +gi_callable_info_load_arg (GICallableInfo *info, + gint n, + GIArgInfo *arg) { GIRealInfo *rinfo = (GIRealInfo *)info; Header *header; @@ -392,12 +392,12 @@ g_callable_info_load_arg (GICallableInfo *info, offset = signature_offset (info); header = (Header *)rinfo->typelib->data; - _g_info_init ((GIRealInfo*)arg, GI_INFO_TYPE_ARG, rinfo->repository, (GIBaseInfo*)info, rinfo->typelib, - offset + header->signature_blob_size + n * header->arg_blob_size); + _gi_info_init ((GIRealInfo*)arg, GI_INFO_TYPE_ARG, rinfo->repository, (GIBaseInfo*)info, rinfo->typelib, + offset + header->signature_blob_size + n * header->arg_blob_size); } /** - * g_callable_info_get_return_attribute: + * gi_callable_info_get_return_attribute: * @info: a #GICallableInfo * @name: a freeform string naming an attribute * @@ -406,12 +406,12 @@ g_callable_info_load_arg (GICallableInfo *info, * Returns: The value of the attribute, or %NULL if no such attribute exists */ const gchar * -g_callable_info_get_return_attribute (GICallableInfo *info, - const gchar *name) +gi_callable_info_get_return_attribute (GICallableInfo *info, + const gchar *name) { GIAttributeIter iter = { 0, }; gchar *curname, *curvalue; - while (g_callable_info_iterate_return_attributes (info, &iter, &curname, &curvalue)) + while (gi_callable_info_iterate_return_attributes (info, &iter, &curname, &curvalue)) { if (g_strcmp0 (name, curname) == 0) return (const gchar*) curvalue; @@ -421,7 +421,7 @@ g_callable_info_get_return_attribute (GICallableInfo *info, } /** - * g_callable_info_iterate_return_attributes: + * gi_callable_info_iterate_return_attributes: * @info: a #GICallableInfo * @iterator: (inout): a #GIAttributeIter structure, must be initialized; see below * @name: (out) (transfer none): Returned name, must not be freed @@ -434,16 +434,16 @@ g_callable_info_get_return_attribute (GICallableInfo *info, * Both the @name and @value should be treated as constants * and must not be freed. * - * See g_base_info_iterate_attributes() for an example of how to use a + * See gi_base_info_iterate_attributes() for an example of how to use a * similar API. * * Returns: %TRUE if there are more attributes */ gboolean -g_callable_info_iterate_return_attributes (GICallableInfo *info, - GIAttributeIter *iterator, - char **name, - char **value) +gi_callable_info_iterate_return_attributes (GICallableInfo *info, + GIAttributeIter *iterator, + char **name, + char **value) { GIRealInfo *rinfo = (GIRealInfo *)info; Header *header = (Header *)rinfo->typelib->data; @@ -463,8 +463,8 @@ g_callable_info_iterate_return_attributes (GICallableInfo *info, if (next == NULL || next->offset != blob_offset || next >= after) return FALSE; - *name = (gchar*) g_typelib_get_string (rinfo->typelib, next->name); - *value = (gchar*) g_typelib_get_string (rinfo->typelib, next->value); + *name = (gchar*) gi_typelib_get_string (rinfo->typelib, next->name); + *value = (gchar*) gi_typelib_get_string (rinfo->typelib, next->value); iterator->data = next + 1; return TRUE; @@ -567,14 +567,14 @@ gi_type_info_extract_ffi_return_value (GITypeInfo *return_info, GIFFIReturnValue *ffi_value, GIArgument *arg) { - GITypeTag return_tag = g_type_info_get_tag (return_info); + GITypeTag return_tag = gi_type_info_get_tag (return_info); GIInfoType interface_type = GI_INFO_TYPE_INVALID; if (return_tag == GI_TYPE_TAG_INTERFACE) { - GIBaseInfo *interface_info = g_type_info_get_interface (return_info); - interface_type = g_base_info_get_type (interface_info); - g_base_info_unref (interface_info); + GIBaseInfo *interface_info = gi_type_info_get_interface (return_info); + interface_type = gi_base_info_get_type (interface_info); + gi_base_info_unref (interface_info); } gi_type_tag_extract_ffi_return_value (return_tag, interface_type, @@ -582,7 +582,7 @@ gi_type_info_extract_ffi_return_value (GITypeInfo *return_info, } /** - * g_callable_info_invoke: + * gi_callable_info_invoke: * @info: TODO * @function: TODO * @in_args: (array length=n_in_args): TODO @@ -597,16 +597,16 @@ gi_type_info_extract_ffi_return_value (GITypeInfo *return_info, * TODO */ gboolean -g_callable_info_invoke (GIFunctionInfo *info, - gpointer function, - const GIArgument *in_args, - int n_in_args, - const GIArgument *out_args, - int n_out_args, - GIArgument *return_value, - gboolean is_method, - gboolean throws, - GError **error) +gi_callable_info_invoke (GIFunctionInfo *info, + gpointer function, + const GIArgument *in_args, + int n_in_args, + const GIArgument *out_args, + int n_out_args, + GIArgument *return_value, + gboolean is_method, + gboolean throws, + GError **error) { ffi_cif cif; ffi_type *rtype; @@ -623,21 +623,21 @@ g_callable_info_invoke (GIFunctionInfo *info, GIFFIReturnValue ffi_return_value; gpointer return_value_p; /* Will point inside the union return_value */ - rinfo = g_callable_info_get_return_type ((GICallableInfo *)info); - rtype = g_type_info_get_ffi_type (rinfo); - rtag = g_type_info_get_tag(rinfo); + rinfo = gi_callable_info_get_return_type ((GICallableInfo *)info); + rtype = gi_type_info_get_ffi_type (rinfo); + rtag = gi_type_info_get_tag(rinfo); in_pos = 0; out_pos = 0; - n_args = g_callable_info_get_n_args ((GICallableInfo *)info); + n_args = gi_callable_info_get_n_args ((GICallableInfo *)info); if (is_method) { if (n_in_args == 0) { g_set_error (error, - G_INVOKE_ERROR, - G_INVOKE_ERROR_ARGUMENT_MISMATCH, + GI_INVOKE_ERROR, + GI_INVOKE_ERROR_ARGUMENT_MISMATCH, "Too few \"in\" arguments (handling this)"); goto out; } @@ -662,20 +662,20 @@ g_callable_info_invoke (GIFunctionInfo *info, for (i = 0; i < n_args; i++) { int offset = (is_method ? 1 : 0); - ainfo = g_callable_info_get_arg ((GICallableInfo *)info, i); - switch (g_arg_info_get_direction (ainfo)) + ainfo = gi_callable_info_get_arg ((GICallableInfo *)info, i); + switch (gi_arg_info_get_direction (ainfo)) { case GI_DIRECTION_IN: - tinfo = g_arg_info_get_type (ainfo); - atypes[i+offset] = g_type_info_get_ffi_type (tinfo); - g_base_info_unref ((GIBaseInfo *)ainfo); - g_base_info_unref ((GIBaseInfo *)tinfo); + tinfo = gi_arg_info_get_type (ainfo); + atypes[i+offset] = gi_type_info_get_ffi_type (tinfo); + gi_base_info_unref ((GIBaseInfo *)ainfo); + gi_base_info_unref ((GIBaseInfo *)tinfo); if (in_pos >= n_in_args) { g_set_error (error, - G_INVOKE_ERROR, - G_INVOKE_ERROR_ARGUMENT_MISMATCH, + GI_INVOKE_ERROR, + GI_INVOKE_ERROR_ARGUMENT_MISMATCH, "Too few \"in\" arguments (handling in)"); goto out; } @@ -686,13 +686,13 @@ g_callable_info_invoke (GIFunctionInfo *info, break; case GI_DIRECTION_OUT: atypes[i+offset] = &ffi_type_pointer; - g_base_info_unref ((GIBaseInfo *)ainfo); + gi_base_info_unref ((GIBaseInfo *)ainfo); if (out_pos >= n_out_args) { g_set_error (error, - G_INVOKE_ERROR, - G_INVOKE_ERROR_ARGUMENT_MISMATCH, + GI_INVOKE_ERROR, + GI_INVOKE_ERROR_ARGUMENT_MISMATCH, "Too few \"out\" arguments (handling out)"); goto out; } @@ -702,13 +702,13 @@ g_callable_info_invoke (GIFunctionInfo *info, break; case GI_DIRECTION_INOUT: atypes[i+offset] = &ffi_type_pointer; - g_base_info_unref ((GIBaseInfo *)ainfo); + gi_base_info_unref ((GIBaseInfo *)ainfo); if (in_pos >= n_in_args) { g_set_error (error, - G_INVOKE_ERROR, - G_INVOKE_ERROR_ARGUMENT_MISMATCH, + GI_INVOKE_ERROR, + GI_INVOKE_ERROR_ARGUMENT_MISMATCH, "Too few \"in\" arguments (handling inout)"); goto out; } @@ -716,8 +716,8 @@ g_callable_info_invoke (GIFunctionInfo *info, if (out_pos >= n_out_args) { g_set_error (error, - G_INVOKE_ERROR, - G_INVOKE_ERROR_ARGUMENT_MISMATCH, + GI_INVOKE_ERROR, + GI_INVOKE_ERROR_ARGUMENT_MISMATCH, "Too few \"out\" arguments (handling inout)"); goto out; } @@ -727,7 +727,7 @@ g_callable_info_invoke (GIFunctionInfo *info, out_pos++; break; default: - g_base_info_unref ((GIBaseInfo *)ainfo); + gi_base_info_unref ((GIBaseInfo *)ainfo); g_assert_not_reached (); } } @@ -741,16 +741,16 @@ g_callable_info_invoke (GIFunctionInfo *info, if (in_pos < n_in_args) { g_set_error (error, - G_INVOKE_ERROR, - G_INVOKE_ERROR_ARGUMENT_MISMATCH, + GI_INVOKE_ERROR, + GI_INVOKE_ERROR_ARGUMENT_MISMATCH, "Too many \"in\" arguments (at end)"); goto out; } if (out_pos < n_out_args) { g_set_error (error, - G_INVOKE_ERROR, - G_INVOKE_ERROR_ARGUMENT_MISMATCH, + GI_INVOKE_ERROR, + GI_INVOKE_ERROR_ARGUMENT_MISMATCH, "Too many \"out\" arguments (at end)"); goto out; } @@ -788,6 +788,6 @@ g_callable_info_invoke (GIFunctionInfo *info, success = TRUE; } out: - g_base_info_unref ((GIBaseInfo *)rinfo); + gi_base_info_unref ((GIBaseInfo *)rinfo); return success; } diff --git a/girepository/gicallableinfo.h b/girepository/gicallableinfo.h index 0a1a4999e..960734102 100644 --- a/girepository/gicallableinfo.h +++ b/girepository/gicallableinfo.h @@ -39,69 +39,69 @@ G_BEGIN_DECLS * Checks if @info is a #GICallableInfo or derived from it. */ #define GI_IS_CALLABLE_INFO(info) \ - ((g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_FUNCTION) || \ - (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_CALLBACK) || \ - (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_SIGNAL) || \ - (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_VFUNC)) + ((gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_FUNCTION) || \ + (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_CALLBACK) || \ + (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_SIGNAL) || \ + (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_VFUNC)) GI_AVAILABLE_IN_ALL -gboolean g_callable_info_is_method (GICallableInfo *info); +gboolean gi_callable_info_is_method (GICallableInfo *info); GI_AVAILABLE_IN_ALL -gboolean g_callable_info_can_throw_gerror (GICallableInfo *info); +gboolean gi_callable_info_can_throw_gerror (GICallableInfo *info); GI_AVAILABLE_IN_ALL -GITypeInfo * g_callable_info_get_return_type (GICallableInfo *info); +GITypeInfo * gi_callable_info_get_return_type (GICallableInfo *info); GI_AVAILABLE_IN_ALL -void g_callable_info_load_return_type (GICallableInfo *info, - GITypeInfo *type); +void gi_callable_info_load_return_type (GICallableInfo *info, + GITypeInfo *type); GI_AVAILABLE_IN_ALL -const gchar * g_callable_info_get_return_attribute (GICallableInfo *info, - const gchar *name); +const gchar * gi_callable_info_get_return_attribute (GICallableInfo *info, + const gchar *name); GI_AVAILABLE_IN_ALL -gboolean g_callable_info_iterate_return_attributes (GICallableInfo *info, - GIAttributeIter *iterator, - char **name, - char **value); +gboolean gi_callable_info_iterate_return_attributes (GICallableInfo *info, + GIAttributeIter *iterator, + char **name, + char **value); GI_AVAILABLE_IN_ALL -GITransfer g_callable_info_get_caller_owns (GICallableInfo *info); +GITransfer gi_callable_info_get_caller_owns (GICallableInfo *info); GI_AVAILABLE_IN_ALL -gboolean g_callable_info_may_return_null (GICallableInfo *info); +gboolean gi_callable_info_may_return_null (GICallableInfo *info); GI_AVAILABLE_IN_ALL -gboolean g_callable_info_skip_return (GICallableInfo *info); +gboolean gi_callable_info_skip_return (GICallableInfo *info); GI_AVAILABLE_IN_ALL -gint g_callable_info_get_n_args (GICallableInfo *info); +gint gi_callable_info_get_n_args (GICallableInfo *info); GI_AVAILABLE_IN_ALL -GIArgInfo * g_callable_info_get_arg (GICallableInfo *info, - gint n); +GIArgInfo * gi_callable_info_get_arg (GICallableInfo *info, + gint n); GI_AVAILABLE_IN_ALL -void g_callable_info_load_arg (GICallableInfo *info, - gint n, - GIArgInfo *arg); +void gi_callable_info_load_arg (GICallableInfo *info, + gint n, + GIArgInfo *arg); GI_AVAILABLE_IN_ALL -gboolean g_callable_info_invoke (GICallableInfo *info, - gpointer function, - const GIArgument *in_args, - int n_in_args, - const GIArgument *out_args, - int n_out_args, - GIArgument *return_value, - gboolean is_method, - gboolean throws, - GError **error); +gboolean gi_callable_info_invoke (GICallableInfo *info, + gpointer function, + const GIArgument *in_args, + int n_in_args, + const GIArgument *out_args, + int n_out_args, + GIArgument *return_value, + gboolean is_method, + gboolean throws, + GError **error); GI_AVAILABLE_IN_ALL -GITransfer g_callable_info_get_instance_ownership_transfer (GICallableInfo *info); +GITransfer gi_callable_info_get_instance_ownership_transfer (GICallableInfo *info); G_END_DECLS diff --git a/girepository/giconstantinfo.c b/girepository/giconstantinfo.c index 8025d93fd..62b0dccab 100644 --- a/girepository/giconstantinfo.c +++ b/girepository/giconstantinfo.c @@ -40,46 +40,46 @@ * GIConstantInfo represents a constant. * * A constant has a type associated which can be obtained by calling - * g_constant_info_get_type() and a value, which can be obtained by - * calling g_constant_info_get_value(). + * gi_constant_info_get_type() and a value, which can be obtained by + * calling gi_constant_info_get_value(). */ /** - * g_constant_info_get_type: + * gi_constant_info_get_type: * @info: a #GIConstantInfo * * Obtain the type of the constant as a #GITypeInfo. * * Returns: (transfer full): the #GITypeInfo. Free the struct by calling - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GITypeInfo * -g_constant_info_get_type (GIConstantInfo *info) +gi_constant_info_get_type (GIConstantInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; g_return_val_if_fail (info != NULL, NULL); g_return_val_if_fail (GI_IS_CONSTANT_INFO (info), NULL); - return _g_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + 8); + return _gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + 8); } #define DO_ALIGNED_COPY(dest_addr, src_addr, type) \ memcpy((dest_addr), (src_addr), sizeof(type)) /** - * g_constant_info_free_value: (skip) + * gi_constant_info_free_value: (skip) * @info: a #GIConstantInfo * @value: the argument * - * Free the value returned from g_constant_info_get_value(). + * Free the value returned from gi_constant_info_get_value(). * * Since: 1.32 */ void -g_constant_info_free_value (GIConstantInfo *info, - GIArgument *value) +gi_constant_info_free_value (GIConstantInfo *info, + GIArgument *value) { GIRealInfo *rinfo = (GIRealInfo *)info; ConstantBlob *blob; @@ -98,20 +98,20 @@ g_constant_info_free_value (GIConstantInfo *info, } /** - * g_constant_info_get_value: (skip) + * gi_constant_info_get_value: (skip) * @info: a #GIConstantInfo * @value: (out): an argument * * Obtain the value associated with the #GIConstantInfo and store it in the * @value parameter. @argument needs to be allocated before passing it in. * The size of the constant value stored in @argument will be returned. - * Free the value with g_constant_info_free_value(). + * Free the value with gi_constant_info_free_value(). * * Returns: size of the constant */ gint -g_constant_info_get_value (GIConstantInfo *info, - GIArgument *value) +gi_constant_info_get_value (GIConstantInfo *info, + GIArgument *value) { GIRealInfo *rinfo = (GIRealInfo *)info; ConstantBlob *blob; diff --git a/girepository/giconstantinfo.h b/girepository/giconstantinfo.h index 7a0cfb12b..175e78e2e 100644 --- a/girepository/giconstantinfo.h +++ b/girepository/giconstantinfo.h @@ -39,17 +39,17 @@ G_BEGIN_DECLS * Checks if @info is a #GIConstantInfo. */ #define GI_IS_CONSTANT_INFO(info) \ - (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_CONSTANT) + (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_CONSTANT) GI_AVAILABLE_IN_ALL -GITypeInfo * g_constant_info_get_type (GIConstantInfo *info); +GITypeInfo * gi_constant_info_get_type (GIConstantInfo *info); GI_AVAILABLE_IN_ALL -void g_constant_info_free_value(GIConstantInfo *info, - GIArgument *value); +void gi_constant_info_free_value (GIConstantInfo *info, + GIArgument *value); GI_AVAILABLE_IN_ALL -gint g_constant_info_get_value(GIConstantInfo *info, - GIArgument *value); +gint gi_constant_info_get_value (GIConstantInfo *info, + GIArgument *value); G_END_DECLS diff --git a/girepository/gienuminfo.c b/girepository/gienuminfo.c index d7b4ef7f3..e03aff3cd 100644 --- a/girepository/gienuminfo.c +++ b/girepository/gienuminfo.c @@ -41,12 +41,12 @@ * * The GIEnumInfo contains a set of values and a type. * - * The GIValueInfo is fetched by calling g_enum_info_get_value() on + * The GIValueInfo is fetched by calling gi_enum_info_get_value() on * a GIEnumInfo. */ /** - * g_enum_info_get_n_values: + * gi_enum_info_get_n_values: * @info: a #GIEnumInfo * * Obtain the number of values this enumeration contains. @@ -54,7 +54,7 @@ * Returns: the number of enumeration values */ gint -g_enum_info_get_n_values (GIEnumInfo *info) +gi_enum_info_get_n_values (GIEnumInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; EnumBlob *blob; @@ -68,7 +68,7 @@ g_enum_info_get_n_values (GIEnumInfo *info) } /** - * g_enum_info_get_error_domain: + * gi_enum_info_get_error_domain: * @info: a #GIEnumInfo * * Obtain the string form of the quark for the error domain associated with @@ -79,7 +79,7 @@ g_enum_info_get_n_values (GIEnumInfo *info) * Since: 1.30 */ const gchar * -g_enum_info_get_error_domain (GIEnumInfo *info) +gi_enum_info_get_error_domain (GIEnumInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; EnumBlob *blob; @@ -90,23 +90,23 @@ g_enum_info_get_error_domain (GIEnumInfo *info) blob = (EnumBlob *)&rinfo->typelib->data[rinfo->offset]; if (blob->error_domain) - return g_typelib_get_string (rinfo->typelib, blob->error_domain); + return gi_typelib_get_string (rinfo->typelib, blob->error_domain); else return NULL; } /** - * g_enum_info_get_value: + * gi_enum_info_get_value: * @info: a #GIEnumInfo * @n: index of value to fetch * * Obtain a value for this enumeration. * * Returns: (transfer full): the enumeration value or %NULL if type tag is wrong, - * free the struct with g_base_info_unref() when done. + * free the struct with gi_base_info_unref() when done. */ GIValueInfo * -g_enum_info_get_value (GIEnumInfo *info, +gi_enum_info_get_value (GIEnumInfo *info, gint n) { GIRealInfo *rinfo = (GIRealInfo *)info; @@ -120,11 +120,11 @@ g_enum_info_get_value (GIEnumInfo *info, offset = rinfo->offset + header->enum_blob_size + n * header->value_blob_size; - return (GIValueInfo *) g_info_new (GI_INFO_TYPE_VALUE, (GIBaseInfo*)info, rinfo->typelib, offset); + return (GIValueInfo *) gi_info_new (GI_INFO_TYPE_VALUE, (GIBaseInfo*)info, rinfo->typelib, offset); } /** - * g_enum_info_get_n_methods: + * gi_enum_info_get_n_methods: * @info: a #GIEnumInfo * * Obtain the number of methods that this enum type has. @@ -133,7 +133,7 @@ g_enum_info_get_value (GIEnumInfo *info, * Since: 1.30 */ gint -g_enum_info_get_n_methods (GIEnumInfo *info) +gi_enum_info_get_n_methods (GIEnumInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; EnumBlob *blob; @@ -147,19 +147,19 @@ g_enum_info_get_n_methods (GIEnumInfo *info) } /** - * g_enum_info_get_method: + * gi_enum_info_get_method: * @info: a #GIEnumInfo * @n: index of method to get * * Obtain an enum type method at index @n. * * Returns: (transfer full): the #GIFunctionInfo. Free the struct by calling - * g_base_info_unref() when done. + * gi_base_info_unref() when done. * Since: 1.30 */ GIFunctionInfo * -g_enum_info_get_method (GIEnumInfo *info, - gint n) +gi_enum_info_get_method (GIEnumInfo *info, + gint n) { gint offset; GIRealInfo *rinfo = (GIRealInfo *)info; @@ -176,12 +176,12 @@ g_enum_info_get_method (GIEnumInfo *info, + blob->n_values * header->value_blob_size + n * header->function_blob_size; - return (GIFunctionInfo *) g_info_new (GI_INFO_TYPE_FUNCTION, (GIBaseInfo*)info, - rinfo->typelib, offset); + return (GIFunctionInfo *) gi_info_new (GI_INFO_TYPE_FUNCTION, (GIBaseInfo*)info, + rinfo->typelib, offset); } /** - * g_enum_info_get_storage_type: + * gi_enum_info_get_storage_type: * @info: a #GIEnumInfo * * Obtain the tag of the type used for the enum in the C ABI. This will @@ -194,7 +194,7 @@ g_enum_info_get_method (GIEnumInfo *info, * Returns: the storage type for the enumeration */ GITypeTag -g_enum_info_get_storage_type (GIEnumInfo *info) +gi_enum_info_get_storage_type (GIEnumInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; EnumBlob *blob; @@ -208,7 +208,7 @@ g_enum_info_get_storage_type (GIEnumInfo *info) } /** - * g_value_info_get_value: + * gi_value_info_get_value: * @info: a #GIValueInfo * * Obtain the enumeration value of the #GIValueInfo. @@ -218,7 +218,7 @@ g_enum_info_get_storage_type (GIEnumInfo *info) * return type is to allow both. */ gint64 -g_value_info_get_value (GIValueInfo *info) +gi_value_info_get_value (GIValueInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; ValueBlob *blob; diff --git a/girepository/gienuminfo.h b/girepository/gienuminfo.h index fd8a11b82..a76d75bb1 100644 --- a/girepository/gienuminfo.h +++ b/girepository/gienuminfo.h @@ -39,8 +39,8 @@ G_BEGIN_DECLS * Checks if @info is a #GIEnumInfo. */ #define GI_IS_ENUM_INFO(info) \ - ((g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_ENUM) || \ - (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_FLAGS)) + ((gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_ENUM) || \ + (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_FLAGS)) /** * GI_IS_VALUE_INFO @@ -49,31 +49,31 @@ G_BEGIN_DECLS * Checks if @info is a #GIValueInfo. */ #define GI_IS_VALUE_INFO(info) \ - (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_VALUE) + (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_VALUE) GI_AVAILABLE_IN_ALL -gint g_enum_info_get_n_values (GIEnumInfo *info); +gint gi_enum_info_get_n_values (GIEnumInfo *info); GI_AVAILABLE_IN_ALL -GIValueInfo * g_enum_info_get_value (GIEnumInfo *info, - gint n); +GIValueInfo * gi_enum_info_get_value (GIEnumInfo *info, + gint n); GI_AVAILABLE_IN_ALL -gint g_enum_info_get_n_methods (GIEnumInfo *info); +gint gi_enum_info_get_n_methods (GIEnumInfo *info); GI_AVAILABLE_IN_ALL -GIFunctionInfo * g_enum_info_get_method (GIEnumInfo *info, - gint n); +GIFunctionInfo * gi_enum_info_get_method (GIEnumInfo *info, + gint n); GI_AVAILABLE_IN_ALL -GITypeTag g_enum_info_get_storage_type (GIEnumInfo *info); +GITypeTag gi_enum_info_get_storage_type (GIEnumInfo *info); GI_AVAILABLE_IN_ALL -const gchar * g_enum_info_get_error_domain (GIEnumInfo *info); +const gchar * gi_enum_info_get_error_domain (GIEnumInfo *info); GI_AVAILABLE_IN_ALL -gint64 g_value_info_get_value (GIValueInfo *info); +gint64 gi_value_info_get_value (GIValueInfo *info); G_END_DECLS diff --git a/girepository/gifieldinfo.c b/girepository/gifieldinfo.c index c61c62478..c10f034ed 100644 --- a/girepository/gifieldinfo.c +++ b/girepository/gifieldinfo.c @@ -39,8 +39,8 @@ * * A GIFieldInfo struct represents a field of a struct, union, or object. * - * The GIFieldInfo is fetched by calling g_struct_info_get_field(), - * g_union_info_get_field() or g_object_info_get_field(). + * The GIFieldInfo is fetched by calling gi_struct_info_get_field(), + * gi_union_info_get_field() or gi_object_info_get_field(). * * A field has a size, type and a struct offset asssociated and a set of flags, * which are currently #GI_FIELD_IS_READABLE or #GI_FIELD_IS_WRITABLE. @@ -49,7 +49,7 @@ */ /** - * g_field_info_get_flags: + * gi_field_info_get_flags: * @info: a #GIFieldInfo * * Obtain the flags for this #GIFieldInfo. See #GIFieldInfoFlags for possible @@ -58,7 +58,7 @@ * Returns: the flags */ GIFieldInfoFlags -g_field_info_get_flags (GIFieldInfo *info) +gi_field_info_get_flags (GIFieldInfo *info) { GIFieldInfoFlags flags; GIRealInfo *rinfo = (GIRealInfo *)info; @@ -81,7 +81,7 @@ g_field_info_get_flags (GIFieldInfo *info) } /** - * g_field_info_get_size: + * gi_field_info_get_size: * @info: a #GIFieldInfo * * Obtain the size in bits of the field member, this is how @@ -90,7 +90,7 @@ g_field_info_get_flags (GIFieldInfo *info) * Returns: the field size */ gint -g_field_info_get_size (GIFieldInfo *info) +gi_field_info_get_size (GIFieldInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; FieldBlob *blob; @@ -104,7 +104,7 @@ g_field_info_get_size (GIFieldInfo *info) } /** - * g_field_info_get_offset: + * gi_field_info_get_offset: * @info: a #GIFieldInfo * * Obtain the offset in bytes of the field member, this is relative @@ -113,7 +113,7 @@ g_field_info_get_size (GIFieldInfo *info) * Returns: the field offset */ gint -g_field_info_get_offset (GIFieldInfo *info) +gi_field_info_get_offset (GIFieldInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; FieldBlob *blob; @@ -127,16 +127,16 @@ g_field_info_get_offset (GIFieldInfo *info) } /** - * g_field_info_get_type: + * gi_field_info_get_type: * @info: a #GIFieldInfo * * Obtain the type of a field as a #GITypeInfo. * * Returns: (transfer full): the #GITypeInfo. Free the struct by calling - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GITypeInfo * -g_field_info_get_type (GIFieldInfo *info) +gi_field_info_get_type (GIFieldInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; Header *header = (Header *)rinfo->typelib->data; @@ -150,19 +150,19 @@ g_field_info_get_type (GIFieldInfo *info) if (blob->has_embedded_type) { - type_info = (GIRealInfo *) g_info_new (GI_INFO_TYPE_TYPE, - (GIBaseInfo*)info, rinfo->typelib, - rinfo->offset + header->field_blob_size); + type_info = (GIRealInfo *) gi_info_new (GI_INFO_TYPE_TYPE, + (GIBaseInfo*)info, rinfo->typelib, + rinfo->offset + header->field_blob_size); type_info->type_is_embedded = TRUE; } else - return _g_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + G_STRUCT_OFFSET (FieldBlob, type)); + return _gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + G_STRUCT_OFFSET (FieldBlob, type)); return (GIBaseInfo*)type_info; } /** - * g_field_info_get_field: (skip) + * gi_field_info_get_field: (skip) * @field_info: a #GIFieldInfo * @mem: pointer to a block of memory representing a C structure or union * @value: a #GIArgument into which to store the value retrieved @@ -175,9 +175,9 @@ g_field_info_get_type (GIFieldInfo *info) * Returns: %TRUE if reading the field succeeded, otherwise %FALSE */ gboolean -g_field_info_get_field (GIFieldInfo *field_info, - gpointer mem, - GIArgument *value) +gi_field_info_get_field (GIFieldInfo *field_info, + gpointer mem, + GIArgument *value) { int offset; GITypeInfo *type_info; @@ -186,24 +186,24 @@ g_field_info_get_field (GIFieldInfo *field_info, g_return_val_if_fail (field_info != NULL, FALSE); g_return_val_if_fail (GI_IS_FIELD_INFO (field_info), FALSE); - if ((g_field_info_get_flags (field_info) & GI_FIELD_IS_READABLE) == 0) + if ((gi_field_info_get_flags (field_info) & GI_FIELD_IS_READABLE) == 0) return FALSE; - offset = g_field_info_get_offset (field_info); - type_info = g_field_info_get_type (field_info); + offset = gi_field_info_get_offset (field_info); + type_info = gi_field_info_get_type (field_info); - if (g_type_info_is_pointer (type_info)) + if (gi_type_info_is_pointer (type_info)) { value->v_pointer = G_STRUCT_MEMBER (gpointer, mem, offset); result = TRUE; } else { - switch (g_type_info_get_tag (type_info)) + switch (gi_type_info_get_tag (type_info)) { case GI_TYPE_TAG_VOID: g_warning("Field %s: should not be have void type", - g_base_info_get_name ((GIBaseInfo *)field_info)); + gi_base_info_get_name ((GIBaseInfo *)field_info)); break; case GI_TYPE_TAG_BOOLEAN: value->v_boolean = G_STRUCT_MEMBER (gboolean, mem, offset) != FALSE; @@ -254,16 +254,16 @@ g_field_info_get_field (GIFieldInfo *field_info, case GI_TYPE_TAG_GSLIST: case GI_TYPE_TAG_GHASH: g_warning("Field %s: type %s should have is_pointer set", - g_base_info_get_name ((GIBaseInfo *)field_info), - g_type_tag_to_string (g_type_info_get_tag (type_info))); + gi_base_info_get_name ((GIBaseInfo *)field_info), + gi_type_tag_to_string (gi_type_info_get_tag (type_info))); break; case GI_TYPE_TAG_ERROR: /* Needs to be handled by the language binding directly */ break; case GI_TYPE_TAG_INTERFACE: { - GIBaseInfo *interface = g_type_info_get_interface (type_info); - switch (g_base_info_get_type (interface)) + GIBaseInfo *interface = gi_type_info_get_interface (type_info); + switch (gi_base_info_get_type (interface)) { case GI_INFO_TYPE_STRUCT: case GI_INFO_TYPE_UNION: @@ -276,13 +276,13 @@ g_field_info_get_field (GIFieldInfo *field_info, case GI_INFO_TYPE_FLAGS: { /* FIXME: there's a mismatch here between the value->v_int we use - * here and the gint64 result returned from g_value_info_get_value(). - * But to switch this to gint64, we'd have to make g_function_info_invoke() + * here and the gint64 result returned from gi_value_info_get_value(). + * But to switch this to gint64, we'd have to make gi_function_info_invoke() * translate value->v_int64 to the proper ABI for an enum function * call parameter, which will usually be int, and then fix up language * bindings. */ - GITypeTag storage_type = g_enum_info_get_storage_type ((GIEnumInfo *)interface); + GITypeTag storage_type = gi_enum_info_get_storage_type ((GIEnumInfo *)interface); switch (storage_type) { case GI_TYPE_TAG_INT8: @@ -307,8 +307,8 @@ g_field_info_get_field (GIFieldInfo *field_info, break; default: g_warning("Field %s: Unexpected enum storage type %s", - g_base_info_get_name ((GIBaseInfo *)field_info), - g_type_tag_to_string (storage_type)); + gi_base_info_get_name ((GIBaseInfo *)field_info), + gi_type_tag_to_string (storage_type)); break; } break; @@ -316,8 +316,8 @@ g_field_info_get_field (GIFieldInfo *field_info, case GI_INFO_TYPE_VFUNC: case GI_INFO_TYPE_CALLBACK: g_warning("Field %s: Interface type %d should have is_pointer set", - g_base_info_get_name ((GIBaseInfo *)field_info), - g_base_info_get_type (interface)); + gi_base_info_get_name ((GIBaseInfo *)field_info), + gi_base_info_get_type (interface)); break; case GI_INFO_TYPE_INVALID: case GI_INFO_TYPE_INTERFACE: @@ -332,14 +332,14 @@ g_field_info_get_field (GIFieldInfo *field_info, case GI_INFO_TYPE_TYPE: case GI_INFO_TYPE_UNRESOLVED: g_warning("Field %s: Interface type %d not expected", - g_base_info_get_name ((GIBaseInfo *)field_info), - g_base_info_get_type (interface)); + gi_base_info_get_name ((GIBaseInfo *)field_info), + gi_base_info_get_type (interface)); break; default: break; } - g_base_info_unref ((GIBaseInfo *)interface); + gi_base_info_unref ((GIBaseInfo *)interface); break; } break; @@ -348,13 +348,13 @@ g_field_info_get_field (GIFieldInfo *field_info, } } - g_base_info_unref ((GIBaseInfo *)type_info); + gi_base_info_unref ((GIBaseInfo *)type_info); return result; } /** - * g_field_info_set_field: (skip) + * gi_field_info_set_field: (skip) * @field_info: a #GIFieldInfo * @mem: pointer to a block of memory representing a C structure or union * @value: a #GIArgument holding the value to store @@ -369,9 +369,9 @@ g_field_info_get_field (GIFieldInfo *field_info, * Returns: %TRUE if writing the field succeeded, otherwise %FALSE */ gboolean -g_field_info_set_field (GIFieldInfo *field_info, - gpointer mem, - const GIArgument *value) +gi_field_info_set_field (GIFieldInfo *field_info, + gpointer mem, + const GIArgument *value) { int offset; GITypeInfo *type_info; @@ -380,19 +380,19 @@ g_field_info_set_field (GIFieldInfo *field_info, g_return_val_if_fail (field_info != NULL, FALSE); g_return_val_if_fail (GI_IS_FIELD_INFO (field_info), FALSE); - if ((g_field_info_get_flags (field_info) & GI_FIELD_IS_WRITABLE) == 0) + if ((gi_field_info_get_flags (field_info) & GI_FIELD_IS_WRITABLE) == 0) return FALSE; - offset = g_field_info_get_offset (field_info); - type_info = g_field_info_get_type (field_info); + offset = gi_field_info_get_offset (field_info); + type_info = gi_field_info_get_type (field_info); - if (!g_type_info_is_pointer (type_info)) + if (!gi_type_info_is_pointer (type_info)) { - switch (g_type_info_get_tag (type_info)) + switch (gi_type_info_get_tag (type_info)) { case GI_TYPE_TAG_VOID: g_warning("Field %s: should not be have void type", - g_base_info_get_name ((GIBaseInfo *)field_info)); + gi_base_info_get_name ((GIBaseInfo *)field_info)); break; case GI_TYPE_TAG_BOOLEAN: G_STRUCT_MEMBER (gboolean, mem, offset) = value->v_boolean != FALSE; @@ -438,16 +438,16 @@ g_field_info_set_field (GIFieldInfo *field_info, case GI_TYPE_TAG_GSLIST: case GI_TYPE_TAG_GHASH: g_warning("Field %s: type %s should have is_pointer set", - g_base_info_get_name ((GIBaseInfo *)field_info), - g_type_tag_to_string (g_type_info_get_tag (type_info))); + gi_base_info_get_name ((GIBaseInfo *)field_info), + gi_type_tag_to_string (gi_type_info_get_tag (type_info))); break; case GI_TYPE_TAG_ERROR: /* Needs to be handled by the language binding directly */ break; case GI_TYPE_TAG_INTERFACE: { - GIBaseInfo *interface = g_type_info_get_interface (type_info); - switch (g_base_info_get_type (interface)) + GIBaseInfo *interface = gi_type_info_get_interface (type_info); + switch (gi_base_info_get_type (interface)) { case GI_INFO_TYPE_STRUCT: case GI_INFO_TYPE_UNION: @@ -461,7 +461,7 @@ g_field_info_set_field (GIFieldInfo *field_info, { /* See FIXME above */ - GITypeTag storage_type = g_enum_info_get_storage_type ((GIEnumInfo *)interface); + GITypeTag storage_type = gi_enum_info_get_storage_type ((GIEnumInfo *)interface); switch (storage_type) { case GI_TYPE_TAG_INT8: @@ -486,8 +486,8 @@ g_field_info_set_field (GIFieldInfo *field_info, break; default: g_warning("Field %s: Unexpected enum storage type %s", - g_base_info_get_name ((GIBaseInfo *)field_info), - g_type_tag_to_string (storage_type)); + gi_base_info_get_name ((GIBaseInfo *)field_info), + gi_type_tag_to_string (storage_type)); break; } break; @@ -496,8 +496,8 @@ g_field_info_set_field (GIFieldInfo *field_info, case GI_INFO_TYPE_VFUNC: case GI_INFO_TYPE_CALLBACK: g_warning("Field%s: Interface type %d should have is_pointer set", - g_base_info_get_name ((GIBaseInfo *)field_info), - g_base_info_get_type (interface)); + gi_base_info_get_name ((GIBaseInfo *)field_info), + gi_base_info_get_type (interface)); break; case GI_INFO_TYPE_INVALID: case GI_INFO_TYPE_INTERFACE: @@ -512,14 +512,14 @@ g_field_info_set_field (GIFieldInfo *field_info, case GI_INFO_TYPE_TYPE: case GI_INFO_TYPE_UNRESOLVED: g_warning("Field %s: Interface type %d not expected", - g_base_info_get_name ((GIBaseInfo *)field_info), - g_base_info_get_type (interface)); + gi_base_info_get_name ((GIBaseInfo *)field_info), + gi_base_info_get_type (interface)); break; default: break; } - g_base_info_unref ((GIBaseInfo *)interface); + gi_base_info_unref ((GIBaseInfo *)interface); break; } break; @@ -527,12 +527,12 @@ g_field_info_set_field (GIFieldInfo *field_info, break; } } else { - switch (g_type_info_get_tag (type_info)) + switch (gi_type_info_get_tag (type_info)) { case GI_TYPE_TAG_INTERFACE: { - GIBaseInfo *interface = g_type_info_get_interface (type_info); - switch (g_base_info_get_type (interface)) + GIBaseInfo *interface = gi_type_info_get_interface (type_info); + switch (gi_base_info_get_type (interface)) { case GI_INFO_TYPE_OBJECT: case GI_INFO_TYPE_INTERFACE: @@ -542,7 +542,7 @@ g_field_info_set_field (GIFieldInfo *field_info, default: break; } - g_base_info_unref ((GIBaseInfo *)interface); + gi_base_info_unref ((GIBaseInfo *)interface); } break; default: @@ -550,7 +550,7 @@ g_field_info_set_field (GIFieldInfo *field_info, } } - g_base_info_unref ((GIBaseInfo *)type_info); + gi_base_info_unref ((GIBaseInfo *)type_info); return result; } diff --git a/girepository/gifieldinfo.h b/girepository/gifieldinfo.h index 83a901d28..00ef1d06c 100644 --- a/girepository/gifieldinfo.h +++ b/girepository/gifieldinfo.h @@ -40,29 +40,29 @@ G_BEGIN_DECLS * */ #define GI_IS_FIELD_INFO(info) \ - (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_FIELD) + (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_FIELD) GI_AVAILABLE_IN_ALL -GIFieldInfoFlags g_field_info_get_flags (GIFieldInfo *info); +GIFieldInfoFlags gi_field_info_get_flags (GIFieldInfo *info); GI_AVAILABLE_IN_ALL -gint g_field_info_get_size (GIFieldInfo *info); +gint gi_field_info_get_size (GIFieldInfo *info); GI_AVAILABLE_IN_ALL -gint g_field_info_get_offset (GIFieldInfo *info); +gint gi_field_info_get_offset (GIFieldInfo *info); GI_AVAILABLE_IN_ALL -GITypeInfo * g_field_info_get_type (GIFieldInfo *info); +GITypeInfo * gi_field_info_get_type (GIFieldInfo *info); GI_AVAILABLE_IN_ALL -gboolean g_field_info_get_field (GIFieldInfo *field_info, - gpointer mem, - GIArgument *value); +gboolean gi_field_info_get_field (GIFieldInfo *field_info, + gpointer mem, + GIArgument *value); GI_AVAILABLE_IN_ALL -gboolean g_field_info_set_field (GIFieldInfo *field_info, - gpointer mem, - const GIArgument *value); +gboolean gi_field_info_set_field (GIFieldInfo *field_info, + gpointer mem, + const GIArgument *value); G_END_DECLS diff --git a/girepository/gifunctioninfo.c b/girepository/gifunctioninfo.c index d9ef7931d..83c9ab5dc 100644 --- a/girepository/gifunctioninfo.c +++ b/girepository/gifunctioninfo.c @@ -41,17 +41,17 @@ * GIFunctionInfo represents a function, method or constructor. * * To find out what kind of entity a #GIFunctionInfo represents, call - * g_function_info_get_flags(). + * gi_function_info_get_flags(). * * See also #GICallableInfo for information on how to retreive arguments and * other metadata. */ GIFunctionInfo * -_g_base_info_find_method (GIBaseInfo *base, - guint32 offset, - gint n_methods, - const gchar *name) +_gi_base_info_find_method (GIBaseInfo *base, + guint32 offset, + gint n_methods, + const gchar *name) { /* FIXME hash */ GIRealInfo *rinfo = (GIRealInfo*)base; @@ -64,8 +64,8 @@ _g_base_info_find_method (GIBaseInfo *base, const gchar *fname = (const gchar *)&rinfo->typelib->data[fblob->name]; if (strcmp (name, fname) == 0) - return (GIFunctionInfo *) g_info_new (GI_INFO_TYPE_FUNCTION, base, - rinfo->typelib, offset); + return (GIFunctionInfo *) gi_info_new (GI_INFO_TYPE_FUNCTION, base, + rinfo->typelib, offset); offset += header->function_blob_size; } @@ -74,7 +74,7 @@ _g_base_info_find_method (GIBaseInfo *base, } /** - * g_function_info_get_symbol: + * gi_function_info_get_symbol: * @info: a #GIFunctionInfo * * Obtain the symbol of the function. The symbol is the name of the @@ -84,7 +84,7 @@ _g_base_info_find_method (GIBaseInfo *base, * Returns: the symbol */ const gchar * -g_function_info_get_symbol (GIFunctionInfo *info) +gi_function_info_get_symbol (GIFunctionInfo *info) { GIRealInfo *rinfo; FunctionBlob *blob; @@ -95,11 +95,11 @@ g_function_info_get_symbol (GIFunctionInfo *info) rinfo = (GIRealInfo *)info; blob = (FunctionBlob *)&rinfo->typelib->data[rinfo->offset]; - return g_typelib_get_string (rinfo->typelib, blob->symbol); + return gi_typelib_get_string (rinfo->typelib, blob->symbol); } /** - * g_function_info_get_flags: + * gi_function_info_get_flags: * @info: a #GIFunctionInfo * * Obtain the #GIFunctionInfoFlags for the @info. @@ -107,7 +107,7 @@ g_function_info_get_symbol (GIFunctionInfo *info) * Returns: the flags */ GIFunctionInfoFlags -g_function_info_get_flags (GIFunctionInfo *info) +gi_function_info_get_flags (GIFunctionInfo *info) { GIFunctionInfoFlags flags; GIRealInfo *rinfo; @@ -144,7 +144,7 @@ g_function_info_get_flags (GIFunctionInfo *info) } /** - * g_function_info_get_property: + * gi_function_info_get_property: * @info: a #GIFunctionInfo * * Obtain the property associated with this #GIFunctionInfo. @@ -153,10 +153,10 @@ g_function_info_get_flags (GIFunctionInfo *info) * %NULL will be returned. * * Returns: (transfer full): the property or %NULL if not set. Free it with - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GIPropertyInfo * -g_function_info_get_property (GIFunctionInfo *info) +gi_function_info_get_property (GIFunctionInfo *info) { GIRealInfo *rinfo, *container_rinfo; FunctionBlob *blob; @@ -172,20 +172,20 @@ g_function_info_get_property (GIFunctionInfo *info) { GIInterfaceInfo *container = (GIInterfaceInfo *)rinfo->container; - return g_interface_info_get_property (container, blob->index); + return gi_interface_info_get_property (container, blob->index); } else if (container_rinfo->type == GI_INFO_TYPE_OBJECT) { GIObjectInfo *container = (GIObjectInfo *)rinfo->container; - return g_object_info_get_property (container, blob->index); + return gi_object_info_get_property (container, blob->index); } else return NULL; } /** - * g_function_info_get_vfunc: + * gi_function_info_get_vfunc: * @info: a #GIFunctionInfo * * Obtain the virtual function associated with this #GIFunctionInfo. @@ -193,10 +193,10 @@ g_function_info_get_property (GIFunctionInfo *info) * a virtual function set. For other cases, %NULL will be returned. * * Returns: (transfer full): the virtual function or %NULL if not set. - * Free it by calling g_base_info_unref() when done. + * Free it by calling gi_base_info_unref() when done. */ GIVFuncInfo * -g_function_info_get_vfunc (GIFunctionInfo *info) +gi_function_info_get_vfunc (GIFunctionInfo *info) { GIRealInfo *rinfo; FunctionBlob *blob; @@ -209,27 +209,27 @@ g_function_info_get_vfunc (GIFunctionInfo *info) blob = (FunctionBlob *)&rinfo->typelib->data[rinfo->offset]; container = (GIInterfaceInfo *)rinfo->container; - return g_interface_info_get_vfunc (container, blob->index); + return gi_interface_info_get_vfunc (container, blob->index); } /** - * g_invoke_error_quark: + * gi_invoke_error_quark: * * TODO * * Returns: TODO */ GQuark -g_invoke_error_quark (void) +gi_invoke_error_quark (void) { static GQuark quark = 0; if (quark == 0) - quark = g_quark_from_static_string ("g-invoke-error-quark"); + quark = g_quark_from_static_string ("gi-invoke-error-quark"); return quark; } /** - * g_function_info_invoke: (skip) + * gi_function_info_invoke: (skip) * @info: a #GIFunctionInfo describing the function to invoke * @in_args: (array length=n_in_args): an array of #GIArguments, one for each in * parameter of @info. If there are no in parameter, @in_args @@ -254,44 +254,44 @@ g_invoke_error_quark (void) * error occurred. */ gboolean -g_function_info_invoke (GIFunctionInfo *info, - const GIArgument *in_args, - int n_in_args, - const GIArgument *out_args, - int n_out_args, - GIArgument *return_value, - GError **error) +gi_function_info_invoke (GIFunctionInfo *info, + const GIArgument *in_args, + int n_in_args, + const GIArgument *out_args, + int n_out_args, + GIArgument *return_value, + GError **error) { const gchar *symbol; gpointer func; gboolean is_method; gboolean throws; - symbol = g_function_info_get_symbol (info); + symbol = gi_function_info_get_symbol (info); - if (!g_typelib_symbol (g_base_info_get_typelib((GIBaseInfo *) info), - symbol, &func)) + if (!gi_typelib_symbol (gi_base_info_get_typelib ((GIBaseInfo *) info), + symbol, &func)) { g_set_error (error, - G_INVOKE_ERROR, - G_INVOKE_ERROR_SYMBOL_NOT_FOUND, + GI_INVOKE_ERROR, + GI_INVOKE_ERROR_SYMBOL_NOT_FOUND, "Could not locate %s: %s", symbol, g_module_error ()); return FALSE; } - is_method = (g_function_info_get_flags (info) & GI_FUNCTION_IS_METHOD) != 0 - && (g_function_info_get_flags (info) & GI_FUNCTION_IS_CONSTRUCTOR) == 0; - throws = g_function_info_get_flags (info) & GI_FUNCTION_THROWS; + is_method = (gi_function_info_get_flags (info) & GI_FUNCTION_IS_METHOD) != 0 + && (gi_function_info_get_flags (info) & GI_FUNCTION_IS_CONSTRUCTOR) == 0; + throws = gi_function_info_get_flags (info) & GI_FUNCTION_THROWS; - return g_callable_info_invoke ((GICallableInfo*) info, - func, - in_args, - n_in_args, - out_args, - n_out_args, - return_value, - is_method, - throws, - error); + return gi_callable_info_invoke ((GICallableInfo*) info, + func, + in_args, + n_in_args, + out_args, + n_out_args, + return_value, + is_method, + throws, + error); } diff --git a/girepository/gifunctioninfo.h b/girepository/gifunctioninfo.h index ae5b451da..7c3859d4d 100644 --- a/girepository/gifunctioninfo.h +++ b/girepository/gifunctioninfo.h @@ -39,59 +39,59 @@ G_BEGIN_DECLS * Checks if @info is a #GIFunctionInfo. */ #define GI_IS_FUNCTION_INFO(info) \ - (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_FUNCTION) + (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_FUNCTION) GI_AVAILABLE_IN_ALL -const gchar * g_function_info_get_symbol (GIFunctionInfo *info); +const gchar * gi_function_info_get_symbol (GIFunctionInfo *info); GI_AVAILABLE_IN_ALL -GIFunctionInfoFlags g_function_info_get_flags (GIFunctionInfo *info); +GIFunctionInfoFlags gi_function_info_get_flags (GIFunctionInfo *info); GI_AVAILABLE_IN_ALL -GIPropertyInfo * g_function_info_get_property (GIFunctionInfo *info); +GIPropertyInfo * gi_function_info_get_property (GIFunctionInfo *info); GI_AVAILABLE_IN_ALL -GIVFuncInfo * g_function_info_get_vfunc (GIFunctionInfo *info); +GIVFuncInfo * gi_function_info_get_vfunc (GIFunctionInfo *info); /** - * G_INVOKE_ERROR: + * GI_INVOKE_ERROR: * * TODO */ -#define G_INVOKE_ERROR (g_invoke_error_quark ()) +#define GI_INVOKE_ERROR (gi_invoke_error_quark ()) GI_AVAILABLE_IN_ALL -GQuark g_invoke_error_quark (void); +GQuark gi_invoke_error_quark (void); /** - * GInvokeError: - * @G_INVOKE_ERROR_FAILED: invokation failed, unknown error. - * @G_INVOKE_ERROR_SYMBOL_NOT_FOUND: symbol couldn't be found in any of the - * libraries associated with the typelib of the function. - * @G_INVOKE_ERROR_ARGUMENT_MISMATCH: the arguments provided didn't match - * the expected arguments for the functions type signature. + * GIInvokeError: + * @GI_INVOKE_ERROR_FAILED: invokation failed, unknown error. + * @GI_INVOKE_ERROR_SYMBOL_NOT_FOUND: symbol couldn't be found in any of the + * libraries associated with the typelib of the function. + * @GI_INVOKE_ERROR_ARGUMENT_MISMATCH: the arguments provided didn't match + * the expected arguments for the functions type signature. * * An error occuring while invoking a function via - * g_function_info_invoke(). + * gi_function_info_invoke(). */ typedef enum { - G_INVOKE_ERROR_FAILED, - G_INVOKE_ERROR_SYMBOL_NOT_FOUND, - G_INVOKE_ERROR_ARGUMENT_MISMATCH -} GInvokeError; + GI_INVOKE_ERROR_FAILED, + GI_INVOKE_ERROR_SYMBOL_NOT_FOUND, + GI_INVOKE_ERROR_ARGUMENT_MISMATCH +} GIInvokeError; GI_AVAILABLE_IN_ALL -gboolean g_function_info_invoke (GIFunctionInfo *info, - const GIArgument *in_args, - int n_in_args, - const GIArgument *out_args, - int n_out_args, - GIArgument *return_value, - GError **error); +gboolean gi_function_info_invoke (GIFunctionInfo *info, + const GIArgument *in_args, + int n_in_args, + const GIArgument *out_args, + int n_out_args, + GIArgument *return_value, + GError **error); G_END_DECLS diff --git a/girepository/giinterfaceinfo.c b/girepository/giinterfaceinfo.c index 9e54658fb..40a2cac09 100644 --- a/girepository/giinterfaceinfo.c +++ b/girepository/giinterfaceinfo.c @@ -43,7 +43,7 @@ */ /** - * g_interface_info_get_n_prerequisites: + * gi_interface_info_get_n_prerequisites: * @info: a #GIInterfaceInfo * * Obtain the number of prerequisites for this interface type. @@ -53,7 +53,7 @@ * Returns: number of prerequisites */ gint -g_interface_info_get_n_prerequisites (GIInterfaceInfo *info) +gi_interface_info_get_n_prerequisites (GIInterfaceInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; InterfaceBlob *blob; @@ -67,18 +67,18 @@ g_interface_info_get_n_prerequisites (GIInterfaceInfo *info) } /** - * g_interface_info_get_prerequisite: + * gi_interface_info_get_prerequisite: * @info: a #GIInterfaceInfo * @n: index of prerequisites to get * * Obtain an interface type prerequisites index @n. * * Returns: (transfer full): the prerequisites as a #GIBaseInfo. Free the struct by calling - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GIBaseInfo * -g_interface_info_get_prerequisite (GIInterfaceInfo *info, - gint n) +gi_interface_info_get_prerequisite (GIInterfaceInfo *info, + gint n) { GIRealInfo *rinfo = (GIRealInfo *)info; InterfaceBlob *blob; @@ -88,13 +88,13 @@ g_interface_info_get_prerequisite (GIInterfaceInfo *info, blob = (InterfaceBlob *)&rinfo->typelib->data[rinfo->offset]; - return _g_info_from_entry (rinfo->repository, - rinfo->typelib, blob->prerequisites[n]); + return _gi_info_from_entry (rinfo->repository, + rinfo->typelib, blob->prerequisites[n]); } /** - * g_interface_info_get_n_properties: + * gi_interface_info_get_n_properties: * @info: a #GIInterfaceInfo * * Obtain the number of properties that this interface type has. @@ -102,7 +102,7 @@ g_interface_info_get_prerequisite (GIInterfaceInfo *info, * Returns: number of properties */ gint -g_interface_info_get_n_properties (GIInterfaceInfo *info) +gi_interface_info_get_n_properties (GIInterfaceInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; InterfaceBlob *blob; @@ -116,18 +116,18 @@ g_interface_info_get_n_properties (GIInterfaceInfo *info) } /** - * g_interface_info_get_property: + * gi_interface_info_get_property: * @info: a #GIInterfaceInfo * @n: index of property to get * * Obtain an interface type property at index @n. * * Returns: (transfer full): the #GIPropertyInfo. Free the struct by calling - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GIPropertyInfo * -g_interface_info_get_property (GIInterfaceInfo *info, - gint n) +gi_interface_info_get_property (GIInterfaceInfo *info, + gint n) { gint offset; GIRealInfo *rinfo = (GIRealInfo *)info; @@ -144,12 +144,12 @@ g_interface_info_get_property (GIInterfaceInfo *info, + (blob->n_prerequisites + (blob->n_prerequisites % 2)) * 2 + n * header->property_blob_size; - return (GIPropertyInfo *) g_info_new (GI_INFO_TYPE_PROPERTY, (GIBaseInfo*)info, - rinfo->typelib, offset); + return (GIPropertyInfo *) gi_info_new (GI_INFO_TYPE_PROPERTY, (GIBaseInfo*)info, + rinfo->typelib, offset); } /** - * g_interface_info_get_n_methods: + * gi_interface_info_get_n_methods: * @info: a #GIInterfaceInfo * * Obtain the number of methods that this interface type has. @@ -157,7 +157,7 @@ g_interface_info_get_property (GIInterfaceInfo *info, * Returns: number of methods */ gint -g_interface_info_get_n_methods (GIInterfaceInfo *info) +gi_interface_info_get_n_methods (GIInterfaceInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; InterfaceBlob *blob; @@ -171,18 +171,18 @@ g_interface_info_get_n_methods (GIInterfaceInfo *info) } /** - * g_interface_info_get_method: + * gi_interface_info_get_method: * @info: a #GIInterfaceInfo * @n: index of method to get * * Obtain an interface type method at index @n. * * Returns: (transfer full): the #GIFunctionInfo. Free the struct by calling - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GIFunctionInfo * -g_interface_info_get_method (GIInterfaceInfo *info, - gint n) +gi_interface_info_get_method (GIInterfaceInfo *info, + gint n) { gint offset; GIRealInfo *rinfo = (GIRealInfo *)info; @@ -200,12 +200,12 @@ g_interface_info_get_method (GIInterfaceInfo *info, + blob->n_properties * header->property_blob_size + n * header->function_blob_size; - return (GIFunctionInfo *) g_info_new (GI_INFO_TYPE_FUNCTION, (GIBaseInfo*)info, - rinfo->typelib, offset); + return (GIFunctionInfo *) gi_info_new (GI_INFO_TYPE_FUNCTION, (GIBaseInfo*)info, + rinfo->typelib, offset); } /** - * g_interface_info_find_method: + * gi_interface_info_find_method: * @info: a #GIInterfaceInfo * @name: name of method to obtain * @@ -213,11 +213,11 @@ g_interface_info_get_method (GIInterfaceInfo *info, * returned if there's no method available with that name. * * Returns: (transfer full): the #GIFunctionInfo or %NULL if none found. - * Free the struct by calling g_base_info_unref() when done. + * Free the struct by calling gi_base_info_unref() when done. */ GIFunctionInfo * -g_interface_info_find_method (GIInterfaceInfo *info, - const gchar *name) +gi_interface_info_find_method (GIInterfaceInfo *info, + const gchar *name) { gint offset; GIRealInfo *rinfo = (GIRealInfo *)info; @@ -228,11 +228,11 @@ g_interface_info_find_method (GIInterfaceInfo *info, + (blob->n_prerequisites + (blob->n_prerequisites % 2)) * 2 + blob->n_properties * header->property_blob_size; - return _g_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_methods, name); + return _gi_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_methods, name); } /** - * g_interface_info_get_n_signals: + * gi_interface_info_get_n_signals: * @info: a #GIInterfaceInfo * * Obtain the number of signals that this interface type has. @@ -240,7 +240,7 @@ g_interface_info_find_method (GIInterfaceInfo *info, * Returns: number of signals */ gint -g_interface_info_get_n_signals (GIInterfaceInfo *info) +gi_interface_info_get_n_signals (GIInterfaceInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; InterfaceBlob *blob; @@ -254,18 +254,18 @@ g_interface_info_get_n_signals (GIInterfaceInfo *info) } /** - * g_interface_info_get_signal: + * gi_interface_info_get_signal: * @info: a #GIInterfaceInfo * @n: index of signal to get * * Obtain an interface type signal at index @n. * * Returns: (transfer full): the #GISignalInfo. Free the struct by calling - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GISignalInfo * -g_interface_info_get_signal (GIInterfaceInfo *info, - gint n) +gi_interface_info_get_signal (GIInterfaceInfo *info, + gint n) { gint offset; GIRealInfo *rinfo = (GIRealInfo *)info; @@ -284,12 +284,12 @@ g_interface_info_get_signal (GIInterfaceInfo *info, + blob->n_methods * header->function_blob_size + n * header->signal_blob_size; - return (GISignalInfo *) g_info_new (GI_INFO_TYPE_SIGNAL, (GIBaseInfo*)info, - rinfo->typelib, offset); + return (GISignalInfo *) gi_info_new (GI_INFO_TYPE_SIGNAL, (GIBaseInfo*)info, + rinfo->typelib, offset); } /** - * g_interface_info_find_signal: + * gi_interface_info_find_signal: * @info: a #GIInterfaceInfo * @name: Name of signal * @@ -300,20 +300,20 @@ g_interface_info_get_signal (GIInterfaceInfo *info, * Since: 1.34 */ GISignalInfo * -g_interface_info_find_signal (GIInterfaceInfo *info, - const gchar *name) +gi_interface_info_find_signal (GIInterfaceInfo *info, + const gchar *name) { gint n_signals; gint i; - n_signals = g_interface_info_get_n_signals (info); + n_signals = gi_interface_info_get_n_signals (info); for (i = 0; i < n_signals; i++) { - GISignalInfo *siginfo = g_interface_info_get_signal (info, i); + GISignalInfo *siginfo = gi_interface_info_get_signal (info, i); - if (g_strcmp0 (g_base_info_get_name (siginfo), name) != 0) + if (g_strcmp0 (gi_base_info_get_name (siginfo), name) != 0) { - g_base_info_unref ((GIBaseInfo*)siginfo); + gi_base_info_unref ((GIBaseInfo*)siginfo); continue; } @@ -323,7 +323,7 @@ g_interface_info_find_signal (GIInterfaceInfo *info, } /** - * g_interface_info_get_n_vfuncs: + * gi_interface_info_get_n_vfuncs: * @info: a #GIInterfaceInfo * * Obtain the number of virtual functions that this interface type has. @@ -331,7 +331,7 @@ g_interface_info_find_signal (GIInterfaceInfo *info, * Returns: number of virtual functions */ gint -g_interface_info_get_n_vfuncs (GIInterfaceInfo *info) +gi_interface_info_get_n_vfuncs (GIInterfaceInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; InterfaceBlob *blob; @@ -345,18 +345,18 @@ g_interface_info_get_n_vfuncs (GIInterfaceInfo *info) } /** - * g_interface_info_get_vfunc: + * gi_interface_info_get_vfunc: * @info: a #GIInterfaceInfo * @n: index of virtual function to get * * Obtain an interface type virtual function at index @n. * * Returns: (transfer full): the #GIVFuncInfo. Free the struct by calling - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GIVFuncInfo * -g_interface_info_get_vfunc (GIInterfaceInfo *info, - gint n) +gi_interface_info_get_vfunc (GIInterfaceInfo *info, + gint n) { gint offset; GIRealInfo *rinfo = (GIRealInfo *)info; @@ -376,24 +376,24 @@ g_interface_info_get_vfunc (GIInterfaceInfo *info, + blob->n_signals * header->signal_blob_size + n * header->vfunc_blob_size; - return (GIVFuncInfo *) g_info_new (GI_INFO_TYPE_VFUNC, (GIBaseInfo*)info, - rinfo->typelib, offset); + return (GIVFuncInfo *) gi_info_new (GI_INFO_TYPE_VFUNC, (GIBaseInfo*)info, + rinfo->typelib, offset); } /** - * g_interface_info_find_vfunc: + * gi_interface_info_find_vfunc: * @info: a #GIInterfaceInfo * @name: The name of a virtual function to find. * * Locate a virtual function slot with name @name. See the documentation - * for g_object_info_find_vfunc() for more information on virtuals. + * for gi_object_info_find_vfunc() for more information on virtuals. * * Returns: (transfer full): the #GIVFuncInfo, or %NULL. Free it with - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GIVFuncInfo * -g_interface_info_find_vfunc (GIInterfaceInfo *info, - const gchar *name) +gi_interface_info_find_vfunc (GIInterfaceInfo *info, + const gchar *name) { gint offset; GIRealInfo *rinfo = (GIRealInfo *)info; @@ -412,11 +412,11 @@ g_interface_info_find_vfunc (GIInterfaceInfo *info, + blob->n_methods * header->function_blob_size + blob->n_signals * header->signal_blob_size; - return _g_base_info_find_vfunc (rinfo, offset, blob->n_vfuncs, name); + return _gi_base_info_find_vfunc (rinfo, offset, blob->n_vfuncs, name); } /** - * g_interface_info_get_n_constants: + * gi_interface_info_get_n_constants: * @info: a #GIInterfaceInfo * * Obtain the number of constants that this interface type has. @@ -424,7 +424,7 @@ g_interface_info_find_vfunc (GIInterfaceInfo *info, * Returns: number of constants */ gint -g_interface_info_get_n_constants (GIInterfaceInfo *info) +gi_interface_info_get_n_constants (GIInterfaceInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; InterfaceBlob *blob; @@ -438,18 +438,18 @@ g_interface_info_get_n_constants (GIInterfaceInfo *info) } /** - * g_interface_info_get_constant: + * gi_interface_info_get_constant: * @info: a #GIInterfaceInfo * @n: index of constant to get * * Obtain an interface type constant at index @n. * * Returns: (transfer full): the #GIConstantInfo. Free the struct by calling - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GIConstantInfo * -g_interface_info_get_constant (GIInterfaceInfo *info, - gint n) +gi_interface_info_get_constant (GIInterfaceInfo *info, + gint n) { gint offset; GIRealInfo *rinfo = (GIRealInfo *)info; @@ -470,21 +470,21 @@ g_interface_info_get_constant (GIInterfaceInfo *info, + blob->n_vfuncs * header->vfunc_blob_size + n * header->constant_blob_size; - return (GIConstantInfo *) g_info_new (GI_INFO_TYPE_CONSTANT, (GIBaseInfo*)info, - rinfo->typelib, offset); + return (GIConstantInfo *) gi_info_new (GI_INFO_TYPE_CONSTANT, (GIBaseInfo*)info, + rinfo->typelib, offset); } /** - * g_interface_info_get_iface_struct: + * gi_interface_info_get_iface_struct: * @info: a #GIInterfaceInfo * * Returns the layout C structure associated with this #GInterface. * * Returns: (transfer full): the #GIStructInfo or %NULL. Free it with - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GIStructInfo * -g_interface_info_get_iface_struct (GIInterfaceInfo *info) +gi_interface_info_get_iface_struct (GIInterfaceInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; InterfaceBlob *blob; @@ -495,8 +495,8 @@ g_interface_info_get_iface_struct (GIInterfaceInfo *info) blob = (InterfaceBlob *)&rinfo->typelib->data[rinfo->offset]; if (blob->gtype_struct) - return (GIStructInfo *) _g_info_from_entry (rinfo->repository, - rinfo->typelib, blob->gtype_struct); + return (GIStructInfo *) _gi_info_from_entry (rinfo->repository, + rinfo->typelib, blob->gtype_struct); else return NULL; } diff --git a/girepository/giinterfaceinfo.h b/girepository/giinterfaceinfo.h index 6bc7b1511..daaf5f038 100644 --- a/girepository/giinterfaceinfo.h +++ b/girepository/giinterfaceinfo.h @@ -39,65 +39,65 @@ G_BEGIN_DECLS * Checks if @info is a #GIInterfaceInfo. */ #define GI_IS_INTERFACE_INFO(info) \ - (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_INTERFACE) + (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_INTERFACE) GI_AVAILABLE_IN_ALL -gint g_interface_info_get_n_prerequisites (GIInterfaceInfo *info); +gint gi_interface_info_get_n_prerequisites (GIInterfaceInfo *info); GI_AVAILABLE_IN_ALL -GIBaseInfo * g_interface_info_get_prerequisite (GIInterfaceInfo *info, - gint n); +GIBaseInfo * gi_interface_info_get_prerequisite (GIInterfaceInfo *info, + gint n); GI_AVAILABLE_IN_ALL -gint g_interface_info_get_n_properties (GIInterfaceInfo *info); +gint gi_interface_info_get_n_properties (GIInterfaceInfo *info); GI_AVAILABLE_IN_ALL -GIPropertyInfo * g_interface_info_get_property (GIInterfaceInfo *info, - gint n); +GIPropertyInfo * gi_interface_info_get_property (GIInterfaceInfo *info, + gint n); GI_AVAILABLE_IN_ALL -gint g_interface_info_get_n_methods (GIInterfaceInfo *info); +gint gi_interface_info_get_n_methods (GIInterfaceInfo *info); GI_AVAILABLE_IN_ALL -GIFunctionInfo * g_interface_info_get_method (GIInterfaceInfo *info, - gint n); +GIFunctionInfo * gi_interface_info_get_method (GIInterfaceInfo *info, + gint n); GI_AVAILABLE_IN_ALL -GIFunctionInfo * g_interface_info_find_method (GIInterfaceInfo *info, - const gchar *name); +GIFunctionInfo * gi_interface_info_find_method (GIInterfaceInfo *info, + const gchar *name); GI_AVAILABLE_IN_ALL -gint g_interface_info_get_n_signals (GIInterfaceInfo *info); +gint gi_interface_info_get_n_signals (GIInterfaceInfo *info); GI_AVAILABLE_IN_ALL -GISignalInfo * g_interface_info_get_signal (GIInterfaceInfo *info, - gint n); +GISignalInfo * gi_interface_info_get_signal (GIInterfaceInfo *info, + gint n); GI_AVAILABLE_IN_ALL -GISignalInfo * g_interface_info_find_signal (GIInterfaceInfo *info, - const gchar *name); +GISignalInfo * gi_interface_info_find_signal (GIInterfaceInfo *info, + const gchar *name); GI_AVAILABLE_IN_ALL -gint g_interface_info_get_n_vfuncs (GIInterfaceInfo *info); +gint gi_interface_info_get_n_vfuncs (GIInterfaceInfo *info); GI_AVAILABLE_IN_ALL -GIVFuncInfo * g_interface_info_get_vfunc (GIInterfaceInfo *info, - gint n); +GIVFuncInfo * gi_interface_info_get_vfunc (GIInterfaceInfo *info, + gint n); GI_AVAILABLE_IN_ALL -GIVFuncInfo * g_interface_info_find_vfunc (GIInterfaceInfo *info, - const gchar *name); +GIVFuncInfo * gi_interface_info_find_vfunc (GIInterfaceInfo *info, + const gchar *name); GI_AVAILABLE_IN_ALL -gint g_interface_info_get_n_constants (GIInterfaceInfo *info); +gint gi_interface_info_get_n_constants (GIInterfaceInfo *info); GI_AVAILABLE_IN_ALL -GIConstantInfo * g_interface_info_get_constant (GIInterfaceInfo *info, - gint n); +GIConstantInfo * gi_interface_info_get_constant (GIInterfaceInfo *info, + gint n); GI_AVAILABLE_IN_ALL -GIStructInfo * g_interface_info_get_iface_struct (GIInterfaceInfo *info); +GIStructInfo * gi_interface_info_get_iface_struct (GIInterfaceInfo *info); G_END_DECLS diff --git a/girepository/giobjectinfo.c b/girepository/giobjectinfo.c index f3839ed4a..ccd3b2fa6 100644 --- a/girepository/giobjectinfo.c +++ b/girepository/giobjectinfo.c @@ -49,7 +49,7 @@ */ /** - * g_object_info_get_field_offset: + * gi_object_info_get_field_offset: * @info: a #GIObjectInfo * @n: index of queried field * @@ -58,8 +58,8 @@ * Returns: field offset in bytes */ static gint32 -g_object_info_get_field_offset (GIObjectInfo *info, - gint n) +gi_object_info_get_field_offset (GIObjectInfo *info, + gint n) { GIRealInfo *rinfo = (GIRealInfo *)info; Header *header = (Header *)rinfo->typelib->data; @@ -83,16 +83,16 @@ g_object_info_get_field_offset (GIObjectInfo *info, } /** - * g_object_info_get_parent: + * gi_object_info_get_parent: * @info: a #GIObjectInfo * * Obtain the parent of the object type. * * Returns: (transfer full) (nullable): the #GIObjectInfo. Free the struct by calling - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GIObjectInfo * -g_object_info_get_parent (GIObjectInfo *info) +gi_object_info_get_parent (GIObjectInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; ObjectBlob *blob; @@ -103,14 +103,14 @@ g_object_info_get_parent (GIObjectInfo *info) blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset]; if (blob->parent) - return (GIObjectInfo *) _g_info_from_entry (rinfo->repository, - rinfo->typelib, blob->parent); + return (GIObjectInfo *) _gi_info_from_entry (rinfo->repository, + rinfo->typelib, blob->parent); else return NULL; } /** - * g_object_info_get_abstract: + * gi_object_info_get_abstract: * @info: a #GIObjectInfo * * Obtain if the object type is an abstract type, eg if it cannot be @@ -119,7 +119,7 @@ g_object_info_get_parent (GIObjectInfo *info) * Returns: %TRUE if the object type is abstract */ gboolean -g_object_info_get_abstract (GIObjectInfo *info) +gi_object_info_get_abstract (GIObjectInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; ObjectBlob *blob; @@ -133,7 +133,7 @@ g_object_info_get_abstract (GIObjectInfo *info) } /** - * g_object_info_get_final: + * gi_object_info_get_final: * @info: a #GIObjectInfo * * Checks whether the object type is a final type, i.e. if it cannot @@ -144,7 +144,7 @@ g_object_info_get_abstract (GIObjectInfo *info) * Since: 1.70 */ gboolean -g_object_info_get_final (GIObjectInfo *info) +gi_object_info_get_final (GIObjectInfo *info) { GIRealInfo *rinfo = (GIRealInfo *) info; ObjectBlob *blob; @@ -158,7 +158,7 @@ g_object_info_get_final (GIObjectInfo *info) } /** - * g_object_info_get_fundamental: + * gi_object_info_get_fundamental: * @info: a #GIObjectInfo * * Obtain if the object type is of a fundamental type which is not @@ -167,7 +167,7 @@ g_object_info_get_final (GIObjectInfo *info) * Returns: %TRUE if the object type is a fundamental type */ gboolean -g_object_info_get_fundamental (GIObjectInfo *info) +gi_object_info_get_fundamental (GIObjectInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; ObjectBlob *blob; @@ -181,7 +181,7 @@ g_object_info_get_fundamental (GIObjectInfo *info) } /** - * g_object_info_get_type_name: + * gi_object_info_get_type_name: * @info: a #GIObjectInfo * * Obtain the name of the objects class/type. @@ -189,7 +189,7 @@ g_object_info_get_fundamental (GIObjectInfo *info) * Returns: name of the objects type */ const gchar * -g_object_info_get_type_name (GIObjectInfo *info) +gi_object_info_get_type_name (GIObjectInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; ObjectBlob *blob; @@ -199,11 +199,11 @@ g_object_info_get_type_name (GIObjectInfo *info) blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset]; - return g_typelib_get_string (rinfo->typelib, blob->gtype_name); + return gi_typelib_get_string (rinfo->typelib, blob->gtype_name); } /** - * g_object_info_get_type_init: + * gi_object_info_get_type_init: * @info: a #GIObjectInfo * * Obtain the function which when called will return the GType @@ -212,7 +212,7 @@ g_object_info_get_type_name (GIObjectInfo *info) * Returns: the type init function */ const gchar * -g_object_info_get_type_init (GIObjectInfo *info) +gi_object_info_get_type_init (GIObjectInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; ObjectBlob *blob; @@ -222,11 +222,11 @@ g_object_info_get_type_init (GIObjectInfo *info) blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset]; - return g_typelib_get_string (rinfo->typelib, blob->gtype_init); + return gi_typelib_get_string (rinfo->typelib, blob->gtype_init); } /** - * g_object_info_get_n_interfaces: + * gi_object_info_get_n_interfaces: * @info: a #GIObjectInfo * * Obtain the number of interfaces that this object type has. @@ -234,7 +234,7 @@ g_object_info_get_type_init (GIObjectInfo *info) * Returns: number of interfaces */ gint -g_object_info_get_n_interfaces (GIObjectInfo *info) +gi_object_info_get_n_interfaces (GIObjectInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; ObjectBlob *blob; @@ -248,18 +248,18 @@ g_object_info_get_n_interfaces (GIObjectInfo *info) } /** - * g_object_info_get_interface: + * gi_object_info_get_interface: * @info: a #GIObjectInfo * @n: index of interface to get * * Obtain an object type interface at index @n. * * Returns: (transfer full): the #GIInterfaceInfo. Free the struct by calling - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GIInterfaceInfo * -g_object_info_get_interface (GIObjectInfo *info, - gint n) +gi_object_info_get_interface (GIObjectInfo *info, + gint n) { GIRealInfo *rinfo = (GIRealInfo *)info; ObjectBlob *blob; @@ -269,12 +269,12 @@ g_object_info_get_interface (GIObjectInfo *info, blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset]; - return (GIInterfaceInfo *) _g_info_from_entry (rinfo->repository, - rinfo->typelib, blob->interfaces[n]); + return (GIInterfaceInfo *) _gi_info_from_entry (rinfo->repository, + rinfo->typelib, blob->interfaces[n]); } /** - * g_object_info_get_n_fields: + * gi_object_info_get_n_fields: * @info: a #GIObjectInfo * * Obtain the number of fields that this object type has. @@ -282,7 +282,7 @@ g_object_info_get_interface (GIObjectInfo *info, * Returns: number of fields */ gint -g_object_info_get_n_fields (GIObjectInfo *info) +gi_object_info_get_n_fields (GIObjectInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; ObjectBlob *blob; @@ -296,18 +296,18 @@ g_object_info_get_n_fields (GIObjectInfo *info) } /** - * g_object_info_get_field: + * gi_object_info_get_field: * @info: a #GIObjectInfo * @n: index of field to get * * Obtain an object type field at index @n. * * Returns: (transfer full): the #GIFieldInfo. Free the struct by calling - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GIFieldInfo * -g_object_info_get_field (GIObjectInfo *info, - gint n) +gi_object_info_get_field (GIObjectInfo *info, + gint n) { gint offset; GIRealInfo *rinfo = (GIRealInfo *)info; @@ -315,13 +315,13 @@ g_object_info_get_field (GIObjectInfo *info, g_return_val_if_fail (info != NULL, NULL); g_return_val_if_fail (GI_IS_OBJECT_INFO (info), NULL); - offset = g_object_info_get_field_offset(info, n); + offset = gi_object_info_get_field_offset(info, n); - return (GIFieldInfo *) g_info_new (GI_INFO_TYPE_FIELD, (GIBaseInfo*)info, rinfo->typelib, offset); + return (GIFieldInfo *) gi_info_new (GI_INFO_TYPE_FIELD, (GIBaseInfo*)info, rinfo->typelib, offset); } /** - * g_object_info_get_n_properties: + * gi_object_info_get_n_properties: * @info: a #GIObjectInfo * * Obtain the number of properties that this object type has. @@ -329,7 +329,7 @@ g_object_info_get_field (GIObjectInfo *info, * Returns: number of properties */ gint -g_object_info_get_n_properties (GIObjectInfo *info) +gi_object_info_get_n_properties (GIObjectInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; ObjectBlob *blob; @@ -342,18 +342,18 @@ g_object_info_get_n_properties (GIObjectInfo *info) } /** - * g_object_info_get_property: + * gi_object_info_get_property: * @info: a #GIObjectInfo * @n: index of property to get * * Obtain an object type property at index @n. * * Returns: (transfer full): the #GIPropertyInfo. Free the struct by calling - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GIPropertyInfo * -g_object_info_get_property (GIObjectInfo *info, - gint n) +gi_object_info_get_property (GIObjectInfo *info, + gint n) { gint offset; GIRealInfo *rinfo = (GIRealInfo *)info; @@ -372,12 +372,12 @@ g_object_info_get_property (GIObjectInfo *info, + blob->n_field_callbacks * header->callback_blob_size + n * header->property_blob_size; - return (GIPropertyInfo *) g_info_new (GI_INFO_TYPE_PROPERTY, (GIBaseInfo*)info, - rinfo->typelib, offset); + return (GIPropertyInfo *) gi_info_new (GI_INFO_TYPE_PROPERTY, (GIBaseInfo*)info, + rinfo->typelib, offset); } /** - * g_object_info_get_n_methods: + * gi_object_info_get_n_methods: * @info: a #GIObjectInfo * * Obtain the number of methods that this object type has. @@ -385,7 +385,7 @@ g_object_info_get_property (GIObjectInfo *info, * Returns: number of methods */ gint -g_object_info_get_n_methods (GIObjectInfo *info) +gi_object_info_get_n_methods (GIObjectInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; ObjectBlob *blob; @@ -399,18 +399,18 @@ g_object_info_get_n_methods (GIObjectInfo *info) } /** - * g_object_info_get_method: + * gi_object_info_get_method: * @info: a #GIObjectInfo * @n: index of method to get * * Obtain an object type method at index @n. * * Returns: (transfer full): the #GIFunctionInfo. Free the struct by calling - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GIFunctionInfo * -g_object_info_get_method (GIObjectInfo *info, - gint n) +gi_object_info_get_method (GIObjectInfo *info, + gint n) { gint offset; GIRealInfo *rinfo = (GIRealInfo *)info; @@ -431,12 +431,12 @@ g_object_info_get_method (GIObjectInfo *info, + blob->n_properties * header->property_blob_size + n * header->function_blob_size; - return (GIFunctionInfo *) g_info_new (GI_INFO_TYPE_FUNCTION, (GIBaseInfo*)info, - rinfo->typelib, offset); + return (GIFunctionInfo *) gi_info_new (GI_INFO_TYPE_FUNCTION, (GIBaseInfo*)info, + rinfo->typelib, offset); } /** - * g_object_info_find_method: + * gi_object_info_find_method: * @info: a #GIObjectInfo * @name: name of method to obtain * @@ -444,11 +444,11 @@ g_object_info_get_method (GIObjectInfo *info, * returned if there's no method available with that name. * * Returns: (transfer full) (nullable): the #GIFunctionInfo. Free the struct by calling - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GIFunctionInfo * -g_object_info_find_method (GIObjectInfo *info, - const gchar *name) +gi_object_info_find_method (GIObjectInfo *info, + const gchar *name) { gint offset; GIRealInfo *rinfo = (GIRealInfo *)info; @@ -467,11 +467,11 @@ g_object_info_find_method (GIObjectInfo *info, + blob->n_field_callbacks * header->callback_blob_size + blob->n_properties * header->property_blob_size; - return _g_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_methods, name); + return _gi_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_methods, name); } /** - * g_object_info_find_method_using_interfaces: + * gi_object_info_find_method_using_interfaces: * @info: a #GIObjectInfo * @name: name of method to obtain * @implementor: (out) (transfer full): The implementor of the interface @@ -484,51 +484,51 @@ g_object_info_find_method (GIObjectInfo *info, * to chain up if that's desired. * * Returns: (transfer full) (nullable): the #GIFunctionInfo. Free the struct by calling - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GIFunctionInfo * -g_object_info_find_method_using_interfaces (GIObjectInfo *info, - const gchar *name, - GIObjectInfo **implementor) +gi_object_info_find_method_using_interfaces (GIObjectInfo *info, + const gchar *name, + GIObjectInfo **implementor) { GIFunctionInfo *result = NULL; GIObjectInfo *implementor_result = NULL; - result = g_object_info_find_method (info, name); + result = gi_object_info_find_method (info, name); if (result) - implementor_result = g_base_info_ref ((GIBaseInfo*) info); + implementor_result = gi_base_info_ref ((GIBaseInfo*) info); if (result == NULL) { int n_interfaces; int i; - n_interfaces = g_object_info_get_n_interfaces (info); + n_interfaces = gi_object_info_get_n_interfaces (info); for (i = 0; i < n_interfaces; ++i) { GIInterfaceInfo *iface_info; - iface_info = g_object_info_get_interface (info, i); + iface_info = gi_object_info_get_interface (info, i); - result = g_interface_info_find_method (iface_info, name); + result = gi_interface_info_find_method (iface_info, name); if (result != NULL) { implementor_result = iface_info; break; } - g_base_info_unref ((GIBaseInfo*) iface_info); + gi_base_info_unref ((GIBaseInfo*) iface_info); } } if (implementor) *implementor = implementor_result; else if (implementor_result != NULL) - g_base_info_unref ((GIBaseInfo*) implementor_result); + gi_base_info_unref ((GIBaseInfo*) implementor_result); return result; } /** - * g_object_info_get_n_signals: + * gi_object_info_get_n_signals: * @info: a #GIObjectInfo * * Obtain the number of signals that this object type has. @@ -536,7 +536,7 @@ g_object_info_find_method_using_interfaces (GIObjectInfo *info, * Returns: number of signals */ gint -g_object_info_get_n_signals (GIObjectInfo *info) +gi_object_info_get_n_signals (GIObjectInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; ObjectBlob *blob; @@ -550,18 +550,18 @@ g_object_info_get_n_signals (GIObjectInfo *info) } /** - * g_object_info_get_signal: + * gi_object_info_get_signal: * @info: a #GIObjectInfo * @n: index of signal to get * * Obtain an object type signal at index @n. * * Returns: (transfer full): the #GISignalInfo. Free the struct by calling - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GISignalInfo * -g_object_info_get_signal (GIObjectInfo *info, - gint n) +gi_object_info_get_signal (GIObjectInfo *info, + gint n) { gint offset; GIRealInfo *rinfo = (GIRealInfo *)info; @@ -582,12 +582,12 @@ g_object_info_get_signal (GIObjectInfo *info, + blob->n_methods * header->function_blob_size + n * header->signal_blob_size; - return (GISignalInfo *) g_info_new (GI_INFO_TYPE_SIGNAL, (GIBaseInfo*)info, - rinfo->typelib, offset); + return (GISignalInfo *) gi_info_new (GI_INFO_TYPE_SIGNAL, (GIBaseInfo*)info, + rinfo->typelib, offset); } /** - * g_object_info_find_signal: + * gi_object_info_find_signal: * @info: a #GIObjectInfo * @name: Name of signal * @@ -596,20 +596,20 @@ g_object_info_get_signal (GIObjectInfo *info, * Returns: (transfer full) (nullable): Info for the signal with name @name in @info, or %NULL on failure. */ GISignalInfo * -g_object_info_find_signal (GIObjectInfo *info, - const gchar *name) +gi_object_info_find_signal (GIObjectInfo *info, + const gchar *name) { gint n_signals; gint i; - n_signals = g_object_info_get_n_signals (info); + n_signals = gi_object_info_get_n_signals (info); for (i = 0; i < n_signals; i++) { - GISignalInfo *siginfo = g_object_info_get_signal (info, i); + GISignalInfo *siginfo = gi_object_info_get_signal (info, i); - if (g_strcmp0 (g_base_info_get_name (siginfo), name) != 0) + if (g_strcmp0 (gi_base_info_get_name (siginfo), name) != 0) { - g_base_info_unref ((GIBaseInfo*)siginfo); + gi_base_info_unref ((GIBaseInfo*)siginfo); continue; } @@ -620,7 +620,7 @@ g_object_info_find_signal (GIObjectInfo *info, /** - * g_object_info_get_n_vfuncs: + * gi_object_info_get_n_vfuncs: * @info: a #GIObjectInfo * * Obtain the number of virtual functions that this object type has. @@ -628,7 +628,7 @@ g_object_info_find_signal (GIObjectInfo *info, * Returns: number of virtual functions */ gint -g_object_info_get_n_vfuncs (GIObjectInfo *info) +gi_object_info_get_n_vfuncs (GIObjectInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; ObjectBlob *blob; @@ -642,18 +642,18 @@ g_object_info_get_n_vfuncs (GIObjectInfo *info) } /** - * g_object_info_get_vfunc: + * gi_object_info_get_vfunc: * @info: a #GIObjectInfo * @n: index of virtual function to get * * Obtain an object type virtual function at index @n. * * Returns: (transfer full): the #GIVFuncInfo. Free the struct by calling - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GIVFuncInfo * -g_object_info_get_vfunc (GIObjectInfo *info, - gint n) +gi_object_info_get_vfunc (GIObjectInfo *info, + gint n) { gint offset; GIRealInfo *rinfo = (GIRealInfo *)info; @@ -675,29 +675,29 @@ g_object_info_get_vfunc (GIObjectInfo *info, + blob->n_signals * header->signal_blob_size + n * header->vfunc_blob_size; - return (GIVFuncInfo *) g_info_new (GI_INFO_TYPE_VFUNC, (GIBaseInfo*)info, - rinfo->typelib, offset); + return (GIVFuncInfo *) gi_info_new (GI_INFO_TYPE_VFUNC, (GIBaseInfo*)info, + rinfo->typelib, offset); } /** - * g_object_info_find_vfunc: + * gi_object_info_find_vfunc: * @info: a #GIObjectInfo * @name: The name of a virtual function to find. * * Locate a virtual function slot with name @name. Note that the namespace * for virtuals is distinct from that of methods; there may or may not be * a concrete method associated for a virtual. If there is one, it may - * be retrieved using g_vfunc_info_get_invoker(), otherwise %NULL will be + * be retrieved using gi_vfunc_info_get_invoker(), otherwise %NULL will be * returned. - * See the documentation for g_vfunc_info_get_invoker() for more + * See the documentation for gi_vfunc_info_get_invoker() for more * information on invoking virtuals. * * Returns: (transfer full) (nullable): the #GIVFuncInfo, or %NULL. Free it with - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GIVFuncInfo * -g_object_info_find_vfunc (GIObjectInfo *info, - const gchar *name) +gi_object_info_find_vfunc (GIObjectInfo *info, + const gchar *name) { gint offset; GIRealInfo *rinfo = (GIRealInfo *)info; @@ -718,11 +718,11 @@ g_object_info_find_vfunc (GIObjectInfo *info, + blob->n_methods * header->function_blob_size + blob->n_signals * header->signal_blob_size; - return _g_base_info_find_vfunc (rinfo, offset, blob->n_vfuncs, name); + return _gi_base_info_find_vfunc (rinfo, offset, blob->n_vfuncs, name); } /** - * g_object_info_find_vfunc_using_interfaces: + * gi_object_info_find_vfunc_using_interfaces: * @info: a #GIObjectInfo * @name: name of vfunc to obtain * @implementor: (out) (transfer full): The implementor of the interface @@ -731,58 +731,58 @@ g_object_info_find_vfunc (GIObjectInfo *info, * @info and any interfaces it implements. Note that the namespace for * virtuals is distinct from that of methods; there may or may not be a * concrete method associated for a virtual. If there is one, it may be - * retrieved using g_vfunc_info_get_invoker(), otherwise %NULL will be + * retrieved using gi_vfunc_info_get_invoker(), otherwise %NULL will be * returned. * * Note that this function does *not* search parent classes; you will have * to chain up if that's desired. * * Returns: (transfer full) (nullable): the #GIVFuncInfo. Free the struct by calling - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GIVFuncInfo * -g_object_info_find_vfunc_using_interfaces (GIObjectInfo *info, - const gchar *name, - GIObjectInfo **implementor) +gi_object_info_find_vfunc_using_interfaces (GIObjectInfo *info, + const gchar *name, + GIObjectInfo **implementor) { GIVFuncInfo *result = NULL; GIObjectInfo *implementor_result = NULL; - result = g_object_info_find_vfunc (info, name); + result = gi_object_info_find_vfunc (info, name); if (result) - implementor_result = g_base_info_ref ((GIBaseInfo*) info); + implementor_result = gi_base_info_ref ((GIBaseInfo*) info); if (result == NULL) { int n_interfaces; int i; - n_interfaces = g_object_info_get_n_interfaces (info); + n_interfaces = gi_object_info_get_n_interfaces (info); for (i = 0; i < n_interfaces; ++i) { GIInterfaceInfo *iface_info; - iface_info = g_object_info_get_interface (info, i); + iface_info = gi_object_info_get_interface (info, i); - result = g_interface_info_find_vfunc (iface_info, name); + result = gi_interface_info_find_vfunc (iface_info, name); if (result != NULL) { implementor_result = iface_info; break; } - g_base_info_unref ((GIBaseInfo*) iface_info); + gi_base_info_unref ((GIBaseInfo*) iface_info); } } if (implementor) *implementor = implementor_result; else if (implementor_result != NULL) - g_base_info_unref ((GIBaseInfo*) implementor_result); + gi_base_info_unref ((GIBaseInfo*) implementor_result); return result; } /** - * g_object_info_get_n_constants: + * gi_object_info_get_n_constants: * @info: a #GIObjectInfo * * Obtain the number of constants that this object type has. @@ -790,7 +790,7 @@ g_object_info_find_vfunc_using_interfaces (GIObjectInfo *info, * Returns: number of constants */ gint -g_object_info_get_n_constants (GIObjectInfo *info) +gi_object_info_get_n_constants (GIObjectInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; ObjectBlob *blob; @@ -804,18 +804,18 @@ g_object_info_get_n_constants (GIObjectInfo *info) } /** - * g_object_info_get_constant: + * gi_object_info_get_constant: * @info: a #GIObjectInfo * @n: index of constant to get * * Obtain an object type constant at index @n. * * Returns: (transfer full): the #GIConstantInfo. Free the struct by calling - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GIConstantInfo * -g_object_info_get_constant (GIObjectInfo *info, - gint n) +gi_object_info_get_constant (GIObjectInfo *info, + gint n) { gint offset; GIRealInfo *rinfo = (GIRealInfo *)info; @@ -838,22 +838,22 @@ g_object_info_get_constant (GIObjectInfo *info, + blob->n_vfuncs * header->vfunc_blob_size + n * header->constant_blob_size; - return (GIConstantInfo *) g_info_new (GI_INFO_TYPE_CONSTANT, (GIBaseInfo*)info, - rinfo->typelib, offset); + return (GIConstantInfo *) gi_info_new (GI_INFO_TYPE_CONSTANT, (GIBaseInfo*)info, + rinfo->typelib, offset); } /** - * g_object_info_get_class_struct: + * gi_object_info_get_class_struct: * @info: a #GIObjectInfo * * Every #GObject has two structures; an instance structure and a class * structure. This function returns the metadata for the class structure. * * Returns: (transfer full) (nullable): the #GIStructInfo or %NULL. Free with - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GIStructInfo * -g_object_info_get_class_struct (GIObjectInfo *info) +gi_object_info_get_class_struct (GIObjectInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; ObjectBlob *blob; @@ -864,8 +864,8 @@ g_object_info_get_class_struct (GIObjectInfo *info) blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset]; if (blob->gtype_struct) - return (GIStructInfo *) _g_info_from_entry (rinfo->repository, - rinfo->typelib, blob->gtype_struct); + return (GIStructInfo *) _gi_info_from_entry (rinfo->repository, + rinfo->typelib, blob->gtype_struct); else return NULL; } @@ -881,11 +881,11 @@ _get_func(GIObjectInfo *info, GIObjectInfo *parent_info; gpointer func = NULL; - parent_info = g_base_info_ref (info); + parent_info = gi_base_info_ref (info); while (parent_info != NULL) { parents = g_slist_prepend (parents, parent_info); - parent_info = g_object_info_get_parent (parent_info); + parent_info = gi_object_info_get_parent (parent_info); } for (l = parents; l; l = l->next) @@ -895,28 +895,28 @@ _get_func(GIObjectInfo *info, if (symbol == NULL) continue; - g_typelib_symbol (((GIRealInfo *)parent_info)->typelib, symbol, (gpointer*) &func); + gi_typelib_symbol (((GIRealInfo *)parent_info)->typelib, symbol, (gpointer*) &func); if (func) break; } - g_slist_free_full (parents, (GDestroyNotify) g_base_info_unref); + g_slist_free_full (parents, (GDestroyNotify) gi_base_info_unref); return func; } /** - * g_object_info_get_ref_function: + * gi_object_info_get_ref_function: * @info: a #GIObjectInfo * * Obtain the symbol name of the function that should be called to ref this * object type. It's mainly used fundamental types. The type signature for * the symbol is %GIObjectInfoRefFunction, to fetch the function pointer - * see g_object_info_get_ref_function(). + * see gi_object_info_get_ref_function(). * * Returns: (nullable): the symbol or %NULL */ const char * -g_object_info_get_ref_function (GIObjectInfo *info) +gi_object_info_get_ref_function (GIObjectInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; ObjectBlob *blob; @@ -927,13 +927,13 @@ g_object_info_get_ref_function (GIObjectInfo *info) blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset]; if (blob->ref_func) - return g_typelib_get_string (rinfo->typelib, blob->ref_func); + return gi_typelib_get_string (rinfo->typelib, blob->ref_func); return NULL; } /** - * g_object_info_get_ref_function_pointer: (skip) + * gi_object_info_get_ref_function_pointer: (skip) * @info: a #GIObjectInfo * * Obtain a pointer to a function which can be used to @@ -944,27 +944,27 @@ g_object_info_get_ref_function (GIObjectInfo *info) * Returns: (nullable): the function pointer or %NULL */ GIObjectInfoRefFunction -g_object_info_get_ref_function_pointer (GIObjectInfo *info) +gi_object_info_get_ref_function_pointer (GIObjectInfo *info) { g_return_val_if_fail (info != NULL, NULL); g_return_val_if_fail (GI_IS_OBJECT_INFO (info), NULL); - return (GIObjectInfoRefFunction)_get_func(info, (SymbolGetter)g_object_info_get_ref_function); + return (GIObjectInfoRefFunction)_get_func(info, (SymbolGetter)gi_object_info_get_ref_function); } /** - * g_object_info_get_unref_function: + * gi_object_info_get_unref_function: * @info: a #GIObjectInfo * * Obtain the symbol name of the function that should be called to unref this * object type. It's mainly used fundamental types. The type signature for * the symbol is %GIObjectInfoUnrefFunction, to fetch the function pointer - * see g_object_info_get_unref_function(). + * see gi_object_info_get_unref_function(). * * Returns: (nullable): the symbol or %NULL */ const char * -g_object_info_get_unref_function (GIObjectInfo *info) +gi_object_info_get_unref_function (GIObjectInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; ObjectBlob *blob; @@ -975,13 +975,13 @@ g_object_info_get_unref_function (GIObjectInfo *info) blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset]; if (blob->unref_func) - return g_typelib_get_string (rinfo->typelib, blob->unref_func); + return gi_typelib_get_string (rinfo->typelib, blob->unref_func); return NULL; } /** - * g_object_info_get_unref_function_pointer: (skip) + * gi_object_info_get_unref_function_pointer: (skip) * @info: a #GIObjectInfo * * Obtain a pointer to a function which can be used to @@ -992,28 +992,28 @@ g_object_info_get_unref_function (GIObjectInfo *info) * Returns: (nullable): the function pointer or %NULL */ GIObjectInfoUnrefFunction -g_object_info_get_unref_function_pointer (GIObjectInfo *info) +gi_object_info_get_unref_function_pointer (GIObjectInfo *info) { g_return_val_if_fail (info != NULL, NULL); g_return_val_if_fail (GI_IS_OBJECT_INFO (info), NULL); - return (GIObjectInfoUnrefFunction)_get_func(info, (SymbolGetter)g_object_info_get_unref_function); + return (GIObjectInfoUnrefFunction)_get_func(info, (SymbolGetter)gi_object_info_get_unref_function); } /** - * g_object_info_get_set_value_function: + * gi_object_info_get_set_value_function: * @info: a #GIObjectInfo * * Obtain the symbol name of the function that should be called to convert * set a GValue giving an object instance pointer of this object type. * I's mainly used fundamental types. The type signature for the symbol * is %GIObjectInfoSetValueFunction, to fetch the function pointer - * see g_object_info_get_set_value_function(). + * see gi_object_info_get_set_value_function(). * * Returns: (nullable): the symbol or %NULL */ const char * -g_object_info_get_set_value_function (GIObjectInfo *info) +gi_object_info_get_set_value_function (GIObjectInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; ObjectBlob *blob; @@ -1024,13 +1024,13 @@ g_object_info_get_set_value_function (GIObjectInfo *info) blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset]; if (blob->set_value_func) - return g_typelib_get_string (rinfo->typelib, blob->set_value_func); + return gi_typelib_get_string (rinfo->typelib, blob->set_value_func); return NULL; } /** - * g_object_info_get_set_value_function_pointer: (skip) + * gi_object_info_get_set_value_function_pointer: (skip) * @info: a #GIObjectInfo * * Obtain a pointer to a function which can be used to @@ -1041,28 +1041,28 @@ g_object_info_get_set_value_function (GIObjectInfo *info) * Returns: (nullable): the function pointer or %NULL */ GIObjectInfoSetValueFunction -g_object_info_get_set_value_function_pointer (GIObjectInfo *info) +gi_object_info_get_set_value_function_pointer (GIObjectInfo *info) { g_return_val_if_fail (info != NULL, NULL); g_return_val_if_fail (GI_IS_OBJECT_INFO (info), NULL); - return (GIObjectInfoSetValueFunction)_get_func(info, (SymbolGetter)g_object_info_get_set_value_function); + return (GIObjectInfoSetValueFunction)_get_func(info, (SymbolGetter)gi_object_info_get_set_value_function); } /** - * g_object_info_get_get_value_function: + * gi_object_info_get_get_value_function: * @info: a #GIObjectInfo * * Obtain the symbol name of the function that should be called to convert * an object instance pointer of this object type to a GValue. * I's mainly used fundamental types. The type signature for the symbol * is %GIObjectInfoGetValueFunction, to fetch the function pointer - * see g_object_info_get_get_value_function(). + * see gi_object_info_get_get_value_function(). * * Returns: (nullable): the symbol or %NULL */ const char * -g_object_info_get_get_value_function (GIObjectInfo *info) +gi_object_info_get_get_value_function (GIObjectInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; ObjectBlob *blob; @@ -1073,13 +1073,13 @@ g_object_info_get_get_value_function (GIObjectInfo *info) blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset]; if (blob->get_value_func) - return g_typelib_get_string (rinfo->typelib, blob->get_value_func); + return gi_typelib_get_string (rinfo->typelib, blob->get_value_func); return NULL; } /** - * g_object_info_get_get_value_function_pointer: (skip) + * gi_object_info_get_get_value_function_pointer: (skip) * @info: a #GIObjectInfo * * Obtain a pointer to a function which can be used to @@ -1090,10 +1090,10 @@ g_object_info_get_get_value_function (GIObjectInfo *info) * Returns: (nullable): the function pointer or %NULL */ GIObjectInfoGetValueFunction -g_object_info_get_get_value_function_pointer (GIObjectInfo *info) +gi_object_info_get_get_value_function_pointer (GIObjectInfo *info) { g_return_val_if_fail (info != NULL, NULL); g_return_val_if_fail (GI_IS_OBJECT_INFO (info), NULL); - return (GIObjectInfoGetValueFunction)_get_func(info, (SymbolGetter)g_object_info_get_get_value_function); + return (GIObjectInfoGetValueFunction)_get_func(info, (SymbolGetter)gi_object_info_get_get_value_function); } diff --git a/girepository/giobjectinfo.h b/girepository/giobjectinfo.h index e12ea62f1..58fef90fb 100644 --- a/girepository/giobjectinfo.h +++ b/girepository/giobjectinfo.h @@ -76,132 +76,132 @@ typedef void * (*GIObjectInfoGetValueFunction) (const GValue *value); * Checks if @info is a #GIObjectInfo. */ #define GI_IS_OBJECT_INFO(info) \ - (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_OBJECT) + (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_OBJECT) GI_AVAILABLE_IN_ALL -const gchar * g_object_info_get_type_name (GIObjectInfo *info); +const gchar * gi_object_info_get_type_name (GIObjectInfo *info); GI_AVAILABLE_IN_ALL -const gchar * g_object_info_get_type_init (GIObjectInfo *info); +const gchar * gi_object_info_get_type_init (GIObjectInfo *info); GI_AVAILABLE_IN_ALL -gboolean g_object_info_get_abstract (GIObjectInfo *info); +gboolean gi_object_info_get_abstract (GIObjectInfo *info); GI_AVAILABLE_IN_ALL -gboolean g_object_info_get_final (GIObjectInfo *info); +gboolean gi_object_info_get_final (GIObjectInfo *info); GI_AVAILABLE_IN_ALL -gboolean g_object_info_get_fundamental (GIObjectInfo *info); +gboolean gi_object_info_get_fundamental (GIObjectInfo *info); GI_AVAILABLE_IN_ALL -GIObjectInfo * g_object_info_get_parent (GIObjectInfo *info); +GIObjectInfo * gi_object_info_get_parent (GIObjectInfo *info); GI_AVAILABLE_IN_ALL -gint g_object_info_get_n_interfaces (GIObjectInfo *info); +gint gi_object_info_get_n_interfaces (GIObjectInfo *info); GI_AVAILABLE_IN_ALL -GIInterfaceInfo * g_object_info_get_interface (GIObjectInfo *info, +GIInterfaceInfo * gi_object_info_get_interface (GIObjectInfo *info, + gint n); + +GI_AVAILABLE_IN_ALL +gint gi_object_info_get_n_fields (GIObjectInfo *info); + +GI_AVAILABLE_IN_ALL +GIFieldInfo * gi_object_info_get_field (GIObjectInfo *info, + gint n); + +GI_AVAILABLE_IN_ALL +gint gi_object_info_get_n_properties (GIObjectInfo *info); + +GI_AVAILABLE_IN_ALL +GIPropertyInfo * gi_object_info_get_property (GIObjectInfo *info, gint n); GI_AVAILABLE_IN_ALL -gint g_object_info_get_n_fields (GIObjectInfo *info); +gint gi_object_info_get_n_methods (GIObjectInfo *info); GI_AVAILABLE_IN_ALL -GIFieldInfo * g_object_info_get_field (GIObjectInfo *info, - gint n); +GIFunctionInfo * gi_object_info_get_method (GIObjectInfo *info, + gint n); GI_AVAILABLE_IN_ALL -gint g_object_info_get_n_properties (GIObjectInfo *info); - -GI_AVAILABLE_IN_ALL -GIPropertyInfo * g_object_info_get_property (GIObjectInfo *info, - gint n); - -GI_AVAILABLE_IN_ALL -gint g_object_info_get_n_methods (GIObjectInfo *info); - -GI_AVAILABLE_IN_ALL -GIFunctionInfo * g_object_info_get_method (GIObjectInfo *info, - gint n); - -GI_AVAILABLE_IN_ALL -GIFunctionInfo * g_object_info_find_method (GIObjectInfo *info, +GIFunctionInfo * gi_object_info_find_method (GIObjectInfo *info, const gchar *name); GI_AVAILABLE_IN_ALL -GIFunctionInfo * g_object_info_find_method_using_interfaces (GIObjectInfo *info, - const gchar *name, - GIObjectInfo **implementor); +GIFunctionInfo * gi_object_info_find_method_using_interfaces (GIObjectInfo *info, + const gchar *name, + GIObjectInfo **implementor); GI_AVAILABLE_IN_ALL -gint g_object_info_get_n_signals (GIObjectInfo *info); +gint gi_object_info_get_n_signals (GIObjectInfo *info); GI_AVAILABLE_IN_ALL -GISignalInfo * g_object_info_get_signal (GIObjectInfo *info, - gint n); +GISignalInfo * gi_object_info_get_signal (GIObjectInfo *info, + gint n); GI_AVAILABLE_IN_ALL -GISignalInfo * g_object_info_find_signal (GIObjectInfo *info, - const gchar *name); +GISignalInfo * gi_object_info_find_signal (GIObjectInfo *info, + const gchar *name); GI_AVAILABLE_IN_ALL -gint g_object_info_get_n_vfuncs (GIObjectInfo *info); +gint gi_object_info_get_n_vfuncs (GIObjectInfo *info); GI_AVAILABLE_IN_ALL -GIVFuncInfo * g_object_info_get_vfunc (GIObjectInfo *info, - gint n); +GIVFuncInfo * gi_object_info_get_vfunc (GIObjectInfo *info, + gint n); GI_AVAILABLE_IN_ALL -GIVFuncInfo * g_object_info_find_vfunc (GIObjectInfo *info, - const gchar *name); +GIVFuncInfo * gi_object_info_find_vfunc (GIObjectInfo *info, + const gchar *name); GI_AVAILABLE_IN_ALL -GIVFuncInfo * g_object_info_find_vfunc_using_interfaces (GIObjectInfo *info, - const gchar *name, - GIObjectInfo **implementor); +GIVFuncInfo * gi_object_info_find_vfunc_using_interfaces (GIObjectInfo *info, + const gchar *name, + GIObjectInfo **implementor); GI_AVAILABLE_IN_ALL -gint g_object_info_get_n_constants (GIObjectInfo *info); +gint gi_object_info_get_n_constants (GIObjectInfo *info); GI_AVAILABLE_IN_ALL -GIConstantInfo * g_object_info_get_constant (GIObjectInfo *info, - gint n); +GIConstantInfo * gi_object_info_get_constant (GIObjectInfo *info, + gint n); GI_AVAILABLE_IN_ALL -GIStructInfo * g_object_info_get_class_struct (GIObjectInfo *info); +GIStructInfo * gi_object_info_get_class_struct (GIObjectInfo *info); GI_AVAILABLE_IN_ALL -const char * g_object_info_get_ref_function (GIObjectInfo *info); +const char * gi_object_info_get_ref_function (GIObjectInfo *info); GI_AVAILABLE_IN_ALL -GIObjectInfoRefFunction g_object_info_get_ref_function_pointer (GIObjectInfo *info); +GIObjectInfoRefFunction gi_object_info_get_ref_function_pointer (GIObjectInfo *info); GI_AVAILABLE_IN_ALL -const char * g_object_info_get_unref_function (GIObjectInfo *info); +const char * gi_object_info_get_unref_function (GIObjectInfo *info); GI_AVAILABLE_IN_ALL -GIObjectInfoUnrefFunction g_object_info_get_unref_function_pointer (GIObjectInfo *info); +GIObjectInfoUnrefFunction gi_object_info_get_unref_function_pointer (GIObjectInfo *info); GI_AVAILABLE_IN_ALL -const char * g_object_info_get_set_value_function (GIObjectInfo *info); +const char * gi_object_info_get_set_value_function (GIObjectInfo *info); GI_AVAILABLE_IN_ALL -GIObjectInfoSetValueFunction g_object_info_get_set_value_function_pointer (GIObjectInfo *info); +GIObjectInfoSetValueFunction gi_object_info_get_set_value_function_pointer (GIObjectInfo *info); GI_AVAILABLE_IN_ALL -const char * g_object_info_get_get_value_function (GIObjectInfo *info); +const char * gi_object_info_get_get_value_function (GIObjectInfo *info); GI_AVAILABLE_IN_ALL -GIObjectInfoGetValueFunction g_object_info_get_get_value_function_pointer (GIObjectInfo *info); +GIObjectInfoGetValueFunction gi_object_info_get_get_value_function_pointer (GIObjectInfo *info); G_END_DECLS diff --git a/girepository/gipropertyinfo.c b/girepository/gipropertyinfo.c index 8436ec437..b9b21b7c1 100644 --- a/girepository/gipropertyinfo.c +++ b/girepository/gipropertyinfo.c @@ -42,7 +42,7 @@ */ /** - * g_property_info_get_flags: + * gi_property_info_get_flags: * @info: a #GIPropertyInfo * * Obtain the flags for this property info. See #GParamFlags for @@ -51,7 +51,7 @@ * Returns: the flags */ GParamFlags -g_property_info_get_flags (GIPropertyInfo *info) +gi_property_info_get_flags (GIPropertyInfo *info) { GParamFlags flags; GIRealInfo *rinfo = (GIRealInfo *)info; @@ -80,29 +80,29 @@ g_property_info_get_flags (GIPropertyInfo *info) } /** - * g_property_info_get_type: + * gi_property_info_get_type: * @info: a #GIPropertyInfo * * Obtain the type information for the property @info. * * Returns: (transfer full): the #GITypeInfo, free it with - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GITypeInfo * -g_property_info_get_type (GIPropertyInfo *info) +gi_property_info_get_type (GIPropertyInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; g_return_val_if_fail (info != NULL, NULL); g_return_val_if_fail (GI_IS_PROPERTY_INFO (info), NULL); - return _g_type_info_new ((GIBaseInfo*)info, - rinfo->typelib, - rinfo->offset + G_STRUCT_OFFSET (PropertyBlob, type)); + return _gi_type_info_new ((GIBaseInfo*)info, + rinfo->typelib, + rinfo->offset + G_STRUCT_OFFSET (PropertyBlob, type)); } /** - * g_property_info_get_ownership_transfer: + * gi_property_info_get_ownership_transfer: * @info: a #GIPropertyInfo * * Obtain the ownership transfer for this property. See #GITransfer for more @@ -111,7 +111,7 @@ g_property_info_get_type (GIPropertyInfo *info) * Returns: the transfer */ GITransfer -g_property_info_get_ownership_transfer (GIPropertyInfo *info) +gi_property_info_get_ownership_transfer (GIPropertyInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; PropertyBlob *blob; @@ -130,7 +130,7 @@ g_property_info_get_ownership_transfer (GIPropertyInfo *info) } /** - * g_property_info_get_setter: + * gi_property_info_get_setter: * @info: a #GIPropertyInfo * * Obtains the setter function associated with this #GIPropertyInfo. @@ -139,10 +139,10 @@ g_property_info_get_ownership_transfer (GIPropertyInfo *info) * are also not %G_PARAM_CONSTRUCT_ONLY. * * Returns: (transfer full) (nullable): the function info or %NULL if not set. - * Free it with g_base_info_unref() when done. + * Free it with gi_base_info_unref() when done. */ GIFunctionInfo * -g_property_info_get_setter (GIPropertyInfo *info) +gi_property_info_get_setter (GIPropertyInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; PropertyBlob *blob; @@ -160,17 +160,17 @@ g_property_info_get_setter (GIPropertyInfo *info) return NULL; container = rinfo->container; - parent_type = g_base_info_get_type (container); + parent_type = gi_base_info_get_type (container); if (parent_type == GI_INFO_TYPE_OBJECT) - return g_object_info_get_method ((GIObjectInfo *) container, blob->setter); + return gi_object_info_get_method ((GIObjectInfo *) container, blob->setter); else if (parent_type == GI_INFO_TYPE_INTERFACE) - return g_interface_info_get_method ((GIInterfaceInfo *) container, blob->setter); + return gi_interface_info_get_method ((GIInterfaceInfo *) container, blob->setter); else return NULL; } /** - * g_property_info_get_getter: + * gi_property_info_get_getter: * @info: a #GIPropertyInfo * * Obtains the getter function associated with this #GIPropertyInfo. @@ -178,10 +178,10 @@ g_property_info_get_setter (GIPropertyInfo *info) * The setter is only available for %G_PARAM_READABLE properties. * * Returns: (transfer full) (nullable): the function info or %NULL if not set. - * Free it with g_base_info_unref() when done. + * Free it with gi_base_info_unref() when done. */ GIFunctionInfo * -g_property_info_get_getter (GIPropertyInfo *info) +gi_property_info_get_getter (GIPropertyInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; PropertyBlob *blob; @@ -199,11 +199,11 @@ g_property_info_get_getter (GIPropertyInfo *info) return NULL; container = rinfo->container; - parent_type = g_base_info_get_type (container); + parent_type = gi_base_info_get_type (container); if (parent_type == GI_INFO_TYPE_OBJECT) - return g_object_info_get_method ((GIObjectInfo *) container, blob->getter); + return gi_object_info_get_method ((GIObjectInfo *) container, blob->getter); else if (parent_type == GI_INFO_TYPE_INTERFACE) - return g_interface_info_get_method ((GIInterfaceInfo *) container, blob->getter); + return gi_interface_info_get_method ((GIInterfaceInfo *) container, blob->getter); else return NULL; } diff --git a/girepository/gipropertyinfo.h b/girepository/gipropertyinfo.h index a20f2918b..6b26d69ab 100644 --- a/girepository/gipropertyinfo.h +++ b/girepository/gipropertyinfo.h @@ -39,22 +39,22 @@ G_BEGIN_DECLS * Checks if @info is a #GIPropertyInfo. */ #define GI_IS_PROPERTY_INFO(info) \ - (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_PROPERTY) + (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_PROPERTY) GI_AVAILABLE_IN_ALL -GParamFlags g_property_info_get_flags (GIPropertyInfo *info); +GParamFlags gi_property_info_get_flags (GIPropertyInfo *info); GI_AVAILABLE_IN_ALL -GITypeInfo * g_property_info_get_type (GIPropertyInfo *info); +GITypeInfo * gi_property_info_get_type (GIPropertyInfo *info); GI_AVAILABLE_IN_ALL -GITransfer g_property_info_get_ownership_transfer (GIPropertyInfo *info); +GITransfer gi_property_info_get_ownership_transfer (GIPropertyInfo *info); GI_AVAILABLE_IN_ALL -GIFunctionInfo *g_property_info_get_setter (GIPropertyInfo *info); +GIFunctionInfo *gi_property_info_get_setter (GIPropertyInfo *info); GI_AVAILABLE_IN_ALL -GIFunctionInfo *g_property_info_get_getter (GIPropertyInfo *info); +GIFunctionInfo *gi_property_info_get_getter (GIPropertyInfo *info); G_END_DECLS diff --git a/girepository/giregisteredtypeinfo.c b/girepository/giregisteredtypeinfo.c index 703bf072a..3537cf188 100644 --- a/girepository/giregisteredtypeinfo.c +++ b/girepository/giregisteredtypeinfo.c @@ -45,13 +45,13 @@ * * A registered type info struct has a name and a type function. * - * To get the name call g_registered_type_info_get_type_name(). - * Most users want to call g_registered_type_info_get_g_type() and don't worry + * To get the name call gi_registered_type_info_get_type_name(). + * Most users want to call gi_registered_type_info_get_g_type() and don't worry * about the rest of the details. */ /** - * g_registered_type_info_get_type_name: + * gi_registered_type_info_get_type_name: * @info: a #GIRegisteredTypeInfo * * Obtain the type name of the struct within the GObject type system. @@ -60,7 +60,7 @@ * Returns: the type name */ const gchar * -g_registered_type_info_get_type_name (GIRegisteredTypeInfo *info) +gi_registered_type_info_get_type_name (GIRegisteredTypeInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; RegisteredTypeBlob *blob; @@ -71,25 +71,25 @@ g_registered_type_info_get_type_name (GIRegisteredTypeInfo *info) blob = (RegisteredTypeBlob *)&rinfo->typelib->data[rinfo->offset]; if (blob->gtype_name) - return g_typelib_get_string (rinfo->typelib, blob->gtype_name); + return gi_typelib_get_string (rinfo->typelib, blob->gtype_name); return NULL; } /** - * g_registered_type_info_get_type_init: + * gi_registered_type_info_get_type_init: * @info: a #GIRegisteredTypeInfo * * Obtain the type init function for @info. The type init function is the * function which will register the GType within the GObject type system. * Usually this is not called by langauge bindings or applications, use - * g_registered_type_info_get_g_type() directly instead. + * gi_registered_type_info_get_g_type() directly instead. * * Returns: the symbol name of the type init function, suitable for * passing into g_module_symbol(). */ const gchar * -g_registered_type_info_get_type_init (GIRegisteredTypeInfo *info) +gi_registered_type_info_get_type_init (GIRegisteredTypeInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; RegisteredTypeBlob *blob; @@ -100,13 +100,13 @@ g_registered_type_info_get_type_init (GIRegisteredTypeInfo *info) blob = (RegisteredTypeBlob *)&rinfo->typelib->data[rinfo->offset]; if (blob->gtype_init) - return g_typelib_get_string (rinfo->typelib, blob->gtype_init); + return gi_typelib_get_string (rinfo->typelib, blob->gtype_init); return NULL; } /** - * g_registered_type_info_get_g_type: + * gi_registered_type_info_get_g_type: * @info: a #GIRegisteredTypeInfo * * Obtain the #GType for this registered type or G_TYPE_NONE which a special meaning. @@ -117,7 +117,7 @@ g_registered_type_info_get_type_init (GIRegisteredTypeInfo *info) * Returns: the #GType. */ GType -g_registered_type_info_get_g_type (GIRegisteredTypeInfo *info) +gi_registered_type_info_get_g_type (GIRegisteredTypeInfo *info) { const char *type_init; GType (* get_type_func) (void); @@ -126,19 +126,19 @@ g_registered_type_info_get_g_type (GIRegisteredTypeInfo *info) g_return_val_if_fail (info != NULL, G_TYPE_INVALID); g_return_val_if_fail (GI_IS_REGISTERED_TYPE_INFO (info), G_TYPE_INVALID); - type_init = g_registered_type_info_get_type_init (info); + type_init = gi_registered_type_info_get_type_init (info); if (type_init == NULL) return G_TYPE_NONE; else if (!strcmp (type_init, "intern")) /* The special string "intern" is used for some types exposed by libgobject (that therefore should be always available) */ - return g_type_from_name (g_registered_type_info_get_type_name (info)); + return g_type_from_name (gi_registered_type_info_get_type_name (info)); get_type_func = NULL; - if (!g_typelib_symbol (rinfo->typelib, - type_init, - (void**) &get_type_func)) + if (!gi_typelib_symbol (rinfo->typelib, + type_init, + (void**) &get_type_func)) return G_TYPE_NONE; return (* get_type_func) (); diff --git a/girepository/giregisteredtypeinfo.h b/girepository/giregisteredtypeinfo.h index 8dceb6dab..3c9d5359d 100644 --- a/girepository/giregisteredtypeinfo.h +++ b/girepository/giregisteredtypeinfo.h @@ -40,22 +40,22 @@ G_BEGIN_DECLS * Checks if @info is a #GIRegisteredTypeInfo or derived from it. */ #define GI_IS_REGISTERED_TYPE_INFO(info) \ - ((g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_BOXED) || \ - (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_ENUM) || \ - (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_FLAGS) || \ - (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_INTERFACE) || \ - (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_OBJECT) || \ - (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_STRUCT) || \ - (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_UNION) || \ - (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_BOXED)) + ((gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_BOXED) || \ + (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_ENUM) || \ + (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_FLAGS) || \ + (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_INTERFACE) || \ + (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_OBJECT) || \ + (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_STRUCT) || \ + (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_UNION) || \ + (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_BOXED)) GI_AVAILABLE_IN_ALL -const gchar * g_registered_type_info_get_type_name (GIRegisteredTypeInfo *info); +const gchar * gi_registered_type_info_get_type_name (GIRegisteredTypeInfo *info); GI_AVAILABLE_IN_ALL -const gchar * g_registered_type_info_get_type_init (GIRegisteredTypeInfo *info); +const gchar * gi_registered_type_info_get_type_init (GIRegisteredTypeInfo *info); GI_AVAILABLE_IN_ALL -GType g_registered_type_info_get_g_type (GIRegisteredTypeInfo *info); +GType gi_registered_type_info_get_g_type (GIRegisteredTypeInfo *info); G_END_DECLS diff --git a/girepository/girepository-private.h b/girepository/girepository-private.h index bc39b9640..67232ce1b 100644 --- a/girepository/girepository-private.h +++ b/girepository/girepository-private.h @@ -78,38 +78,38 @@ struct _GIUnresolvedInfo const gchar *namespace; }; -void _g_info_init (GIRealInfo *info, - GIInfoType type, - GIRepository *repository, - GIBaseInfo *container, - GITypelib *typelib, - guint32 offset); +void _gi_info_init (GIRealInfo *info, + GIInfoType type, + GIRepository *repository, + GIBaseInfo *container, + GITypelib *typelib, + guint32 offset); -GIBaseInfo * _g_info_from_entry (GIRepository *repository, - GITypelib *typelib, - guint16 index); +GIBaseInfo * _gi_info_from_entry (GIRepository *repository, + GITypelib *typelib, + guint16 index); -GIBaseInfo * _g_info_new_full (GIInfoType type, - GIRepository *repository, - GIBaseInfo *container, - GITypelib *typelib, - guint32 offset); +GIBaseInfo * _gi_info_new_full (GIInfoType type, + GIRepository *repository, + GIBaseInfo *container, + GITypelib *typelib, + guint32 offset); -GITypeInfo * _g_type_info_new (GIBaseInfo *container, - GITypelib *typelib, - guint32 offset); +GITypeInfo * _gi_type_info_new (GIBaseInfo *container, + GITypelib *typelib, + guint32 offset); -void _g_type_info_init (GIBaseInfo *info, - GIBaseInfo *container, - GITypelib *typelib, - guint32 offset); +void _gi_type_info_init (GIBaseInfo *info, + GIBaseInfo *container, + GITypelib *typelib, + guint32 offset); -GIFunctionInfo * _g_base_info_find_method (GIBaseInfo *base, - guint32 offset, - gint n_methods, - const gchar *name); +GIFunctionInfo * _gi_base_info_find_method (GIBaseInfo *base, + guint32 offset, + gint n_methods, + const gchar *name); -GIVFuncInfo * _g_base_info_find_vfunc (GIRealInfo *rinfo, - guint32 offset, - gint n_vfuncs, - const gchar *name); +GIVFuncInfo * _gi_base_info_find_vfunc (GIRealInfo *rinfo, + guint32 offset, + gint n_vfuncs, + const gchar *name); diff --git a/girepository/girepository.c b/girepository/girepository.c index b83410dee..85af08cde 100644 --- a/girepository/girepository.c +++ b/girepository/girepository.c @@ -50,10 +50,10 @@ * under the library directory used when compiling gobject-introspection. * * It is possible to control the search paths programmatically, using - * g_irepository_prepend_search_path(). It is also possible to modify + * gi_repository_prepend_search_path(). It is also possible to modify * the search paths by using the `GI_TYPELIB_PATH` environment variable. * The environment variable takes precedence over the default search path - * and the g_irepository_prepend_search_path() calls. + * and the gi_repository_prepend_search_path() calls. */ @@ -72,7 +72,7 @@ gtype_interface_cache_free (gpointer data) guint i; for (i = 0; i < cache->n_interfaces; i++) - g_base_info_unref ((GIBaseInfo*) cache->interfaces[i]); + gi_base_info_unref ((GIBaseInfo*) cache->interfaces[i]); g_free (cache); } @@ -86,7 +86,7 @@ struct _GIRepositoryPrivate GHashTable *unknown_gtypes; /* hashset of GType */ }; -G_DEFINE_TYPE_WITH_CODE (GIRepository, g_irepository, G_TYPE_OBJECT, G_ADD_PRIVATE (GIRepository)); +G_DEFINE_TYPE_WITH_CODE (GIRepository, gi_repository, G_TYPE_OBJECT, G_ADD_PRIVATE (GIRepository)); #ifdef G_PLATFORM_WIN32 @@ -124,13 +124,13 @@ DllMain (HINSTANCE hinstDLL, #endif static void -g_irepository_init (GIRepository *repository) +gi_repository_init (GIRepository *repository) { - repository->priv = g_irepository_get_instance_private (repository); + repository->priv = gi_repository_get_instance_private (repository); repository->priv->typelibs = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) NULL, - (GDestroyNotify) g_typelib_free); + (GDestroyNotify) gi_typelib_free); repository->priv->lazy_typelibs = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) g_free, @@ -138,11 +138,11 @@ g_irepository_init (GIRepository *repository) repository->priv->info_by_gtype = g_hash_table_new_full (g_direct_hash, g_direct_equal, (GDestroyNotify) NULL, - (GDestroyNotify) g_base_info_unref); + (GDestroyNotify) gi_base_info_unref); repository->priv->info_by_error_domain = g_hash_table_new_full (g_direct_hash, g_direct_equal, (GDestroyNotify) NULL, - (GDestroyNotify) g_base_info_unref); + (GDestroyNotify) gi_base_info_unref); repository->priv->interfaces_for_gtype = g_hash_table_new_full (g_direct_hash, g_direct_equal, (GDestroyNotify) NULL, @@ -151,9 +151,9 @@ g_irepository_init (GIRepository *repository) } static void -g_irepository_finalize (GObject *object) +gi_repository_finalize (GObject *object) { - GIRepository *repository = G_IREPOSITORY (object); + GIRepository *repository = GI_REPOSITORY (object); g_hash_table_destroy (repository->priv->typelibs); g_hash_table_destroy (repository->priv->lazy_typelibs); @@ -162,17 +162,17 @@ g_irepository_finalize (GObject *object) g_hash_table_destroy (repository->priv->interfaces_for_gtype); g_hash_table_destroy (repository->priv->unknown_gtypes); - (* G_OBJECT_CLASS (g_irepository_parent_class)->finalize) (G_OBJECT (repository)); + (* G_OBJECT_CLASS (gi_repository_parent_class)->finalize) (G_OBJECT (repository)); } static void -g_irepository_class_init (GIRepositoryClass *class) +gi_repository_class_init (GIRepositoryClass *class) { GObjectClass *gobject_class; gobject_class = G_OBJECT_CLASS (class); - gobject_class->finalize = g_irepository_finalize; + gobject_class->finalize = gi_repository_finalize; } static void @@ -184,7 +184,7 @@ init_globals (void) return; if (default_repository == NULL) - default_repository = g_object_new (G_TYPE_IREPOSITORY, NULL); + default_repository = g_object_new (GI_TYPE_REPOSITORY, NULL); if (typelib_search_path == NULL) { @@ -194,7 +194,7 @@ init_globals (void) /* This variable is intended to take precedence over both: * - the default search path; - * - all g_irepository_prepend_search_path() calls. + * - all gi_repository_prepend_search_path() calls. */ type_lib_path_env = g_getenv ("GI_TYPELIB_PATH"); @@ -230,23 +230,23 @@ init_globals (void) } /** - * g_irepository_prepend_search_path: + * gi_repository_prepend_search_path: * @directory: (type filename): directory name to prepend to the typelib * search path * * Prepends @directory to the typelib search path. * - * See also: g_irepository_get_search_path(). + * See also: gi_repository_get_search_path(). */ void -g_irepository_prepend_search_path (const char *directory) +gi_repository_prepend_search_path (const char *directory) { init_globals (); typelib_search_path = g_slist_prepend (typelib_search_path, g_strdup (directory)); } /** - * g_irepository_get_search_path: + * gi_repository_get_search_path: * * Returns the current search path #GIRepository will use when loading * typelib files. The list is internal to #GIRepository and should not @@ -255,7 +255,7 @@ g_irepository_prepend_search_path (const char *directory) * Returns: (element-type filename) (transfer none): #GSList of strings */ GSList * -g_irepository_get_search_path (void) +gi_repository_get_search_path (void) { return typelib_search_path; } @@ -282,7 +282,7 @@ get_typelib_dependencies (GITypelib *typelib) if (header->dependencies == 0) return NULL; - dependencies_glob = g_typelib_get_string (typelib, header->dependencies); + dependencies_glob = gi_typelib_get_string (typelib, header->dependencies); return g_strsplit (dependencies_glob, "|", 0); } @@ -314,7 +314,7 @@ check_version_conflict (GITypelib *typelib, } header = (Header*)typelib->data; - loaded_version = g_typelib_get_string (typelib, header->nsversion); + loaded_version = gi_typelib_get_string (typelib, header->nsversion); g_assert (loaded_version != NULL); if (strcmp (expected_version, loaded_version) != 0) @@ -385,7 +385,7 @@ load_dependencies_recurse (GIRepository *repository, dependency_namespace = g_strndup (dependency, last_dash - dependency); dependency_version = last_dash+1; - if (!g_irepository_require (repository, dependency_namespace, dependency_version, + if (!gi_repository_require (repository, dependency_namespace, dependency_version, 0, error)) { g_free (dependency_namespace); @@ -415,7 +415,7 @@ register_internal (GIRepository *repository, g_return_val_if_fail (header != NULL, FALSE); - namespace = g_typelib_get_string (typelib, header->namespace); + namespace = gi_typelib_get_string (typelib, header->namespace); if (lazy) { @@ -451,7 +451,7 @@ register_internal (GIRepository *repository, } /** - * g_irepository_get_immediate_dependencies: + * gi_repository_get_immediate_dependencies: * @repository: (nullable): A #GIRepository or %NULL for the singleton * process-global default #GIRepository * @namespace_: Namespace of interest @@ -460,10 +460,10 @@ register_internal (GIRepository *repository, * Returned strings are of the form `namespace-version`. * * Note: @namespace_ must have already been loaded using a function - * such as g_irepository_require() before calling this function. + * such as gi_repository_require() before calling this function. * * To get the transitive closure of dependencies for @namespace_, use - * g_irepository_get_dependencies(). + * gi_repository_get_dependencies(). * * Returns: (transfer full): Zero-terminated string array of immediate versioned * dependencies @@ -471,7 +471,7 @@ register_internal (GIRepository *repository, * Since: 1.44 */ char ** -g_irepository_get_immediate_dependencies (GIRepository *repository, +gi_repository_get_immediate_dependencies (GIRepository *repository, const char *namespace) { GITypelib *typelib; @@ -534,7 +534,7 @@ get_typelib_dependencies_transitive (GIRepository *repository, } /** - * g_irepository_get_dependencies: + * gi_repository_get_dependencies: * @repository: (allow-none): A #GIRepository or %NULL for the singleton * process-global default #GIRepository * @namespace_: Namespace of interest @@ -545,16 +545,16 @@ get_typelib_dependencies_transitive (GIRepository *repository, * The strings are of the form `namespace-version`. * * Note: @namespace_ must have already been loaded using a function - * such as g_irepository_require() before calling this function. + * such as gi_repository_require() before calling this function. * * To get only the immediate dependencies for @namespace_, use - * g_irepository_get_immediate_dependencies(). + * gi_repository_get_immediate_dependencies(). * * Returns: (transfer full) (array zero-terminated=1): all versioned * dependencies */ char ** -g_irepository_get_dependencies (GIRepository *repository, +gi_repository_get_dependencies (GIRepository *repository, const char *namespace) { GITypelib *typelib; @@ -596,7 +596,7 @@ g_irepository_get_dependencies (GIRepository *repository, } /** - * g_irepository_load_typelib: + * gi_repository_load_typelib: * @repository: (allow-none): A #GIRepository or %NULL for the singleton * process-global default #GIRepository * @typelib: TODO @@ -606,7 +606,7 @@ g_irepository_get_dependencies (GIRepository *repository, * TODO */ const char * -g_irepository_load_typelib (GIRepository *repository, +gi_repository_load_typelib (GIRepository *repository, GITypelib *typelib, GIRepositoryLoadFlags flags, GError **error) @@ -614,23 +614,23 @@ g_irepository_load_typelib (GIRepository *repository, Header *header; const char *namespace; const char *nsversion; - gboolean allow_lazy = flags & G_IREPOSITORY_LOAD_FLAG_LAZY; + gboolean allow_lazy = flags & GI_REPOSITORY_LOAD_FLAG_LAZY; gboolean is_lazy; char *version_conflict; repository = get_repository (repository); header = (Header *) typelib->data; - namespace = g_typelib_get_string (typelib, header->namespace); - nsversion = g_typelib_get_string (typelib, header->nsversion); + namespace = gi_typelib_get_string (typelib, header->namespace); + nsversion = gi_typelib_get_string (typelib, header->nsversion); if (get_registered_status (repository, namespace, nsversion, allow_lazy, &is_lazy, &version_conflict)) { if (version_conflict != NULL) { - g_set_error (error, G_IREPOSITORY_ERROR, - G_IREPOSITORY_ERROR_NAMESPACE_VERSION_CONFLICT, + g_set_error (error, GI_REPOSITORY_ERROR, + GI_REPOSITORY_ERROR_NAMESPACE_VERSION_CONFLICT, "Attempting to load namespace '%s', version '%s', but '%s' is already loaded", namespace, nsversion, version_conflict); return NULL; @@ -642,7 +642,7 @@ g_irepository_load_typelib (GIRepository *repository, } /** - * g_irepository_is_registered: + * gi_repository_is_registered: * @repository: (allow-none): A #GIRepository or %NULL for the singleton * process-global default #GIRepository * @namespace_: Namespace of interest @@ -651,14 +651,14 @@ g_irepository_load_typelib (GIRepository *repository, * Check whether a particular namespace (and optionally, a specific * version thereof) is currently loaded. This function is likely to * only be useful in unusual circumstances; in order to act upon - * metadata in the namespace, you should call g_irepository_require() + * metadata in the namespace, you should call gi_repository_require() * instead which will ensure the namespace is loaded, and return as * quickly as this function will if it has already been loaded. * * Returns: %TRUE if namespace-version is loaded, %FALSE otherwise */ gboolean -g_irepository_is_registered (GIRepository *repository, +gi_repository_is_registered (GIRepository *repository, const gchar *namespace, const gchar *version) { @@ -667,7 +667,7 @@ g_irepository_is_registered (GIRepository *repository, } /** - * g_irepository_get_default: + * gi_repository_get_default: * * Returns the singleton process-global default #GIRepository. It is * not currently supported to have multiple repositories in a @@ -683,13 +683,13 @@ g_irepository_is_registered (GIRepository *repository, * Returns: (transfer none): The global singleton #GIRepository */ GIRepository * -g_irepository_get_default (void) +gi_repository_get_default (void) { return get_repository (NULL); } /** - * g_irepository_get_n_infos: + * gi_repository_get_n_infos: * @repository: (allow-none): A #GIRepository or %NULL for the singleton * process-global default #GIRepository * @namespace_: Namespace to inspect @@ -701,7 +701,7 @@ g_irepository_get_default (void) * Returns: number of metadata entries */ gint -g_irepository_get_n_infos (GIRepository *repository, +gi_repository_get_n_infos (GIRepository *repository, const gchar *namespace) { GITypelib *typelib; @@ -721,7 +721,7 @@ g_irepository_get_n_infos (GIRepository *repository, } /** - * g_irepository_get_info: + * gi_repository_get_info: * @repository: (allow-none): A #GIRepository or %NULL for the singleton * process-global default #GIRepository * @namespace_: Namespace to inspect @@ -730,13 +730,13 @@ g_irepository_get_n_infos (GIRepository *repository, * This function returns a particular metadata entry in the * given namespace @namespace_. The namespace must have * already been loaded before calling this function. - * See g_irepository_get_n_infos() to find the maximum number of + * See gi_repository_get_n_infos() to find the maximum number of * entries. * * Returns: (transfer full): #GIBaseInfo containing metadata */ GIBaseInfo * -g_irepository_get_info (GIRepository *repository, +gi_repository_get_info (GIRepository *repository, const gchar *namespace, gint index) { @@ -751,12 +751,12 @@ g_irepository_get_info (GIRepository *repository, g_return_val_if_fail (typelib != NULL, NULL); - entry = g_typelib_get_dir_entry (typelib, index + 1); + entry = gi_typelib_get_dir_entry (typelib, index + 1); if (entry == NULL) return NULL; - return _g_info_new_full (entry->blob_type, - repository, - NULL, typelib, entry->offset); + return _gi_info_new_full (entry->blob_type, + repository, + NULL, typelib, entry->offset); } typedef struct { @@ -777,11 +777,11 @@ find_by_gtype (GHashTable *table, FindByGTypeData *data, gboolean check_prefix) GITypelib *typelib = (GITypelib*)value; if (check_prefix) { - if (!g_typelib_matches_gtype_name_prefix (typelib, data->gtype_name)) + if (!gi_typelib_matches_gtype_name_prefix (typelib, data->gtype_name)) continue; } - ret = g_typelib_get_dir_entry_by_gtype_name (typelib, data->gtype_name); + ret = gi_typelib_get_dir_entry_by_gtype_name (typelib, data->gtype_name); if (ret) { data->result_typelib = typelib; @@ -793,7 +793,7 @@ find_by_gtype (GHashTable *table, FindByGTypeData *data, gboolean check_prefix) } /** - * g_irepository_find_by_gtype: + * gi_repository_find_by_gtype: * @repository: (allow-none): A #GIRepository or %NULL for the singleton * process-global default #GIRepository * @gtype: GType to search for @@ -808,7 +808,7 @@ find_by_gtype (GHashTable *table, FindByGTypeData *data, gboolean check_prefix) * Returns: (transfer full): #GIBaseInfo representing metadata about @type, or %NULL */ GIBaseInfo * -g_irepository_find_by_gtype (GIRepository *repository, +gi_repository_find_by_gtype (GIRepository *repository, GType gtype) { FindByGTypeData data; @@ -823,7 +823,7 @@ g_irepository_find_by_gtype (GIRepository *repository, (gpointer)gtype); if (cached != NULL) - return g_base_info_ref (cached); + return gi_base_info_ref (cached); if (g_hash_table_contains (repository->priv->unknown_gtypes, (gpointer)gtype)) return NULL; @@ -854,13 +854,13 @@ g_irepository_find_by_gtype (GIRepository *repository, if (entry != NULL) { - cached = _g_info_new_full (entry->blob_type, - repository, - NULL, data.result_typelib, entry->offset); + cached = _gi_info_new_full (entry->blob_type, + repository, + NULL, data.result_typelib, entry->offset); g_hash_table_insert (repository->priv->info_by_gtype, (gpointer) gtype, - g_base_info_ref (cached)); + gi_base_info_ref (cached)); return cached; } else @@ -871,7 +871,7 @@ g_irepository_find_by_gtype (GIRepository *repository, } /** - * g_irepository_find_by_name: + * gi_repository_find_by_name: * @repository: (allow-none): A #GIRepository or %NULL for the singleton * process-global default #GIRepository * @namespace_: Namespace which will be searched @@ -879,13 +879,13 @@ g_irepository_find_by_gtype (GIRepository *repository, * * Searches for a particular entry in a namespace. Before calling * this function for a particular namespace, you must call - * g_irepository_require() once to load the namespace, or otherwise + * gi_repository_require() once to load the namespace, or otherwise * ensure the namespace has already been loaded. * * Returns: (transfer full): #GIBaseInfo representing metadata about @name, or %NULL */ GIBaseInfo * -g_irepository_find_by_name (GIRepository *repository, +gi_repository_find_by_name (GIRepository *repository, const gchar *namespace, const gchar *name) { @@ -898,12 +898,12 @@ g_irepository_find_by_name (GIRepository *repository, typelib = get_registered (repository, namespace, NULL); g_return_val_if_fail (typelib != NULL, NULL); - entry = g_typelib_get_dir_entry_by_name (typelib, name); + entry = gi_typelib_get_dir_entry_by_name (typelib, name); if (entry == NULL) return NULL; - return _g_info_new_full (entry->blob_type, - repository, - NULL, typelib, entry->offset); + return _gi_info_new_full (entry->blob_type, + repository, + NULL, typelib, entry->offset); } typedef struct { @@ -925,20 +925,20 @@ find_by_error_domain_foreach (gpointer key, if (data->result != NULL) return; - data->result = g_typelib_get_dir_entry_by_error_domain (typelib, data->domain); + data->result = gi_typelib_get_dir_entry_by_error_domain (typelib, data->domain); if (data->result) data->result_typelib = typelib; } /** - * g_irepository_find_by_error_domain: + * gi_repository_find_by_error_domain: * @repository: (allow-none): A #GIRepository or %NULL for the singleton * process-global default #GIRepository * @domain: a #GError domain * * Searches for the enum type corresponding to the given #GError * domain. Before calling this function for a particular namespace, - * you must call g_irepository_require() once to load the namespace, or + * you must call gi_repository_require() once to load the namespace, or * otherwise ensure the namespace has already been loaded. * * Returns: (transfer full): #GIEnumInfo representing metadata about @domain's @@ -946,7 +946,7 @@ find_by_error_domain_foreach (gpointer key, * Since: 1.30 */ GIEnumInfo * -g_irepository_find_by_error_domain (GIRepository *repository, +gi_repository_find_by_error_domain (GIRepository *repository, GQuark domain) { FindByErrorDomainData data; @@ -958,7 +958,7 @@ g_irepository_find_by_error_domain (GIRepository *repository, GUINT_TO_POINTER (domain)); if (cached != NULL) - return g_base_info_ref ((GIBaseInfo *)cached); + return gi_base_info_ref ((GIBaseInfo *)cached); data.repository = repository; data.domain = domain; @@ -971,20 +971,20 @@ g_irepository_find_by_error_domain (GIRepository *repository, if (data.result != NULL) { - cached = _g_info_new_full (data.result->blob_type, - repository, - NULL, data.result_typelib, data.result->offset); + cached = _gi_info_new_full (data.result->blob_type, + repository, + NULL, data.result_typelib, data.result->offset); g_hash_table_insert (repository->priv->info_by_error_domain, GUINT_TO_POINTER (domain), - g_base_info_ref (cached)); + gi_base_info_ref (cached)); return cached; } return NULL; } /** - * g_irepository_get_object_gtype_interfaces: + * gi_repository_get_object_gtype_interfaces: * @repository: (nullable): a #GIRepository, or %NULL for the default repository * @gtype: a #GType whose fundamental type is G_TYPE_OBJECT * @n_interfaces_out: (out): Number of interfaces @@ -1005,7 +1005,7 @@ g_irepository_find_by_error_domain (GIRepository *repository, * Since: 1.62 */ void -g_irepository_get_object_gtype_interfaces (GIRepository *repository, +gi_repository_get_object_gtype_interfaces (GIRepository *repository, GType gtype, guint *n_interfaces_out, GIInterfaceInfo ***interfaces_out) @@ -1030,14 +1030,14 @@ g_irepository_get_object_gtype_interfaces (GIRepository *repository, { GIBaseInfo *base_info; - base_info = g_irepository_find_by_gtype (repository, interfaces[i]); + base_info = gi_repository_find_by_gtype (repository, interfaces[i]); if (base_info == NULL) continue; - if (g_base_info_get_type (base_info) != GI_INFO_TYPE_INTERFACE) + if (gi_base_info_get_type (base_info) != GI_INFO_TYPE_INTERFACE) { /* FIXME - could this really happen? */ - g_base_info_unref (base_info); + gi_base_info_unref (base_info); continue; } @@ -1073,7 +1073,7 @@ collect_namespaces (gpointer key, } /** - * g_irepository_get_loaded_namespaces: + * gi_repository_get_loaded_namespaces: * @repository: (allow-none): A #GIRepository or %NULL for the singleton * process-global default #GIRepository * @@ -1082,7 +1082,7 @@ collect_namespaces (gpointer key, * Returns: (element-type utf8) (transfer full): List of namespaces */ gchar ** -g_irepository_get_loaded_namespaces (GIRepository *repository) +gi_repository_get_loaded_namespaces (GIRepository *repository) { GList *l, *list = NULL; gchar **names; @@ -1103,7 +1103,7 @@ g_irepository_get_loaded_namespaces (GIRepository *repository) } /** - * g_irepository_get_version: + * gi_repository_get_version: * @repository: (allow-none): A #GIRepository or %NULL for the singleton * process-global default #GIRepository * @namespace_: Namespace to inspect @@ -1112,12 +1112,12 @@ g_irepository_get_loaded_namespaces (GIRepository *repository) * namespace @namespace_. * * Note: The namespace must have already been loaded using a function - * such as g_irepository_require() before calling this function. + * such as gi_repository_require() before calling this function. * * Returns: Loaded version */ const gchar * -g_irepository_get_version (GIRepository *repository, +gi_repository_get_version (GIRepository *repository, const gchar *namespace) { GITypelib *typelib; @@ -1132,11 +1132,11 @@ g_irepository_get_version (GIRepository *repository, g_return_val_if_fail (typelib != NULL, NULL); header = (Header *) typelib->data; - return g_typelib_get_string (typelib, header->nsversion); + return gi_typelib_get_string (typelib, header->nsversion); } /** - * g_irepository_get_shared_library: + * gi_repository_get_shared_library: * @repository: (allow-none): A #GIRepository or %NULL for the singleton * process-global default #GIRepository * @namespace_: Namespace to inspect @@ -1147,13 +1147,13 @@ g_irepository_get_version (GIRepository *repository, * function will return %NULL. * * Note: The namespace must have already been loaded using a function - * such as g_irepository_require() before calling this function. + * such as gi_repository_require() before calling this function. * * Returns: (nullable): Comma-separated list of paths to shared libraries, * or %NULL if none are associated */ const gchar * -g_irepository_get_shared_library (GIRepository *repository, +gi_repository_get_shared_library (GIRepository *repository, const gchar *namespace) { GITypelib *typelib; @@ -1169,13 +1169,13 @@ g_irepository_get_shared_library (GIRepository *repository, header = (Header *) typelib->data; if (header->shared_library) - return g_typelib_get_string (typelib, header->shared_library); + return gi_typelib_get_string (typelib, header->shared_library); else return NULL; } /** - * g_irepository_get_c_prefix: + * gi_repository_get_c_prefix: * @repository: (allow-none): A #GIRepository or %NULL for the singleton * process-global default #GIRepository * @namespace_: Namespace to inspect @@ -1185,12 +1185,12 @@ g_irepository_get_shared_library (GIRepository *repository, * starts with this prefix, as well each #GType in the library. * * Note: The namespace must have already been loaded using a function - * such as g_irepository_require() before calling this function. + * such as gi_repository_require() before calling this function. * * Returns: C namespace prefix, or %NULL if none associated */ const gchar * -g_irepository_get_c_prefix (GIRepository *repository, +gi_repository_get_c_prefix (GIRepository *repository, const gchar *namespace_) { GITypelib *typelib; @@ -1206,13 +1206,13 @@ g_irepository_get_c_prefix (GIRepository *repository, header = (Header *) typelib->data; if (header->c_prefix) - return g_typelib_get_string (typelib, header->c_prefix); + return gi_typelib_get_string (typelib, header->c_prefix); else return NULL; } /** - * g_irepository_get_typelib_path: + * gi_repository_get_typelib_path: * @repository: (allow-none): A #GIRepository or %NULL for the singleton * process-global default #GIRepository * @namespace_: GI namespace to use, e.g. "Gtk" @@ -1226,7 +1226,7 @@ g_irepository_get_c_prefix (GIRepository *repository, */ const gchar * -g_irepository_get_typelib_path (GIRepository *repository, +gi_repository_get_typelib_path (GIRepository *repository, const gchar *namespace) { gpointer orig_key, value; @@ -1488,7 +1488,7 @@ find_namespace_latest (const gchar *namespace, } /** - * g_irepository_enumerate_versions: + * gi_repository_enumerate_versions: * @repository: (allow-none): A #GIRepository or %NULL for the singleton * process-global default #GIRepository * @namespace_: GI namespace, e.g. "Gtk" @@ -1499,7 +1499,7 @@ find_namespace_latest (const gchar *namespace, * Returns: (element-type utf8) (transfer full): the array of versions. */ GList * -g_irepository_enumerate_versions (GIRepository *repository, +gi_repository_enumerate_versions (GIRepository *repository, const gchar *namespace_) { GList *ret = NULL; @@ -1521,9 +1521,9 @@ g_irepository_enumerate_versions (GIRepository *repository, * available versions, as it could have been loaded using * require_private(). */ - if (g_irepository_is_registered (repository, namespace_, NULL)) + if (gi_repository_is_registered (repository, namespace_, NULL)) { - loaded_version = g_irepository_get_version (repository, namespace_); + loaded_version = gi_repository_get_version (repository, namespace_); if (loaded_version && !g_list_find_custom (ret, loaded_version, g_str_equal)) ret = g_list_prepend (ret, g_strdup (loaded_version)); } @@ -1544,7 +1544,7 @@ require_internal (GIRepository *repository, Header *header; GITypelib *typelib = NULL; const gchar *typelib_namespace, *typelib_version; - gboolean allow_lazy = (flags & G_IREPOSITORY_LOAD_FLAG_LAZY) > 0; + gboolean allow_lazy = (flags & GI_REPOSITORY_LOAD_FLAG_LAZY) > 0; gboolean is_lazy; char *version_conflict = NULL; char *path = NULL; @@ -1561,8 +1561,8 @@ require_internal (GIRepository *repository, if (version_conflict != NULL) { - g_set_error (error, G_IREPOSITORY_ERROR, - G_IREPOSITORY_ERROR_NAMESPACE_VERSION_CONFLICT, + g_set_error (error, GI_REPOSITORY_ERROR, + GI_REPOSITORY_ERROR_NAMESPACE_VERSION_CONFLICT, "Requiring namespace '%s' version '%s', but '%s' is already loaded", namespace, version, version_conflict); return NULL; @@ -1583,13 +1583,13 @@ require_internal (GIRepository *repository, if (mfile == NULL) { if (version != NULL) - g_set_error (error, G_IREPOSITORY_ERROR, - G_IREPOSITORY_ERROR_TYPELIB_NOT_FOUND, + g_set_error (error, GI_REPOSITORY_ERROR, + GI_REPOSITORY_ERROR_TYPELIB_NOT_FOUND, "Typelib file for namespace '%s', version '%s' not found", namespace, version); else - g_set_error (error, G_IREPOSITORY_ERROR, - G_IREPOSITORY_ERROR_TYPELIB_NOT_FOUND, + g_set_error (error, GI_REPOSITORY_ERROR, + GI_REPOSITORY_ERROR_TYPELIB_NOT_FOUND, "Typelib file for namespace '%s' (any version) not found", namespace); goto out; @@ -1597,11 +1597,11 @@ require_internal (GIRepository *repository, { GError *temp_error = NULL; - typelib = g_typelib_new_from_mapped_file (mfile, &temp_error); + typelib = gi_typelib_new_from_mapped_file (mfile, &temp_error); if (!typelib) { - g_set_error (error, G_IREPOSITORY_ERROR, - G_IREPOSITORY_ERROR_TYPELIB_NOT_FOUND, + g_set_error (error, GI_REPOSITORY_ERROR, + GI_REPOSITORY_ERROR_TYPELIB_NOT_FOUND, "Failed to load typelib file '%s' for namespace '%s': %s", path, namespace, temp_error->message); g_clear_error (&temp_error); @@ -1609,34 +1609,34 @@ require_internal (GIRepository *repository, } } header = (Header *) typelib->data; - typelib_namespace = g_typelib_get_string (typelib, header->namespace); - typelib_version = g_typelib_get_string (typelib, header->nsversion); + typelib_namespace = gi_typelib_get_string (typelib, header->namespace); + typelib_version = gi_typelib_get_string (typelib, header->nsversion); if (strcmp (typelib_namespace, namespace) != 0) { - g_set_error (error, G_IREPOSITORY_ERROR, - G_IREPOSITORY_ERROR_NAMESPACE_MISMATCH, + g_set_error (error, GI_REPOSITORY_ERROR, + GI_REPOSITORY_ERROR_NAMESPACE_MISMATCH, "Typelib file %s for namespace '%s' contains " "namespace '%s' which doesn't match the file name", path, namespace, typelib_namespace); - g_typelib_free (typelib); + gi_typelib_free (typelib); goto out; } if (version != NULL && strcmp (typelib_version, version) != 0) { - g_set_error (error, G_IREPOSITORY_ERROR, - G_IREPOSITORY_ERROR_NAMESPACE_MISMATCH, + g_set_error (error, GI_REPOSITORY_ERROR, + GI_REPOSITORY_ERROR_NAMESPACE_MISMATCH, "Typelib file %s for namespace '%s' contains " "version '%s' which doesn't match the expected version '%s'", path, namespace, typelib_version, version); - g_typelib_free (typelib); + gi_typelib_free (typelib); goto out; } if (!register_internal (repository, path, allow_lazy, typelib, error)) { - g_typelib_free (typelib); + gi_typelib_free (typelib); goto out; } ret = typelib; @@ -1647,7 +1647,7 @@ require_internal (GIRepository *repository, } /** - * g_irepository_require: + * gi_repository_require: * @repository: (allow-none): A #GIRepository or %NULL for the singleton * process-global default #GIRepository * @namespace_: GI namespace to use, e.g. "Gtk" @@ -1664,7 +1664,7 @@ require_internal (GIRepository *repository, * Returns: (transfer none): a pointer to the #GITypelib if successful, %NULL otherwise */ GITypelib * -g_irepository_require (GIRepository *repository, +gi_repository_require (GIRepository *repository, const gchar *namespace, const gchar *version, GIRepositoryLoadFlags flags, @@ -1680,7 +1680,7 @@ g_irepository_require (GIRepository *repository, } /** - * g_irepository_require_private: + * gi_repository_require_private: * @repository: (allow-none): A #GIRepository or %NULL for the singleton * process-global default #GIRepository * @typelib_dir: Private directory where to find the requested typelib @@ -1698,7 +1698,7 @@ g_irepository_require (GIRepository *repository, * Returns: (transfer none): a pointer to the #GITypelib if successful, %NULL otherwise */ GITypelib * -g_irepository_require_private (GIRepository *repository, +gi_repository_require_private (GIRepository *repository, const gchar *typelib_dir, const gchar *namespace, const gchar *version, @@ -1712,13 +1712,13 @@ g_irepository_require_private (GIRepository *repository, } static gboolean -g_irepository_introspect_cb (const char *option_name, +gi_repository_introspect_cb (const char *option_name, const char *value, gpointer data, GError **error) { GError *tmp_error = NULL; - gboolean ret = g_irepository_dump (value, &tmp_error); + gboolean ret = gi_repository_dump (value, &tmp_error); if (!ret) { g_error ("Failed to extract GType data: %s", @@ -1730,13 +1730,13 @@ g_irepository_introspect_cb (const char *option_name, static const GOptionEntry introspection_args[] = { { "introspect-dump", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_CALLBACK, - g_irepository_introspect_cb, "Dump introspection information", + gi_repository_introspect_cb, "Dump introspection information", "infile.txt,outfile.xml" }, G_OPTION_ENTRY_NULL }; /** - * g_irepository_get_option_group: + * gi_repository_get_option_group: * * Obtain the option group for girepository, it's used * by the dumper and for programs that wants to provide @@ -1745,7 +1745,7 @@ static const GOptionEntry introspection_args[] = { * Returns: (transfer full): the option group */ GOptionGroup * -g_irepository_get_option_group (void) +gi_repository_get_option_group (void) { GOptionGroup *group; group = g_option_group_new ("girepository", "Introspection Options", "Show Introspection Options", NULL, NULL); @@ -1755,7 +1755,7 @@ g_irepository_get_option_group (void) } GQuark -g_irepository_error_quark (void) +gi_repository_error_quark (void) { static GQuark quark = 0; if (quark == 0) @@ -1764,7 +1764,7 @@ g_irepository_error_quark (void) } /** - * g_type_tag_to_string: + * gi_type_tag_to_string: * @type: the type_tag * * Obtain a string representation of @type @@ -1772,7 +1772,7 @@ g_irepository_error_quark (void) * Returns: the string */ const gchar* -g_type_tag_to_string (GITypeTag type) +gi_type_tag_to_string (GITypeTag type) { switch (type) { @@ -1826,7 +1826,7 @@ g_type_tag_to_string (GITypeTag type) } /** - * g_info_type_to_string: + * gi_info_type_to_string: * @type: the info type * * Obtain a string representation of @type @@ -1834,7 +1834,7 @@ g_type_tag_to_string (GITypeTag type) * Returns: the string */ const gchar* -g_info_type_to_string (GIInfoType type) +gi_info_type_to_string (GIInfoType type) { switch (type) { diff --git a/girepository/girepository.h b/girepository/girepository.h index 772a32151..7cf9a6768 100644 --- a/girepository/girepository.h +++ b/girepository/girepository.h @@ -52,12 +52,12 @@ G_BEGIN_DECLS -#define G_TYPE_IREPOSITORY (g_irepository_get_type ()) -#define G_IREPOSITORY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), G_TYPE_IREPOSITORY, GIRepository)) -#define G_IREPOSITORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G_TYPE_IREPOSITORY, GIRepositoryClass)) -#define G_IS_IREPOSITORY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), G_TYPE_IREPOSITORY)) -#define G_IS_IREPOSITORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G_TYPE_IREPOSITORY)) -#define G_IREPOSITORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G_TYPE_IREPOSITORY, GIRepositoryClass)) +#define GI_TYPE_REPOSITORY (gi_repository_get_type ()) +#define GI_REPOSITORY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GI_TYPE_REPOSITORY, GIRepository)) +#define GI_REPOSITORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GI_TYPE_REPOSITORY, GIRepositoryClass)) +#define GI_IS_REPOSITORY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GI_TYPE_REPOSITORY)) +#define GI_IS_REPOSITORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GI_TYPE_REPOSITORY)) +#define GI_REPOSITORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GI_TYPE_REPOSITORY, GIRepositoryClass)) /** * GIRepository: @@ -84,154 +84,154 @@ struct _GIRepositoryClass /** * GIRepositoryLoadFlags: - * @G_IREPOSITORY_LOAD_FLAG_LAZY: Lazily load the typelib. + * @GI_REPOSITORY_LOAD_FLAG_LAZY: Lazily load the typelib. * * Flags that control how a typelib is loaded. */ typedef enum { - G_IREPOSITORY_LOAD_FLAG_LAZY = 1 << 0 + GI_REPOSITORY_LOAD_FLAG_LAZY = 1 << 0 } GIRepositoryLoadFlags; /* Repository */ GI_AVAILABLE_IN_ALL -GType g_irepository_get_type (void) G_GNUC_CONST; +GType gi_repository_get_type (void) G_GNUC_CONST; GI_AVAILABLE_IN_ALL -GIRepository *g_irepository_get_default (void); +GIRepository *gi_repository_get_default (void); GI_AVAILABLE_IN_ALL -void g_irepository_prepend_search_path (const char *directory); +void gi_repository_prepend_search_path (const char *directory); GI_AVAILABLE_IN_ALL -void g_irepository_prepend_library_path (const char *directory); +void gi_repository_prepend_library_path (const char *directory); GI_AVAILABLE_IN_ALL -GSList * g_irepository_get_search_path (void); +GSList * gi_repository_get_search_path (void); GI_AVAILABLE_IN_ALL -const char * g_irepository_load_typelib (GIRepository *repository, - GITypelib *typelib, - GIRepositoryLoadFlags flags, - GError **error); +const char * gi_repository_load_typelib (GIRepository *repository, + GITypelib *typelib, + GIRepositoryLoadFlags flags, + GError **error); GI_AVAILABLE_IN_ALL -gboolean g_irepository_is_registered (GIRepository *repository, - const gchar *namespace_, - const gchar *version); +gboolean gi_repository_is_registered (GIRepository *repository, + const gchar *namespace_, + const gchar *version); GI_AVAILABLE_IN_ALL -GIBaseInfo * g_irepository_find_by_name (GIRepository *repository, - const gchar *namespace_, - const gchar *name); +GIBaseInfo * gi_repository_find_by_name (GIRepository *repository, + const gchar *namespace_, + const gchar *name); GI_AVAILABLE_IN_ALL -GList * g_irepository_enumerate_versions (GIRepository *repository, - const gchar *namespace_); +GList * gi_repository_enumerate_versions (GIRepository *repository, + const gchar *namespace_); GI_AVAILABLE_IN_ALL -GITypelib * g_irepository_require (GIRepository *repository, - const gchar *namespace_, - const gchar *version, - GIRepositoryLoadFlags flags, - GError **error); +GITypelib * gi_repository_require (GIRepository *repository, + const gchar *namespace_, + const gchar *version, + GIRepositoryLoadFlags flags, + GError **error); GI_AVAILABLE_IN_ALL -GITypelib * g_irepository_require_private (GIRepository *repository, - const gchar *typelib_dir, - const gchar *namespace_, - const gchar *version, - GIRepositoryLoadFlags flags, - GError **error); +GITypelib * gi_repository_require_private (GIRepository *repository, + const gchar *typelib_dir, + const gchar *namespace_, + const gchar *version, + GIRepositoryLoadFlags flags, + GError **error); GI_AVAILABLE_IN_ALL -gchar ** g_irepository_get_immediate_dependencies (GIRepository *repository, +gchar ** gi_repository_get_immediate_dependencies (GIRepository *repository, const gchar *namespace_); GI_AVAILABLE_IN_ALL -gchar ** g_irepository_get_dependencies (GIRepository *repository, - const gchar *namespace_); +gchar ** gi_repository_get_dependencies (GIRepository *repository, + const gchar *namespace_); GI_AVAILABLE_IN_ALL -gchar ** g_irepository_get_loaded_namespaces (GIRepository *repository); +gchar ** gi_repository_get_loaded_namespaces (GIRepository *repository); GI_AVAILABLE_IN_ALL -GIBaseInfo * g_irepository_find_by_gtype (GIRepository *repository, - GType gtype); +GIBaseInfo * gi_repository_find_by_gtype (GIRepository *repository, + GType gtype); GI_AVAILABLE_IN_ALL -void g_irepository_get_object_gtype_interfaces (GIRepository *repository, +void gi_repository_get_object_gtype_interfaces (GIRepository *repository, GType gtype, guint *n_interfaces_out, GIInterfaceInfo ***interfaces_out); GI_AVAILABLE_IN_ALL -gint g_irepository_get_n_infos (GIRepository *repository, - const gchar *namespace_); +gint gi_repository_get_n_infos (GIRepository *repository, + const gchar *namespace_); GI_AVAILABLE_IN_ALL -GIBaseInfo * g_irepository_get_info (GIRepository *repository, - const gchar *namespace_, - gint index); +GIBaseInfo * gi_repository_get_info (GIRepository *repository, + const gchar *namespace_, + gint index); GI_AVAILABLE_IN_ALL -GIEnumInfo * g_irepository_find_by_error_domain (GIRepository *repository, - GQuark domain); +GIEnumInfo * gi_repository_find_by_error_domain (GIRepository *repository, + GQuark domain); GI_AVAILABLE_IN_ALL -const gchar * g_irepository_get_typelib_path (GIRepository *repository, - const gchar *namespace_); +const gchar * gi_repository_get_typelib_path (GIRepository *repository, + const gchar *namespace_); GI_AVAILABLE_IN_ALL -const gchar * g_irepository_get_shared_library (GIRepository *repository, - const gchar *namespace_); +const gchar * gi_repository_get_shared_library (GIRepository *repository, + const gchar *namespace_); GI_AVAILABLE_IN_ALL -const gchar * g_irepository_get_c_prefix (GIRepository *repository, +const gchar * gi_repository_get_c_prefix (GIRepository *repository, const gchar *namespace_); GI_AVAILABLE_IN_ALL -const gchar * g_irepository_get_version (GIRepository *repository, - const gchar *namespace_); +const gchar * gi_repository_get_version (GIRepository *repository, + const gchar *namespace_); GI_AVAILABLE_IN_ALL -GOptionGroup * g_irepository_get_option_group (void); +GOptionGroup * gi_repository_get_option_group (void); GI_AVAILABLE_IN_ALL -gboolean g_irepository_dump (const char *arg, GError **error); +gboolean gi_repository_dump (const char *arg, GError **error); /** * GIRepositoryError: - * @G_IREPOSITORY_ERROR_TYPELIB_NOT_FOUND: the typelib could not be found. - * @G_IREPOSITORY_ERROR_NAMESPACE_MISMATCH: the namespace does not match the + * @GI_REPOSITORY_ERROR_TYPELIB_NOT_FOUND: the typelib could not be found. + * @GI_REPOSITORY_ERROR_NAMESPACE_MISMATCH: the namespace does not match the * requested namespace. - * @G_IREPOSITORY_ERROR_NAMESPACE_VERSION_CONFLICT: the version of the + * @GI_REPOSITORY_ERROR_NAMESPACE_VERSION_CONFLICT: the version of the * typelib does not match the requested version. - * @G_IREPOSITORY_ERROR_LIBRARY_NOT_FOUND: the library used by the typelib + * @GI_REPOSITORY_ERROR_LIBRARY_NOT_FOUND: the library used by the typelib * could not be found. * - * An error code used with #G_IREPOSITORY_ERROR in a #GError returned + * An error code used with #GI_REPOSITORY_ERROR in a #GError returned * from a #GIRepository routine. */ typedef enum { - G_IREPOSITORY_ERROR_TYPELIB_NOT_FOUND, - G_IREPOSITORY_ERROR_NAMESPACE_MISMATCH, - G_IREPOSITORY_ERROR_NAMESPACE_VERSION_CONFLICT, - G_IREPOSITORY_ERROR_LIBRARY_NOT_FOUND + GI_REPOSITORY_ERROR_TYPELIB_NOT_FOUND, + GI_REPOSITORY_ERROR_NAMESPACE_MISMATCH, + GI_REPOSITORY_ERROR_NAMESPACE_VERSION_CONFLICT, + GI_REPOSITORY_ERROR_LIBRARY_NOT_FOUND } GIRepositoryError; /** - * G_IREPOSITORY_ERROR: + * GI_REPOSITORY_ERROR: * * Error domain for #GIRepository. Errors in this domain will be from the * #GIRepositoryError enumeration. See #GError for more information on * error domains. */ -#define G_IREPOSITORY_ERROR (g_irepository_error_quark ()) +#define GI_REPOSITORY_ERROR (gi_repository_error_quark ()) GI_AVAILABLE_IN_ALL -GQuark g_irepository_error_quark (void); +GQuark gi_repository_error_quark (void); /* Global utility functions */ diff --git a/girepository/girffi.c b/girepository/girffi.c index 49844e0e3..ad2c57006 100644 --- a/girepository/girffi.c +++ b/girepository/girffi.c @@ -130,7 +130,7 @@ gi_type_tag_get_ffi_type (GITypeTag type_tag, } /** - * g_type_info_get_ffi_type: + * gi_type_info_get_ffi_type: * @info: A #GITypeInfo * * TODO @@ -138,15 +138,15 @@ gi_type_tag_get_ffi_type (GITypeTag type_tag, * Returns: A #ffi_type corresponding to the platform default C ABI for @info. */ ffi_type * -g_type_info_get_ffi_type (GITypeInfo *info) +gi_type_info_get_ffi_type (GITypeInfo *info) { gboolean is_enum = FALSE; GIBaseInfo *iinfo; - if (g_type_info_get_tag (info) == GI_TYPE_TAG_INTERFACE) + if (gi_type_info_get_tag (info) == GI_TYPE_TAG_INTERFACE) { - iinfo = g_type_info_get_interface (info); - switch (g_base_info_get_type (iinfo)) + iinfo = gi_type_info_get_interface (info); + switch (gi_base_info_get_type (iinfo)) { case GI_INFO_TYPE_ENUM: case GI_INFO_TYPE_FLAGS: @@ -155,14 +155,14 @@ g_type_info_get_ffi_type (GITypeInfo *info) default: break; } - g_base_info_unref (iinfo); + gi_base_info_unref (iinfo); } - return gi_type_tag_get_ffi_type_internal (g_type_info_get_tag (info), g_type_info_is_pointer (info), is_enum); + return gi_type_tag_get_ffi_type_internal (gi_type_info_get_tag (info), gi_type_info_is_pointer (info), is_enum); } /** - * g_callable_info_get_ffi_arg_types: + * gi_callable_info_get_ffi_arg_types: * @callable_info: a callable info from a typelib * @n_args_p: (out): The number of arguments * @@ -172,8 +172,8 @@ g_type_info_get_ffi_type (GITypeInfo *info) * should be freed using g_free() after use. */ static ffi_type ** -g_callable_info_get_ffi_arg_types (GICallableInfo *callable_info, - int *n_args_p) +gi_callable_info_get_ffi_arg_types (GICallableInfo *callable_info, + int *n_args_p) { ffi_type **arg_types; gboolean is_method, throws; @@ -181,9 +181,9 @@ g_callable_info_get_ffi_arg_types (GICallableInfo *callable_info, g_return_val_if_fail (callable_info != NULL, NULL); - n_args = g_callable_info_get_n_args (callable_info); - is_method = g_callable_info_is_method (callable_info); - throws = g_callable_info_can_throw_gerror (callable_info); + n_args = gi_callable_info_get_n_args (callable_info); + is_method = gi_callable_info_is_method (callable_info); + throws = gi_callable_info_can_throw_gerror (callable_info); offset = is_method ? 1 : 0; n_invoke_args = n_args; @@ -208,12 +208,12 @@ g_callable_info_get_ffi_arg_types (GICallableInfo *callable_info, GIArgInfo arg_info; GITypeInfo arg_type; - g_callable_info_load_arg (callable_info, i, &arg_info); - g_arg_info_load_type (&arg_info, &arg_type); - switch (g_arg_info_get_direction (&arg_info)) + gi_callable_info_load_arg (callable_info, i, &arg_info); + gi_arg_info_load_type (&arg_info, &arg_type); + switch (gi_arg_info_get_direction (&arg_info)) { case GI_DIRECTION_IN: - arg_types[i + offset] = g_type_info_get_ffi_type (&arg_type); + arg_types[i + offset] = gi_type_info_get_ffi_type (&arg_type); break; case GI_DIRECTION_OUT: case GI_DIRECTION_INOUT: @@ -230,7 +230,7 @@ g_callable_info_get_ffi_arg_types (GICallableInfo *callable_info, } /** - * g_callable_info_get_ffi_return_type: + * gi_callable_info_get_ffi_return_type: * @callable_info: a callable info from a typelib * * Fetches the ffi_type for a corresponding return value of @@ -239,22 +239,22 @@ g_callable_info_get_ffi_arg_types (GICallableInfo *callable_info, * Returns: the ffi_type for the return value */ static ffi_type * -g_callable_info_get_ffi_return_type (GICallableInfo *callable_info) +gi_callable_info_get_ffi_return_type (GICallableInfo *callable_info) { GITypeInfo *return_type; ffi_type *return_ffi_type; g_return_val_if_fail (callable_info != NULL, NULL); - return_type = g_callable_info_get_return_type (callable_info); - return_ffi_type = g_type_info_get_ffi_type (return_type); - g_base_info_unref((GIBaseInfo*)return_type); + return_type = gi_callable_info_get_return_type (callable_info); + return_ffi_type = gi_type_info_get_ffi_type (return_type); + gi_base_info_unref((GIBaseInfo*)return_type); return return_ffi_type; } /** - * g_function_info_prep_invoker: + * gi_function_info_prep_invoker: * @info: A #GIFunctionInfo * @invoker: Output invoker structure * @error: A #GError @@ -270,9 +270,9 @@ g_callable_info_get_ffi_return_type (GICallableInfo *callable_info) * Returns: %TRUE on success, %FALSE otherwise with @error set. */ gboolean -g_function_info_prep_invoker (GIFunctionInfo *info, - GIFunctionInvoker *invoker, - GError **error) +gi_function_info_prep_invoker (GIFunctionInfo *info, + GIFunctionInvoker *invoker, + GError **error) { const char *symbol; gpointer addr; @@ -280,24 +280,24 @@ g_function_info_prep_invoker (GIFunctionInfo *info, g_return_val_if_fail (info != NULL, FALSE); g_return_val_if_fail (invoker != NULL, FALSE); - symbol = g_function_info_get_symbol ((GIFunctionInfo*) info); + symbol = gi_function_info_get_symbol ((GIFunctionInfo*) info); - if (!g_typelib_symbol (g_base_info_get_typelib((GIBaseInfo *) info), - symbol, &addr)) + if (!gi_typelib_symbol (gi_base_info_get_typelib ((GIBaseInfo *) info), + symbol, &addr)) { g_set_error (error, - G_INVOKE_ERROR, - G_INVOKE_ERROR_SYMBOL_NOT_FOUND, + GI_INVOKE_ERROR, + GI_INVOKE_ERROR_SYMBOL_NOT_FOUND, "Could not locate %s: %s", symbol, g_module_error ()); return FALSE; } - return g_function_invoker_new_for_address (addr, info, invoker, error); + return gi_function_invoker_new_for_address (addr, info, invoker, error); } /** - * g_function_invoker_new_for_address: + * gi_function_invoker_new_for_address: * @addr: The address * @info: A #GICallableInfo * @invoker: Output invoker structure @@ -314,10 +314,10 @@ g_function_info_prep_invoker (GIFunctionInfo *info, * Returns: %TRUE on success, %FALSE otherwise with @error set. */ gboolean -g_function_invoker_new_for_address (gpointer addr, - GICallableInfo *info, - GIFunctionInvoker *invoker, - GError **error) +gi_function_invoker_new_for_address (gpointer addr, + GICallableInfo *info, + GIFunctionInvoker *invoker, + GError **error) { ffi_type **atypes; gint n_args; @@ -327,15 +327,15 @@ g_function_invoker_new_for_address (gpointer addr, invoker->native_address = addr; - atypes = g_callable_info_get_ffi_arg_types (info, &n_args); + atypes = gi_callable_info_get_ffi_arg_types (info, &n_args); return ffi_prep_cif (&(invoker->cif), FFI_DEFAULT_ABI, n_args, - g_callable_info_get_ffi_return_type (info), + gi_callable_info_get_ffi_return_type (info), atypes) == FFI_OK; } /** - * g_function_invoker_destroy: + * gi_function_invoker_destroy: * @invoker: A #GIFunctionInvoker * * Release all resources allocated for the internals of @invoker; callers @@ -343,7 +343,7 @@ g_function_invoker_new_for_address (gpointer addr, * itself however. */ void -g_function_invoker_destroy (GIFunctionInvoker *invoker) +gi_function_invoker_destroy (GIFunctionInvoker *invoker) { g_free (invoker->cif.arg_types); } @@ -355,7 +355,7 @@ typedef struct { } GIClosureWrapper; /** - * g_callable_info_create_closure: + * gi_callable_info_create_closure: * @callable_info: a callable info from a typelib * @cif: a ffi_cif structure * @callback: the ffi callback @@ -364,13 +364,13 @@ typedef struct { * Prepares a callback for ffi invocation. * * Returns: the ffi_closure or NULL on error. The return value - * should be freed by calling g_callable_info_destroy_closure(). + * should be freed by calling gi_callable_info_destroy_closure(). */ ffi_closure * -g_callable_info_create_closure (GICallableInfo *callable_info, - ffi_cif *cif, - GIFFIClosureCallback callback, - gpointer user_data) +gi_callable_info_create_closure (GICallableInfo *callable_info, + ffi_cif *cif, + GIFFIClosureCallback callback, + gpointer user_data) { gpointer exec_ptr; int n_args; @@ -392,9 +392,9 @@ g_callable_info_create_closure (GICallableInfo *callable_info, closure->native_address = exec_ptr; - atypes = g_callable_info_get_ffi_arg_types (callable_info, &n_args); + atypes = gi_callable_info_get_ffi_arg_types (callable_info, &n_args); status = ffi_prep_cif (cif, FFI_DEFAULT_ABI, n_args, - g_callable_info_get_ffi_return_type (callable_info), + gi_callable_info_get_ffi_return_type (callable_info), atypes); if (status != FFI_OK) { @@ -415,30 +415,30 @@ g_callable_info_create_closure (GICallableInfo *callable_info, } /** - * g_callable_info_get_closure_native_address: + * gi_callable_info_get_closure_native_address: * @callable_info: a callable info from a typelib * @closure: ffi closure * - * Gets callable code from ffi_closure prepared by g_callable_info_create_closure() + * Gets callable code from ffi_closure prepared by gi_callable_info_create_closure() */ gpointer * -g_callable_info_get_closure_native_address (GICallableInfo *callable_info, - ffi_closure *closure) +gi_callable_info_get_closure_native_address (GICallableInfo *callable_info, + ffi_closure *closure) { GIClosureWrapper *wrapper = (GIClosureWrapper *)closure; return wrapper->native_address; } /** - * g_callable_info_destroy_closure: + * gi_callable_info_destroy_closure: * @callable_info: a callable info from a typelib * @closure: ffi closure * - * Frees a ffi_closure returned from g_callable_info_create_closure() + * Frees a ffi_closure returned from gi_callable_info_create_closure() */ void -g_callable_info_destroy_closure (GICallableInfo *callable_info, - ffi_closure *closure) +gi_callable_info_destroy_closure (GICallableInfo *callable_info, + ffi_closure *closure) { GIClosureWrapper *wrapper = (GIClosureWrapper *)closure; diff --git a/girepository/girffi.h b/girepository/girffi.h index a37243feb..cbbd82692 100644 --- a/girepository/girffi.h +++ b/girepository/girffi.h @@ -73,7 +73,7 @@ GI_AVAILABLE_IN_ALL ffi_type * gi_type_tag_get_ffi_type (GITypeTag type_tag, gboolean is_pointer); GI_AVAILABLE_IN_ALL -ffi_type * g_type_info_get_ffi_type (GITypeInfo *info); +ffi_type * gi_type_info_get_ffi_type (GITypeInfo *info); GI_AVAILABLE_IN_ALL void gi_type_info_extract_ffi_return_value (GITypeInfo *return_info, @@ -87,32 +87,32 @@ void gi_type_tag_extract_ffi_return_value (GITypeTag return_tag GIArgument *arg); GI_AVAILABLE_IN_ALL -gboolean g_function_info_prep_invoker (GIFunctionInfo *info, - GIFunctionInvoker *invoker, - GError **error); +gboolean gi_function_info_prep_invoker (GIFunctionInfo *info, + GIFunctionInvoker *invoker, + GError **error); GI_AVAILABLE_IN_ALL -gboolean g_function_invoker_new_for_address (gpointer addr, - GICallableInfo *info, - GIFunctionInvoker *invoker, - GError **error); +gboolean gi_function_invoker_new_for_address (gpointer addr, + GICallableInfo *info, + GIFunctionInvoker *invoker, + GError **error); GI_AVAILABLE_IN_ALL -void g_function_invoker_destroy (GIFunctionInvoker *invoker); +void gi_function_invoker_destroy (GIFunctionInvoker *invoker); GI_AVAILABLE_IN_ALL -ffi_closure * g_callable_info_create_closure (GICallableInfo *callable_info, - ffi_cif *cif, - GIFFIClosureCallback callback, - gpointer user_data); +ffi_closure * gi_callable_info_create_closure (GICallableInfo *callable_info, + ffi_cif *cif, + GIFFIClosureCallback callback, + gpointer user_data); GI_AVAILABLE_IN_ALL -gpointer * g_callable_info_get_closure_native_address (GICallableInfo *callable_info, - ffi_closure *closure); +gpointer * gi_callable_info_get_closure_native_address (GICallableInfo *callable_info, + ffi_closure *closure); GI_AVAILABLE_IN_ALL -void g_callable_info_destroy_closure (GICallableInfo *callable_info, - ffi_closure *closure); +void gi_callable_info_destroy_closure (GICallableInfo *callable_info, + ffi_closure *closure); G_END_DECLS diff --git a/girepository/girmodule-private.h b/girepository/girmodule-private.h index 98b00d006..076043be8 100644 --- a/girepository/girmodule-private.h +++ b/girepository/girmodule-private.h @@ -28,11 +28,11 @@ G_BEGIN_DECLS -typedef struct _GIrTypelibBuild GIrTypelibBuild; -typedef struct _GIrModule GIrModule; +typedef struct _GIIrTypelibBuild GIIrTypelibBuild; +typedef struct _GIIrModule GIIrModule; -struct _GIrTypelibBuild { - GIrModule *module; +struct _GIIrTypelibBuild { + GIIrModule *module; GHashTable *strings; GHashTable *types; GList *nodes_with_attributes; @@ -41,7 +41,7 @@ struct _GIrTypelibBuild { GList *stack; }; -struct _GIrModule +struct _GIIrModule { gchar *name; gchar *version; @@ -66,20 +66,20 @@ struct _GIrModule GHashTable *disguised_structures; }; -GIrModule *_g_ir_module_new (const gchar *name, - const gchar *nsversion, - const gchar *module_filename, - const gchar *c_prefix); -void _g_ir_module_free (GIrModule *module); +GIIrModule *_gi_ir_module_new (const gchar *name, + const gchar *nsversion, + const gchar *module_filename, + const gchar *c_prefix); +void _gi_ir_module_free (GIIrModule *module); -void _g_ir_module_add_include_module (GIrModule *module, - GIrModule *include_module); +void _gi_ir_module_add_include_module (GIIrModule *module, + GIIrModule *include_module); -GITypelib * _g_ir_module_build_typelib (GIrModule *module); +GITypelib * _gi_ir_module_build_typelib (GIIrModule *module); -void _g_ir_module_fatal (GIrTypelibBuild *build, guint line, const char *msg, ...) G_GNUC_PRINTF (3, 4) G_GNUC_NORETURN; +void _gi_ir_module_fatal (GIIrTypelibBuild *build, guint line, const char *msg, ...) G_GNUC_PRINTF (3, 4) G_GNUC_NORETURN; -void _g_irnode_init_stats (void); -void _g_irnode_dump_stats (void); +void _gi_ir_node_init_stats (void); +void _gi_ir_node_dump_stats (void); G_END_DECLS diff --git a/girepository/girmodule.c b/girepository/girmodule.c index 03c0a0612..02b799091 100644 --- a/girepository/girmodule.c +++ b/girepository/girmodule.c @@ -37,15 +37,15 @@ #define NUM_SECTIONS 2 -GIrModule * -_g_ir_module_new (const gchar *name, - const gchar *version, - const gchar *shared_library, - const gchar *c_prefix) +GIIrModule * +_gi_ir_module_new (const gchar *name, + const gchar *version, + const gchar *shared_library, + const gchar *c_prefix) { - GIrModule *module; + GIIrModule *module; - module = g_slice_new0 (GIrModule); + module = g_slice_new0 (GIIrModule); module->name = g_strdup (name); module->version = g_strdup (version); @@ -64,14 +64,14 @@ _g_ir_module_new (const gchar *name, } void -_g_ir_module_free (GIrModule *module) +_gi_ir_module_free (GIIrModule *module) { GList *e; g_free (module->name); for (e = module->entries; e; e = e->next) - _g_ir_node_free ((GIrNode *)e->data); + _gi_ir_node_free ((GIIrNode *)e->data); g_list_free (module->entries); /* Don't free dependencies, we inherit that from the parser */ @@ -82,11 +82,11 @@ _g_ir_module_free (GIrModule *module) g_hash_table_destroy (module->pointer_structures); g_hash_table_destroy (module->disguised_structures); - g_slice_free (GIrModule, module); + g_slice_free (GIIrModule, module); } /** - * _g_ir_module_fatal: + * _gi_ir_module_fatal: * @build: Current build * @line: Origin line number, or 0 if unknown * @msg: printf-format string @@ -95,10 +95,10 @@ _g_ir_module_free (GIrModule *module) * Report a fatal error, then exit. */ void -_g_ir_module_fatal (GIrTypelibBuild *build, - guint line, - const char *msg, - ...) +_gi_ir_module_fatal (GIIrTypelibBuild *build, + guint line, + const char *msg, + ...) { GString *context; char *formatted; @@ -117,7 +117,7 @@ _g_ir_module_fatal (GIrTypelibBuild *build, g_string_append (context, "In "); for (link = g_list_last (build->stack); link; link = link->prev) { - GIrNode *node = link->data; + GIIrNode *node = link->data; const char *name = node->name; if (name) g_string_append (context, name); @@ -142,7 +142,7 @@ add_alias_foreach (gpointer key, gpointer value, gpointer data) { - GIrModule *module = data; + GIIrModule *module = data; g_hash_table_replace (module->aliases, g_strdup (key), g_strdup (value)); } @@ -152,7 +152,7 @@ add_pointer_structure_foreach (gpointer key, gpointer value, gpointer data) { - GIrModule *module = data; + GIIrModule *module = data; g_hash_table_replace (module->pointer_structures, g_strdup (key), value); } @@ -162,14 +162,14 @@ add_disguised_structure_foreach (gpointer key, gpointer value, gpointer data) { - GIrModule *module = data; + GIIrModule *module = data; g_hash_table_replace (module->disguised_structures, g_strdup (key), value); } void -_g_ir_module_add_include_module (GIrModule *module, - GIrModule *include_module) +_gi_ir_module_add_include_module (GIIrModule *module, + GIIrModule *include_module) { module->include_modules = g_list_prepend (module->include_modules, include_module); @@ -190,7 +190,7 @@ struct AttributeWriteData { guint count; guchar *databuf; - GIrNode *node; + GIIrNode *node; GHashTable *strings; guint32 *offset; guint32 *offset2; @@ -206,19 +206,19 @@ write_attribute (gpointer key, gpointer value, gpointer datap) *(data->offset) += sizeof (AttributeBlob); blob->offset = data->node->offset; - blob->name = _g_ir_write_string ((const char*) key, data->strings, data->databuf, data->offset2); - blob->value = _g_ir_write_string ((const char*) value, data->strings, data->databuf, data->offset2); + blob->name = _gi_ir_write_string ((const char*) key, data->strings, data->databuf, data->offset2); + blob->value = _gi_ir_write_string ((const char*) value, data->strings, data->databuf, data->offset2); data->count++; } static guint -write_attributes (GIrModule *module, - GIrNode *node, - GHashTable *strings, - guchar *data, - guint32 *offset, - guint32 *offset2) +write_attributes (GIIrModule *module, + GIIrNode *node, + GHashTable *strings, + guchar *data, + guint32 *offset, + guint32 *offset2) { struct AttributeWriteData wdata; wdata.count = 0; @@ -237,8 +237,8 @@ static gint node_cmp_offset_func (gconstpointer a, gconstpointer b) { - const GIrNode *na = a; - const GIrNode *nb = b; + const GIIrNode *na = a; + const GIIrNode *nb = b; return na->offset - nb->offset; } @@ -265,7 +265,7 @@ alloc_section (guint8 *data, SectionType section_id, guint32 offset) } static guint8* -add_directory_index_section (guint8 *data, GIrModule *module, guint32 *offset2) +add_directory_index_section (guint8 *data, GIIrModule *module, guint32 *offset2) { DirEntry *entry; Header *header = (Header*)data; @@ -313,7 +313,7 @@ add_directory_index_section (guint8 *data, GIrModule *module, guint32 *offset2) } GITypelib * -_g_ir_module_build_typelib (GIrModule *module) +_gi_ir_module_build_typelib (GIIrModule *module) { GError *error = NULL; GITypelib *typelib; @@ -360,7 +360,7 @@ _g_ir_module_build_typelib (GIrModule *module) } restart: - _g_irnode_init_stats (); + _gi_ir_node_init_stats (); strings = g_hash_table_new (g_str_hash, g_str_equal); types = g_hash_table_new (g_str_hash, g_str_equal); nodes_with_attributes = NULL; @@ -376,9 +376,9 @@ _g_ir_module_build_typelib (GIrModule *module) for (e = module->entries; e; e = e->next) { - GIrNode *node = e->data; + GIIrNode *node = e->data; - size += _g_ir_node_get_full_size (node); + size += _gi_ir_node_get_full_size (node); /* Also reset the offset here */ node->offset = 0; @@ -402,7 +402,7 @@ _g_ir_module_build_typelib (GIrModule *module) /* fill in header */ header = (Header *)data; - memcpy (header, G_IR_MAGIC, 16); + memcpy (header, GI_IR_MAGIC, 16); header->major_version = 4; header->minor_version = 0; header->reserved = 0; @@ -414,17 +414,17 @@ _g_ir_module_build_typelib (GIrModule *module) * the size calculations above. */ if (dependencies != NULL) - header->dependencies = _g_ir_write_string (dependencies, strings, data, &header_size); + header->dependencies = _gi_ir_write_string (dependencies, strings, data, &header_size); else header->dependencies = 0; header->size = 0; /* filled in later */ - header->namespace = _g_ir_write_string (module->name, strings, data, &header_size); - header->nsversion = _g_ir_write_string (module->version, strings, data, &header_size); + header->namespace = _gi_ir_write_string (module->name, strings, data, &header_size); + header->nsversion = _gi_ir_write_string (module->version, strings, data, &header_size); header->shared_library = (module->shared_library? - _g_ir_write_string (module->shared_library, strings, data, &header_size) + _gi_ir_write_string (module->shared_library, strings, data, &header_size) : 0); if (module->c_prefix != NULL) - header->c_prefix = _g_ir_write_string (module->c_prefix, strings, data, &header_size); + header->c_prefix = _gi_ir_write_string (module->c_prefix, strings, data, &header_size); else header->c_prefix = 0; header->entry_blob_size = sizeof (DirEntry); @@ -469,8 +469,8 @@ _g_ir_module_build_typelib (GIrModule *module) for (e = module->entries, i = 0; e; e = e->next, i++) { - GIrTypelibBuild build; - GIrNode *node = e->data; + GIIrTypelibBuild build; + GIIrNode *node = e->data; if (strchr (node->name, '.')) { @@ -488,7 +488,7 @@ _g_ir_module_build_typelib (GIrModule *module) /* Reset the cached offsets */ for (link = nodes_with_attributes; link; link = link->next) - ((GIrNode *) link->data)->offset = 0; + ((GIIrNode *) link->data)->offset = 0; g_list_free (nodes_with_attributes); strings = NULL; @@ -501,24 +501,24 @@ _g_ir_module_build_typelib (GIrModule *module) offset = offset2; - if (node->type == G_IR_NODE_XREF) + if (node->type == GI_IR_NODE_XREF) { - const char *namespace = ((GIrNodeXRef*)node)->namespace; + const char *namespace = ((GIIrNodeXRef*)node)->namespace; entry->blob_type = 0; entry->local = FALSE; - entry->offset = _g_ir_write_string (namespace, strings, data, &offset2); - entry->name = _g_ir_write_string (node->name, strings, data, &offset2); + entry->offset = _gi_ir_write_string (namespace, strings, data, &offset2); + entry->name = _gi_ir_write_string (node->name, strings, data, &offset2); } else { old_offset = offset; - offset2 = offset + _g_ir_node_get_size (node); + offset2 = offset + _gi_ir_node_get_size (node); entry->blob_type = node->type; entry->local = TRUE; entry->offset = offset; - entry->name = _g_ir_write_string (node->name, strings, data, &offset2); + entry->name = _gi_ir_write_string (node->name, strings, data, &offset2); memset (&build, 0, sizeof (build)); build.module = module; @@ -527,13 +527,13 @@ _g_ir_module_build_typelib (GIrModule *module) build.nodes_with_attributes = nodes_with_attributes; build.n_attributes = header->n_attributes; build.data = data; - _g_ir_node_build_typelib (node, NULL, &build, &offset, &offset2, NULL); + _gi_ir_node_build_typelib (node, NULL, &build, &offset, &offset2, NULL); nodes_with_attributes = build.nodes_with_attributes; header->n_attributes = build.n_attributes; - if (offset2 > old_offset + _g_ir_node_get_full_size (node)) - g_error ("left a hole of %d bytes\n", offset2 - old_offset - _g_ir_node_get_full_size (node)); + if (offset2 > old_offset + _gi_ir_node_get_full_size (node)) + g_error ("left a hole of %d bytes\n", offset2 - old_offset - _gi_ir_node_get_full_size (node)); } entry++; @@ -544,7 +544,7 @@ _g_ir_module_build_typelib (GIrModule *module) g_message ("header: %d entries, %d attributes", header->n_entries, header->n_attributes); - _g_irnode_dump_stats (); + _gi_ir_node_dump_stats (); /* Write attributes after the blobs */ offset = offset2; @@ -553,7 +553,7 @@ _g_ir_module_build_typelib (GIrModule *module) for (e = nodes_with_attributes; e; e = e->next) { - GIrNode *node = e->data; + GIIrNode *node = e->data; write_attributes (module, node, strings, data, &offset, &offset2); } @@ -566,7 +566,7 @@ _g_ir_module_build_typelib (GIrModule *module) header = (Header *)data; length = header->size = offset2; - typelib = g_typelib_new_from_memory (data, length, &error); + typelib = gi_typelib_new_from_memory (data, length, &error); if (!typelib) { g_error ("error building typelib: %s", diff --git a/girepository/girnode-private.h b/girepository/girnode-private.h index 5fbe28916..67d2691fd 100644 --- a/girepository/girnode-private.h +++ b/girepository/girnode-private.h @@ -29,68 +29,68 @@ G_BEGIN_DECLS -typedef struct _GIrNode GIrNode; -typedef struct _GIrNodeFunction GIrNodeFunction; -typedef struct _GIrNodeParam GIrNodeParam; -typedef struct _GIrNodeType GIrNodeType; -typedef struct _GIrNodeInterface GIrNodeInterface; -typedef struct _GIrNodeSignal GIrNodeSignal; -typedef struct _GIrNodeProperty GIrNodeProperty; -typedef struct _GIrNodeVFunc GIrNodeVFunc; -typedef struct _GIrNodeField GIrNodeField; -typedef struct _GIrNodeValue GIrNodeValue; -typedef struct _GIrNodeEnum GIrNodeEnum; -typedef struct _GIrNodeBoxed GIrNodeBoxed; -typedef struct _GIrNodeStruct GIrNodeStruct; -typedef struct _GIrNodeConstant GIrNodeConstant; -typedef struct _GIrNodeXRef GIrNodeXRef; -typedef struct _GIrNodeUnion GIrNodeUnion; +typedef struct _GIIrNode GIIrNode; +typedef struct _GIIrNodeFunction GIIrNodeFunction; +typedef struct _GIIrNodeParam GIIrNodeParam; +typedef struct _GIIrNodeType GIIrNodeType; +typedef struct _GIIrNodeInterface GIIrNodeInterface; +typedef struct _GIIrNodeSignal GIIrNodeSignal; +typedef struct _GIIrNodeProperty GIIrNodeProperty; +typedef struct _GIIrNodeVFunc GIIrNodeVFunc; +typedef struct _GIIrNodeField GIIrNodeField; +typedef struct _GIIrNodeValue GIIrNodeValue; +typedef struct _GIIrNodeEnum GIIrNodeEnum; +typedef struct _GIIrNodeBoxed GIIrNodeBoxed; +typedef struct _GIIrNodeStruct GIIrNodeStruct; +typedef struct _GIIrNodeConstant GIIrNodeConstant; +typedef struct _GIIrNodeXRef GIIrNodeXRef; +typedef struct _GIIrNodeUnion GIIrNodeUnion; typedef enum { - G_IR_NODE_INVALID = 0, - G_IR_NODE_FUNCTION = 1, - G_IR_NODE_CALLBACK = 2, - G_IR_NODE_STRUCT = 3, - G_IR_NODE_BOXED = 4, - G_IR_NODE_ENUM = 5, - G_IR_NODE_FLAGS = 6, - G_IR_NODE_OBJECT = 7, - G_IR_NODE_INTERFACE = 8, - G_IR_NODE_CONSTANT = 9, - G_IR_NODE_INVALID_0 = 10, /* DELETED - used to be ERROR_DOMAIN */ - G_IR_NODE_UNION = 11, - G_IR_NODE_PARAM = 12, - G_IR_NODE_TYPE = 13, - G_IR_NODE_PROPERTY = 14, - G_IR_NODE_SIGNAL = 15, - G_IR_NODE_VALUE = 16, - G_IR_NODE_VFUNC = 17, - G_IR_NODE_FIELD = 18, - G_IR_NODE_XREF = 19 -} GIrNodeTypeId; + GI_IR_NODE_INVALID = 0, + GI_IR_NODE_FUNCTION = 1, + GI_IR_NODE_CALLBACK = 2, + GI_IR_NODE_STRUCT = 3, + GI_IR_NODE_BOXED = 4, + GI_IR_NODE_ENUM = 5, + GI_IR_NODE_FLAGS = 6, + GI_IR_NODE_OBJECT = 7, + GI_IR_NODE_INTERFACE = 8, + GI_IR_NODE_CONSTANT = 9, + GI_IR_NODE_INVALID_0 = 10, /* DELETED - used to be ERROR_DOMAIN */ + GI_IR_NODE_UNION = 11, + GI_IR_NODE_PARAM = 12, + GI_IR_NODE_TYPE = 13, + GI_IR_NODE_PROPERTY = 14, + GI_IR_NODE_SIGNAL = 15, + GI_IR_NODE_VALUE = 16, + GI_IR_NODE_VFUNC = 17, + GI_IR_NODE_FIELD = 18, + GI_IR_NODE_XREF = 19 +} GIIrNodeTypeId; -struct _GIrNode +struct _GIIrNode { - GIrNodeTypeId type; + GIIrNodeTypeId type; gchar *name; - GIrModule *module; + GIIrModule *module; guint32 offset; /* Assigned as we build the typelib */ GHashTable *attributes; }; -struct _GIrNodeXRef +struct _GIIrNodeXRef { - GIrNode node; + GIIrNode node; gchar *namespace; }; -struct _GIrNodeFunction +struct _GIIrNodeFunction { - GIrNode node; + GIIrNode node; gboolean deprecated; gboolean is_varargs; /* Not in typelib yet */ @@ -106,13 +106,13 @@ struct _GIrNodeFunction gchar *symbol; char *property; - GIrNodeParam *result; + GIIrNodeParam *result; GList *parameters; }; -struct _GIrNodeType +struct _GIIrNodeType { - GIrNode node; + GIIrNode node; gboolean is_pointer; gboolean is_basic; @@ -133,16 +133,16 @@ struct _GIrNodeType gint size; gint array_type; - GIrNodeType *parameter_type1; - GIrNodeType *parameter_type2; + GIIrNodeType *parameter_type1; + GIIrNodeType *parameter_type2; gchar *giinterface; gchar **errors; }; -struct _GIrNodeParam +struct _GIIrNodeParam { - GIrNode node; + GIIrNode node; gboolean in; gboolean out; @@ -158,12 +158,12 @@ struct _GIrNodeParam gint8 closure; gint8 destroy; - GIrNodeType *type; + GIIrNodeType *type; }; -struct _GIrNodeProperty +struct _GIIrNodeProperty { - GIrNode node; + GIIrNode node; gboolean deprecated; @@ -178,12 +178,12 @@ struct _GIrNodeProperty char *setter; char *getter; - GIrNodeType *type; + GIIrNodeType *type; }; -struct _GIrNodeSignal +struct _GIIrNodeSignal { - GIrNode node; + GIIrNode node; gboolean deprecated; @@ -202,12 +202,12 @@ struct _GIrNodeSignal gint class_closure; GList *parameters; - GIrNodeParam *result; + GIIrNodeParam *result; }; -struct _GIrNodeVFunc +struct _GIIrNodeVFunc { - GIrNode node; + GIIrNode node; gboolean is_varargs; /* Not in typelib yet */ gboolean must_chain_up; @@ -220,27 +220,27 @@ struct _GIrNodeVFunc char *invoker; GList *parameters; - GIrNodeParam *result; + GIIrNodeParam *result; gint offset; }; -struct _GIrNodeField +struct _GIIrNodeField { - GIrNode node; + GIIrNode node; gboolean readable; gboolean writable; gint bits; gint offset; - GIrNodeFunction *callback; + GIIrNodeFunction *callback; - GIrNodeType *type; + GIIrNodeType *type; }; -struct _GIrNodeInterface +struct _GIIrNodeInterface { - GIrNode node; + GIIrNode node; gboolean abstract; gboolean deprecated; @@ -267,29 +267,29 @@ struct _GIrNodeInterface GList *members; }; -struct _GIrNodeValue +struct _GIIrNodeValue { - GIrNode node; + GIIrNode node; gboolean deprecated; gint64 value; }; -struct _GIrNodeConstant +struct _GIIrNodeConstant { - GIrNode node; + GIIrNode node; gboolean deprecated; - GIrNodeType *type; + GIIrNodeType *type; gchar *value; }; -struct _GIrNodeEnum +struct _GIIrNodeEnum { - GIrNode node; + GIIrNode node; gboolean deprecated; gint storage_type; @@ -302,9 +302,9 @@ struct _GIrNodeEnum GList *methods; }; -struct _GIrNodeBoxed +struct _GIIrNodeBoxed { - GIrNode node; + GIIrNode node; gboolean deprecated; @@ -317,9 +317,9 @@ struct _GIrNodeBoxed GList *members; }; -struct _GIrNodeStruct +struct _GIIrNodeStruct { - GIrNode node; + GIIrNode node; gboolean deprecated; gboolean disguised; @@ -340,9 +340,9 @@ struct _GIrNodeStruct GList *members; }; -struct _GIrNodeUnion +struct _GIIrNodeUnion { - GIrNode node; + GIIrNode node; gboolean deprecated; @@ -359,42 +359,42 @@ struct _GIrNodeUnion gint size; gint discriminator_offset; - GIrNodeType *discriminator_type; + GIIrNodeType *discriminator_type; }; -GIrNode * _g_ir_node_new (GIrNodeTypeId type, - GIrModule *module); -void _g_ir_node_free (GIrNode *node); -guint32 _g_ir_node_get_size (GIrNode *node); -guint32 _g_ir_node_get_full_size (GIrNode *node); -void _g_ir_node_build_typelib (GIrNode *node, - GIrNode *parent, - GIrTypelibBuild *build, - guint32 *offset, - guint32 *offset2, - guint16 *count2); -int _g_ir_node_cmp (GIrNode *node, - GIrNode *other); -gboolean _g_ir_node_can_have_member (GIrNode *node); -void _g_ir_node_add_member (GIrNode *node, - GIrNodeFunction *member); -guint32 _g_ir_write_string (const gchar *str, - GHashTable *strings, - guchar *data, - guint32 *offset); +GIIrNode *_gi_ir_node_new (GIIrNodeTypeId type, + GIIrModule *module); +void _gi_ir_node_free (GIIrNode *node); +guint32 _gi_ir_node_get_size (GIIrNode *node); +guint32 _gi_ir_node_get_full_size (GIIrNode *node); +void _gi_ir_node_build_typelib (GIIrNode *node, + GIIrNode *parent, + GIIrTypelibBuild *build, + guint32 *offset, + guint32 *offset2, + guint16 *count2); +int _gi_ir_node_cmp (GIIrNode *node, + GIIrNode *other); +gboolean _gi_ir_node_can_have_member (GIIrNode *node); +void _gi_ir_node_add_member (GIIrNode *node, + GIIrNodeFunction *member); +guint32 _gi_ir_write_string (const gchar *str, + GHashTable *strings, + guchar *data, + guint32 *offset); -const gchar * _g_ir_node_param_direction_string (GIrNodeParam * node); -const gchar * _g_ir_node_type_to_string (GIrNodeTypeId type); +const gchar * _gi_ir_node_param_direction_string (GIIrNodeParam * node); +const gchar * _gi_ir_node_type_to_string (GIIrNodeTypeId type); -GIrNode *_g_ir_find_node (GIrTypelibBuild *build, - GIrModule *module, - const char *name); +GIIrNode *_gi_ir_find_node (GIIrTypelibBuild *build, + GIIrModule *module, + const char *name); /* In giroffsets.c */ -void _g_ir_node_compute_offsets (GIrTypelibBuild *build, - GIrNode *node); +void _gi_ir_node_compute_offsets (GIIrTypelibBuild *build, + GIIrNode *node); G_END_DECLS diff --git a/girepository/girnode.c b/girepository/girnode.c index 2ebe54f85..1c27d8720 100644 --- a/girepository/girnode.c +++ b/girepository/girnode.c @@ -45,7 +45,7 @@ static gulong types_count = 0; static gulong unique_types_count = 0; void -_g_irnode_init_stats (void) +_gi_ir_node_init_stats (void) { string_count = 0; unique_string_count = 0; @@ -56,7 +56,7 @@ _g_irnode_init_stats (void) } void -_g_irnode_dump_stats (void) +_gi_ir_node_dump_stats (void) { g_message ("%lu strings (%lu before sharing), %lu bytes (%lu before sharing)", unique_string_count, string_count, unique_string_size, string_size); @@ -75,120 +75,120 @@ do { \ const gchar * -_g_ir_node_type_to_string (GIrNodeTypeId type) +_gi_ir_node_type_to_string (GIIrNodeTypeId type) { switch (type) { - case G_IR_NODE_FUNCTION: + case GI_IR_NODE_FUNCTION: return "function"; - case G_IR_NODE_CALLBACK: + case GI_IR_NODE_CALLBACK: return "callback"; - case G_IR_NODE_PARAM: + case GI_IR_NODE_PARAM: return "param"; - case G_IR_NODE_TYPE: + case GI_IR_NODE_TYPE: return "type"; - case G_IR_NODE_OBJECT: + case GI_IR_NODE_OBJECT: return "object"; - case G_IR_NODE_INTERFACE: + case GI_IR_NODE_INTERFACE: return "interface"; - case G_IR_NODE_SIGNAL: + case GI_IR_NODE_SIGNAL: return "signal"; - case G_IR_NODE_PROPERTY: + case GI_IR_NODE_PROPERTY: return "property"; - case G_IR_NODE_VFUNC: + case GI_IR_NODE_VFUNC: return "vfunc"; - case G_IR_NODE_FIELD: + case GI_IR_NODE_FIELD: return "field"; - case G_IR_NODE_ENUM: + case GI_IR_NODE_ENUM: return "enum"; - case G_IR_NODE_FLAGS: + case GI_IR_NODE_FLAGS: return "flags"; - case G_IR_NODE_BOXED: + case GI_IR_NODE_BOXED: return "boxed"; - case G_IR_NODE_STRUCT: + case GI_IR_NODE_STRUCT: return "struct"; - case G_IR_NODE_VALUE: + case GI_IR_NODE_VALUE: return "value"; - case G_IR_NODE_CONSTANT: + case GI_IR_NODE_CONSTANT: return "constant"; - case G_IR_NODE_XREF: + case GI_IR_NODE_XREF: return "xref"; - case G_IR_NODE_UNION: + case GI_IR_NODE_UNION: return "union"; default: return "unknown"; } } -GIrNode * -_g_ir_node_new (GIrNodeTypeId type, - GIrModule *module) +GIIrNode * +_gi_ir_node_new (GIIrNodeTypeId type, + GIIrModule *module) { - GIrNode *node = NULL; + GIIrNode *node = NULL; switch (type) { - case G_IR_NODE_FUNCTION: - case G_IR_NODE_CALLBACK: - node = g_malloc0 (sizeof (GIrNodeFunction)); + case GI_IR_NODE_FUNCTION: + case GI_IR_NODE_CALLBACK: + node = g_malloc0 (sizeof (GIIrNodeFunction)); break; - case G_IR_NODE_PARAM: - node = g_malloc0 (sizeof (GIrNodeParam)); + case GI_IR_NODE_PARAM: + node = g_malloc0 (sizeof (GIIrNodeParam)); break; - case G_IR_NODE_TYPE: - node = g_malloc0 (sizeof (GIrNodeType)); + case GI_IR_NODE_TYPE: + node = g_malloc0 (sizeof (GIIrNodeType)); break; - case G_IR_NODE_OBJECT: - case G_IR_NODE_INTERFACE: - node = g_malloc0 (sizeof (GIrNodeInterface)); + case GI_IR_NODE_OBJECT: + case GI_IR_NODE_INTERFACE: + node = g_malloc0 (sizeof (GIIrNodeInterface)); break; - case G_IR_NODE_SIGNAL: - node = g_malloc0 (sizeof (GIrNodeSignal)); + case GI_IR_NODE_SIGNAL: + node = g_malloc0 (sizeof (GIIrNodeSignal)); break; - case G_IR_NODE_PROPERTY: - node = g_malloc0 (sizeof (GIrNodeProperty)); + case GI_IR_NODE_PROPERTY: + node = g_malloc0 (sizeof (GIIrNodeProperty)); break; - case G_IR_NODE_VFUNC: - node = g_malloc0 (sizeof (GIrNodeFunction)); + case GI_IR_NODE_VFUNC: + node = g_malloc0 (sizeof (GIIrNodeFunction)); break; - case G_IR_NODE_FIELD: - node = g_malloc0 (sizeof (GIrNodeField)); + case GI_IR_NODE_FIELD: + node = g_malloc0 (sizeof (GIIrNodeField)); break; - case G_IR_NODE_ENUM: - case G_IR_NODE_FLAGS: - node = g_malloc0 (sizeof (GIrNodeEnum)); + case GI_IR_NODE_ENUM: + case GI_IR_NODE_FLAGS: + node = g_malloc0 (sizeof (GIIrNodeEnum)); break; - case G_IR_NODE_BOXED: - node = g_malloc0 (sizeof (GIrNodeBoxed)); + case GI_IR_NODE_BOXED: + node = g_malloc0 (sizeof (GIIrNodeBoxed)); break; - case G_IR_NODE_STRUCT: - node = g_malloc0 (sizeof (GIrNodeStruct)); + case GI_IR_NODE_STRUCT: + node = g_malloc0 (sizeof (GIIrNodeStruct)); break; - case G_IR_NODE_VALUE: - node = g_malloc0 (sizeof (GIrNodeValue)); + case GI_IR_NODE_VALUE: + node = g_malloc0 (sizeof (GIIrNodeValue)); break; - case G_IR_NODE_CONSTANT: - node = g_malloc0 (sizeof (GIrNodeConstant)); + case GI_IR_NODE_CONSTANT: + node = g_malloc0 (sizeof (GIIrNodeConstant)); break; - case G_IR_NODE_XREF: - node = g_malloc0 (sizeof (GIrNodeXRef)); + case GI_IR_NODE_XREF: + node = g_malloc0 (sizeof (GIIrNodeXRef)); break; - case G_IR_NODE_UNION: - node = g_malloc0 (sizeof (GIrNodeUnion)); + case GI_IR_NODE_UNION: + node = g_malloc0 (sizeof (GIIrNodeUnion)); break; default: @@ -206,7 +206,7 @@ _g_ir_node_new (GIrNodeTypeId type, } void -_g_ir_node_free (GIrNode *node) +_gi_ir_node_free (GIIrNode *node) { GList *l; @@ -215,28 +215,28 @@ _g_ir_node_free (GIrNode *node) switch (node->type) { - case G_IR_NODE_FUNCTION: - case G_IR_NODE_CALLBACK: + case GI_IR_NODE_FUNCTION: + case GI_IR_NODE_CALLBACK: { - GIrNodeFunction *function = (GIrNodeFunction *)node; + GIIrNodeFunction *function = (GIIrNodeFunction *)node; g_free (node->name); g_free (function->symbol); g_free (function->property); - _g_ir_node_free ((GIrNode *)function->result); + _gi_ir_node_free ((GIIrNode *)function->result); for (l = function->parameters; l; l = l->next) - _g_ir_node_free ((GIrNode *)l->data); + _gi_ir_node_free ((GIIrNode *)l->data); g_list_free (function->parameters); } break; - case G_IR_NODE_TYPE: + case GI_IR_NODE_TYPE: { - GIrNodeType *type = (GIrNodeType *)node; + GIIrNodeType *type = (GIIrNodeType *)node; g_free (node->name); - _g_ir_node_free ((GIrNode *)type->parameter_type1); - _g_ir_node_free ((GIrNode *)type->parameter_type2); + _gi_ir_node_free ((GIIrNode *)type->parameter_type1); + _gi_ir_node_free ((GIIrNode *)type->parameter_type2); g_free (type->giinterface); g_strfreev (type->errors); @@ -244,65 +244,65 @@ _g_ir_node_free (GIrNode *node) } break; - case G_IR_NODE_PARAM: + case GI_IR_NODE_PARAM: { - GIrNodeParam *param = (GIrNodeParam *)node; + GIIrNodeParam *param = (GIIrNodeParam *)node; g_free (node->name); - _g_ir_node_free ((GIrNode *)param->type); + _gi_ir_node_free ((GIIrNode *)param->type); } break; - case G_IR_NODE_PROPERTY: + case GI_IR_NODE_PROPERTY: { - GIrNodeProperty *property = (GIrNodeProperty *)node; + GIIrNodeProperty *property = (GIIrNodeProperty *)node; g_free (node->name); g_free (property->setter); g_free (property->getter); - _g_ir_node_free ((GIrNode *)property->type); + _gi_ir_node_free ((GIIrNode *)property->type); } break; - case G_IR_NODE_SIGNAL: + case GI_IR_NODE_SIGNAL: { - GIrNodeSignal *signal = (GIrNodeSignal *)node; + GIIrNodeSignal *signal = (GIIrNodeSignal *)node; g_free (node->name); for (l = signal->parameters; l; l = l->next) - _g_ir_node_free ((GIrNode *)l->data); + _gi_ir_node_free ((GIIrNode *)l->data); g_list_free (signal->parameters); - _g_ir_node_free ((GIrNode *)signal->result); + _gi_ir_node_free ((GIIrNode *)signal->result); } break; - case G_IR_NODE_VFUNC: + case GI_IR_NODE_VFUNC: { - GIrNodeVFunc *vfunc = (GIrNodeVFunc *)node; + GIIrNodeVFunc *vfunc = (GIIrNodeVFunc *)node; g_free (node->name); g_free (vfunc->invoker); for (l = vfunc->parameters; l; l = l->next) - _g_ir_node_free ((GIrNode *)l->data); + _gi_ir_node_free ((GIIrNode *)l->data); g_list_free (vfunc->parameters); - _g_ir_node_free ((GIrNode *)vfunc->result); + _gi_ir_node_free ((GIIrNode *)vfunc->result); } break; - case G_IR_NODE_FIELD: + case GI_IR_NODE_FIELD: { - GIrNodeField *field = (GIrNodeField *)node; + GIIrNodeField *field = (GIIrNodeField *)node; g_free (node->name); - _g_ir_node_free ((GIrNode *)field->type); - _g_ir_node_free ((GIrNode *)field->callback); + _gi_ir_node_free ((GIIrNode *)field->type); + _gi_ir_node_free ((GIIrNode *)field->callback); } break; - case G_IR_NODE_OBJECT: - case G_IR_NODE_INTERFACE: + case GI_IR_NODE_OBJECT: + case GI_IR_NODE_INTERFACE: { - GIrNodeInterface *iface = (GIrNodeInterface *)node; + GIIrNodeInterface *iface = (GIIrNodeInterface *)node; g_free (node->name); g_free (iface->gtype_name); @@ -317,26 +317,26 @@ _g_ir_node_free (GIrNode *node) g_free (iface->parent); for (l = iface->interfaces; l; l = l->next) - g_free ((GIrNode *)l->data); + g_free ((GIIrNode *)l->data); g_list_free (iface->interfaces); for (l = iface->members; l; l = l->next) - _g_ir_node_free ((GIrNode *)l->data); + _gi_ir_node_free ((GIIrNode *)l->data); g_list_free (iface->members); } break; - case G_IR_NODE_VALUE: + case GI_IR_NODE_VALUE: { g_free (node->name); } break; - case G_IR_NODE_ENUM: - case G_IR_NODE_FLAGS: + case GI_IR_NODE_ENUM: + case GI_IR_NODE_FLAGS: { - GIrNodeEnum *enum_ = (GIrNodeEnum *)node; + GIIrNodeEnum *enum_ = (GIIrNodeEnum *)node; g_free (node->name); g_free (enum_->gtype_name); @@ -344,32 +344,32 @@ _g_ir_node_free (GIrNode *node) g_free (enum_->error_domain); for (l = enum_->values; l; l = l->next) - _g_ir_node_free ((GIrNode *)l->data); + _gi_ir_node_free ((GIIrNode *)l->data); g_list_free (enum_->values); for (l = enum_->methods; l; l = l->next) - _g_ir_node_free ((GIrNode *)l->data); + _gi_ir_node_free ((GIIrNode *)l->data); g_list_free (enum_->methods); } break; - case G_IR_NODE_BOXED: + case GI_IR_NODE_BOXED: { - GIrNodeBoxed *boxed = (GIrNodeBoxed *)node; + GIIrNodeBoxed *boxed = (GIIrNodeBoxed *)node; g_free (node->name); g_free (boxed->gtype_name); g_free (boxed->gtype_init); for (l = boxed->members; l; l = l->next) - _g_ir_node_free ((GIrNode *)l->data); + _gi_ir_node_free ((GIIrNode *)l->data); g_list_free (boxed->members); } break; - case G_IR_NODE_STRUCT: + case GI_IR_NODE_STRUCT: { - GIrNodeStruct *struct_ = (GIrNodeStruct *)node; + GIIrNodeStruct *struct_ = (GIIrNodeStruct *)node; g_free (node->name); g_free (struct_->gtype_name); @@ -378,33 +378,33 @@ _g_ir_node_free (GIrNode *node) g_free (struct_->free_func); for (l = struct_->members; l; l = l->next) - _g_ir_node_free ((GIrNode *)l->data); + _gi_ir_node_free ((GIIrNode *)l->data); g_list_free (struct_->members); } break; - case G_IR_NODE_CONSTANT: + case GI_IR_NODE_CONSTANT: { - GIrNodeConstant *constant = (GIrNodeConstant *)node; + GIIrNodeConstant *constant = (GIIrNodeConstant *)node; g_free (node->name); g_free (constant->value); - _g_ir_node_free ((GIrNode *)constant->type); + _gi_ir_node_free ((GIIrNode *)constant->type); } break; - case G_IR_NODE_XREF: + case GI_IR_NODE_XREF: { - GIrNodeXRef *xref = (GIrNodeXRef *)node; + GIIrNodeXRef *xref = (GIIrNodeXRef *)node; g_free (node->name); g_free (xref->namespace); } break; - case G_IR_NODE_UNION: + case GI_IR_NODE_UNION: { - GIrNodeUnion *union_ = (GIrNodeUnion *)node; + GIIrNodeUnion *union_ = (GIIrNodeUnion *)node; g_free (node->name); g_free (union_->gtype_name); @@ -412,11 +412,11 @@ _g_ir_node_free (GIrNode *node) g_free (union_->copy_func); g_free (union_->free_func); - _g_ir_node_free ((GIrNode *)union_->discriminator_type); + _gi_ir_node_free ((GIIrNode *)union_->discriminator_type); for (l = union_->members; l; l = l->next) - _g_ir_node_free ((GIrNode *)l->data); + _gi_ir_node_free ((GIIrNode *)l->data); for (l = union_->discriminators; l; l = l->next) - _g_ir_node_free ((GIrNode *)l->data); + _gi_ir_node_free ((GIIrNode *)l->data); } break; @@ -432,141 +432,141 @@ _g_ir_node_free (GIrNode *node) /* returns the fixed size of the blob */ guint32 -_g_ir_node_get_size (GIrNode *node) +_gi_ir_node_get_size (GIIrNode *node) { GList *l; gint size, n; switch (node->type) { - case G_IR_NODE_CALLBACK: + case GI_IR_NODE_CALLBACK: size = sizeof (CallbackBlob); break; - case G_IR_NODE_FUNCTION: + case GI_IR_NODE_FUNCTION: size = sizeof (FunctionBlob); break; - case G_IR_NODE_PARAM: - /* See the comment in the G_IR_NODE_PARAM/ArgBlob writing below */ + case GI_IR_NODE_PARAM: + /* See the comment in the GI_IR_NODE_PARAM/ArgBlob writing below */ size = sizeof (ArgBlob) - sizeof (SimpleTypeBlob); break; - case G_IR_NODE_TYPE: + case GI_IR_NODE_TYPE: size = sizeof (SimpleTypeBlob); break; - case G_IR_NODE_OBJECT: + case GI_IR_NODE_OBJECT: { - GIrNodeInterface *iface = (GIrNodeInterface *)node; + GIIrNodeInterface *iface = (GIIrNodeInterface *)node; n = g_list_length (iface->interfaces); size = sizeof (ObjectBlob) + 2 * (n + (n % 2)); for (l = iface->members; l; l = l->next) - size += _g_ir_node_get_size ((GIrNode *)l->data); + size += _gi_ir_node_get_size ((GIIrNode *)l->data); } break; - case G_IR_NODE_INTERFACE: + case GI_IR_NODE_INTERFACE: { - GIrNodeInterface *iface = (GIrNodeInterface *)node; + GIIrNodeInterface *iface = (GIIrNodeInterface *)node; n = g_list_length (iface->prerequisites); size = sizeof (InterfaceBlob) + 2 * (n + (n % 2)); for (l = iface->members; l; l = l->next) - size += _g_ir_node_get_size ((GIrNode *)l->data); + size += _gi_ir_node_get_size ((GIIrNode *)l->data); } break; - case G_IR_NODE_ENUM: - case G_IR_NODE_FLAGS: + case GI_IR_NODE_ENUM: + case GI_IR_NODE_FLAGS: { - GIrNodeEnum *enum_ = (GIrNodeEnum *)node; + GIIrNodeEnum *enum_ = (GIIrNodeEnum *)node; size = sizeof (EnumBlob); for (l = enum_->values; l; l = l->next) - size += _g_ir_node_get_size ((GIrNode *)l->data); + size += _gi_ir_node_get_size ((GIIrNode *)l->data); for (l = enum_->methods; l; l = l->next) - size += _g_ir_node_get_size ((GIrNode *)l->data); + size += _gi_ir_node_get_size ((GIIrNode *)l->data); } break; - case G_IR_NODE_VALUE: + case GI_IR_NODE_VALUE: size = sizeof (ValueBlob); break; - case G_IR_NODE_STRUCT: + case GI_IR_NODE_STRUCT: { - GIrNodeStruct *struct_ = (GIrNodeStruct *)node; + GIIrNodeStruct *struct_ = (GIIrNodeStruct *)node; size = sizeof (StructBlob); for (l = struct_->members; l; l = l->next) - size += _g_ir_node_get_size ((GIrNode *)l->data); + size += _gi_ir_node_get_size ((GIIrNode *)l->data); } break; - case G_IR_NODE_BOXED: + case GI_IR_NODE_BOXED: { - GIrNodeBoxed *boxed = (GIrNodeBoxed *)node; + GIIrNodeBoxed *boxed = (GIIrNodeBoxed *)node; size = sizeof (StructBlob); for (l = boxed->members; l; l = l->next) - size += _g_ir_node_get_size ((GIrNode *)l->data); + size += _gi_ir_node_get_size ((GIIrNode *)l->data); } break; - case G_IR_NODE_PROPERTY: + case GI_IR_NODE_PROPERTY: size = sizeof (PropertyBlob); break; - case G_IR_NODE_SIGNAL: + case GI_IR_NODE_SIGNAL: size = sizeof (SignalBlob); break; - case G_IR_NODE_VFUNC: + case GI_IR_NODE_VFUNC: size = sizeof (VFuncBlob); break; - case G_IR_NODE_FIELD: + case GI_IR_NODE_FIELD: { - GIrNodeField *field = (GIrNodeField *)node; + GIIrNodeField *field = (GIIrNodeField *)node; size = sizeof (FieldBlob); if (field->callback) - size += _g_ir_node_get_size ((GIrNode *)field->callback); + size += _gi_ir_node_get_size ((GIIrNode *)field->callback); } break; - case G_IR_NODE_CONSTANT: + case GI_IR_NODE_CONSTANT: size = sizeof (ConstantBlob); break; - case G_IR_NODE_XREF: + case GI_IR_NODE_XREF: size = 0; break; - case G_IR_NODE_UNION: + case GI_IR_NODE_UNION: { - GIrNodeUnion *union_ = (GIrNodeUnion *)node; + GIIrNodeUnion *union_ = (GIIrNodeUnion *)node; size = sizeof (UnionBlob); for (l = union_->members; l; l = l->next) - size += _g_ir_node_get_size ((GIrNode *)l->data); + size += _gi_ir_node_get_size ((GIIrNode *)l->data); for (l = union_->discriminators; l; l = l->next) - size += _g_ir_node_get_size ((GIrNode *)l->data); + size += _gi_ir_node_get_size ((GIIrNode *)l->data); } break; default: g_error ("Unhandled node type '%s'\n", - _g_ir_node_type_to_string (node->type)); + _gi_ir_node_type_to_string (node->type)); size = 0; } g_debug ("node %p type '%s' size %d", node, - _g_ir_node_type_to_string (node->type), size); + _gi_ir_node_type_to_string (node->type), size); return size; } @@ -585,8 +585,8 @@ add_attribute_size (gpointer key, gpointer value, gpointer data) /* returns the full size of the blob including variable-size parts (including attributes) */ static guint32 -_g_ir_node_get_full_size_internal (GIrNode *parent, - GIrNode *node) +_gi_ir_node_get_full_size_internal (GIIrNode *parent, + GIIrNode *node) { GList *l; gint size, n; @@ -595,62 +595,62 @@ _g_ir_node_get_full_size_internal (GIrNode *parent, g_error ("Caught NULL node, parent=%s", parent->name); g_debug ("node %p type '%s'", node, - _g_ir_node_type_to_string (node->type)); + _gi_ir_node_type_to_string (node->type)); switch (node->type) { - case G_IR_NODE_CALLBACK: + case GI_IR_NODE_CALLBACK: { - GIrNodeFunction *function = (GIrNodeFunction *)node; + GIIrNodeFunction *function = (GIIrNodeFunction *)node; size = sizeof (CallbackBlob); size += ALIGN_VALUE (strlen (node->name) + 1, 4); for (l = function->parameters; l; l = l->next) { - size += _g_ir_node_get_full_size_internal (node, (GIrNode *)l->data); + size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); } - size += _g_ir_node_get_full_size_internal (node, (GIrNode *)function->result); + size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)function->result); } break; - case G_IR_NODE_FUNCTION: + case GI_IR_NODE_FUNCTION: { - GIrNodeFunction *function = (GIrNodeFunction *)node; + GIIrNodeFunction *function = (GIIrNodeFunction *)node; size = sizeof (FunctionBlob); size += ALIGN_VALUE (strlen (node->name) + 1, 4); size += ALIGN_VALUE (strlen (function->symbol) + 1, 4); for (l = function->parameters; l; l = l->next) - size += _g_ir_node_get_full_size_internal (node, (GIrNode *)l->data); - size += _g_ir_node_get_full_size_internal (node, (GIrNode *)function->result); + size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); + size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)function->result); } break; - case G_IR_NODE_PARAM: + case GI_IR_NODE_PARAM: { - GIrNodeParam *param = (GIrNodeParam *)node; + GIIrNodeParam *param = (GIIrNodeParam *)node; - /* See the comment in the G_IR_NODE_PARAM/ArgBlob writing below */ + /* See the comment in the GI_IR_NODE_PARAM/ArgBlob writing below */ size = sizeof (ArgBlob) - sizeof (SimpleTypeBlob); if (node->name) size += ALIGN_VALUE (strlen (node->name) + 1, 4); - size += _g_ir_node_get_full_size_internal (node, (GIrNode *)param->type); + size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)param->type); } break; - case G_IR_NODE_TYPE: + case GI_IR_NODE_TYPE: { - GIrNodeType *type = (GIrNodeType *)node; + GIIrNodeType *type = (GIIrNodeType *)node; size = sizeof (SimpleTypeBlob); if (!GI_TYPE_TAG_IS_BASIC (type->tag)) { g_debug ("node %p type tag '%s'", node, - g_type_tag_to_string (type->tag)); + gi_type_tag_to_string (type->tag)); switch (type->tag) { case GI_TYPE_TAG_ARRAY: size = sizeof (ArrayTypeBlob); if (type->parameter_type1) - size += _g_ir_node_get_full_size_internal (node, (GIrNode *)type->parameter_type1); + size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)type->parameter_type1); break; case GI_TYPE_TAG_INTERFACE: size += sizeof (InterfaceTypeBlob); @@ -659,14 +659,14 @@ _g_ir_node_get_full_size_internal (GIrNode *parent, case GI_TYPE_TAG_GSLIST: size += sizeof (ParamTypeBlob); if (type->parameter_type1) - size += _g_ir_node_get_full_size_internal (node, (GIrNode *)type->parameter_type1); + size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)type->parameter_type1); break; case GI_TYPE_TAG_GHASH: size += sizeof (ParamTypeBlob) * 2; if (type->parameter_type1) - size += _g_ir_node_get_full_size_internal (node, (GIrNode *)type->parameter_type1); + size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)type->parameter_type1); if (type->parameter_type2) - size += _g_ir_node_get_full_size_internal (node, (GIrNode *)type->parameter_type2); + size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)type->parameter_type2); break; case GI_TYPE_TAG_ERROR: size += sizeof (ErrorTypeBlob); @@ -679,9 +679,9 @@ _g_ir_node_get_full_size_internal (GIrNode *parent, } break; - case G_IR_NODE_OBJECT: + case GI_IR_NODE_OBJECT: { - GIrNodeInterface *iface = (GIrNodeInterface *)node; + GIIrNodeInterface *iface = (GIIrNodeInterface *)node; n = g_list_length (iface->interfaces); size = sizeof(ObjectBlob); @@ -704,13 +704,13 @@ _g_ir_node_get_full_size_internal (GIrNode *parent, size += 2 * (n + (n % 2)); for (l = iface->members; l; l = l->next) - size += _g_ir_node_get_full_size_internal (node, (GIrNode *)l->data); + size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); } break; - case G_IR_NODE_INTERFACE: + case GI_IR_NODE_INTERFACE: { - GIrNodeInterface *iface = (GIrNodeInterface *)node; + GIIrNodeInterface *iface = (GIIrNodeInterface *)node; n = g_list_length (iface->prerequisites); size = sizeof (InterfaceBlob); @@ -720,14 +720,14 @@ _g_ir_node_get_full_size_internal (GIrNode *parent, size += 2 * (n + (n % 2)); for (l = iface->members; l; l = l->next) - size += _g_ir_node_get_full_size_internal (node, (GIrNode *)l->data); + size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); } break; - case G_IR_NODE_ENUM: - case G_IR_NODE_FLAGS: + case GI_IR_NODE_ENUM: + case GI_IR_NODE_FLAGS: { - GIrNodeEnum *enum_ = (GIrNodeEnum *)node; + GIIrNodeEnum *enum_ = (GIIrNodeEnum *)node; size = sizeof (EnumBlob); size += ALIGN_VALUE (strlen (node->name) + 1, 4); @@ -740,22 +740,22 @@ _g_ir_node_get_full_size_internal (GIrNode *parent, size += ALIGN_VALUE (strlen (enum_->error_domain) + 1, 4); for (l = enum_->values; l; l = l->next) - size += _g_ir_node_get_full_size_internal (node, (GIrNode *)l->data); + size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); for (l = enum_->methods; l; l = l->next) - size += _g_ir_node_get_full_size_internal (node, (GIrNode *)l->data); + size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); } break; - case G_IR_NODE_VALUE: + case GI_IR_NODE_VALUE: { size = sizeof (ValueBlob); size += ALIGN_VALUE (strlen (node->name) + 1, 4); } break; - case G_IR_NODE_STRUCT: + case GI_IR_NODE_STRUCT: { - GIrNodeStruct *struct_ = (GIrNodeStruct *)node; + GIIrNodeStruct *struct_ = (GIIrNodeStruct *)node; size = sizeof (StructBlob); size += ALIGN_VALUE (strlen (node->name) + 1, 4); @@ -768,13 +768,13 @@ _g_ir_node_get_full_size_internal (GIrNode *parent, if (struct_->free_func) size += ALIGN_VALUE (strlen (struct_->free_func) + 1, 4); for (l = struct_->members; l; l = l->next) - size += _g_ir_node_get_full_size_internal (node, (GIrNode *)l->data); + size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); } break; - case G_IR_NODE_BOXED: + case GI_IR_NODE_BOXED: { - GIrNodeBoxed *boxed = (GIrNodeBoxed *)node; + GIIrNodeBoxed *boxed = (GIIrNodeBoxed *)node; size = sizeof (StructBlob); size += ALIGN_VALUE (strlen (node->name) + 1, 4); @@ -784,72 +784,72 @@ _g_ir_node_get_full_size_internal (GIrNode *parent, size += ALIGN_VALUE (strlen (boxed->gtype_init) + 1, 4); } for (l = boxed->members; l; l = l->next) - size += _g_ir_node_get_full_size_internal (node, (GIrNode *)l->data); + size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); } break; - case G_IR_NODE_PROPERTY: + case GI_IR_NODE_PROPERTY: { - GIrNodeProperty *prop = (GIrNodeProperty *)node; + GIIrNodeProperty *prop = (GIIrNodeProperty *)node; size = sizeof (PropertyBlob); size += ALIGN_VALUE (strlen (node->name) + 1, 4); - size += _g_ir_node_get_full_size_internal (node, (GIrNode *)prop->type); + size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)prop->type); } break; - case G_IR_NODE_SIGNAL: + case GI_IR_NODE_SIGNAL: { - GIrNodeSignal *signal = (GIrNodeSignal *)node; + GIIrNodeSignal *signal = (GIIrNodeSignal *)node; size = sizeof (SignalBlob); size += ALIGN_VALUE (strlen (node->name) + 1, 4); for (l = signal->parameters; l; l = l->next) - size += _g_ir_node_get_full_size_internal (node, (GIrNode *)l->data); - size += _g_ir_node_get_full_size_internal (node, (GIrNode *)signal->result); + size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); + size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)signal->result); } break; - case G_IR_NODE_VFUNC: + case GI_IR_NODE_VFUNC: { - GIrNodeVFunc *vfunc = (GIrNodeVFunc *)node; + GIIrNodeVFunc *vfunc = (GIIrNodeVFunc *)node; size = sizeof (VFuncBlob); size += ALIGN_VALUE (strlen (node->name) + 1, 4); for (l = vfunc->parameters; l; l = l->next) - size += _g_ir_node_get_full_size_internal (node, (GIrNode *)l->data); - size += _g_ir_node_get_full_size_internal (node, (GIrNode *)vfunc->result); + size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); + size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)vfunc->result); } break; - case G_IR_NODE_FIELD: + case GI_IR_NODE_FIELD: { - GIrNodeField *field = (GIrNodeField *)node; + GIIrNodeField *field = (GIIrNodeField *)node; size = sizeof (FieldBlob); size += ALIGN_VALUE (strlen (node->name) + 1, 4); if (field->callback) - size += _g_ir_node_get_full_size_internal (node, (GIrNode *)field->callback); + size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)field->callback); else - size += _g_ir_node_get_full_size_internal (node, (GIrNode *)field->type); + size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)field->type); } break; - case G_IR_NODE_CONSTANT: + case GI_IR_NODE_CONSTANT: { - GIrNodeConstant *constant = (GIrNodeConstant *)node; + GIIrNodeConstant *constant = (GIIrNodeConstant *)node; size = sizeof (ConstantBlob); size += ALIGN_VALUE (strlen (node->name) + 1, 4); /* FIXME non-string values */ size += ALIGN_VALUE (strlen (constant->value) + 1, 4); - size += _g_ir_node_get_full_size_internal (node, (GIrNode *)constant->type); + size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)constant->type); } break; - case G_IR_NODE_XREF: + case GI_IR_NODE_XREF: { - GIrNodeXRef *xref = (GIrNodeXRef *)node; + GIIrNodeXRef *xref = (GIIrNodeXRef *)node; size = 0; size += ALIGN_VALUE (strlen (node->name) + 1, 4); @@ -857,9 +857,9 @@ _g_ir_node_get_full_size_internal (GIrNode *parent, } break; - case G_IR_NODE_UNION: + case GI_IR_NODE_UNION: { - GIrNodeUnion *union_ = (GIrNodeUnion *)node; + GIIrNodeUnion *union_ = (GIIrNodeUnion *)node; size = sizeof (UnionBlob); size += ALIGN_VALUE (strlen (node->name) + 1, 4); @@ -872,9 +872,9 @@ _g_ir_node_get_full_size_internal (GIrNode *parent, if (union_->free_func) size += ALIGN_VALUE (strlen (union_->free_func) + 1, 4); for (l = union_->members; l; l = l->next) - size += _g_ir_node_get_full_size_internal (node, (GIrNode *)l->data); + size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); for (l = union_->discriminators; l; l = l->next) - size += _g_ir_node_get_full_size_internal (node, (GIrNode *)l->data); + size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); } break; @@ -887,7 +887,7 @@ _g_ir_node_get_full_size_internal (GIrNode *parent, node->name ? "'" : "", node->name ? node->name : "", node->name ? "' " : "", - node, _g_ir_node_type_to_string (node->type), size); + node, _gi_ir_node_type_to_string (node->type), size); g_hash_table_foreach (node->attributes, add_attribute_size, &size); @@ -895,14 +895,14 @@ _g_ir_node_get_full_size_internal (GIrNode *parent, } guint32 -_g_ir_node_get_full_size (GIrNode *node) +_gi_ir_node_get_full_size (GIIrNode *node) { - return _g_ir_node_get_full_size_internal (NULL, node); + return _gi_ir_node_get_full_size_internal (NULL, node); } int -_g_ir_node_cmp (GIrNode *node, - GIrNode *other) +_gi_ir_node_cmp (GIIrNode *node, + GIIrNode *other) { if (node->type < other->type) return -1; @@ -913,34 +913,34 @@ _g_ir_node_cmp (GIrNode *node, } gboolean -_g_ir_node_can_have_member (GIrNode *node) +_gi_ir_node_can_have_member (GIIrNode *node) { switch (node->type) { - case G_IR_NODE_OBJECT: - case G_IR_NODE_INTERFACE: - case G_IR_NODE_BOXED: - case G_IR_NODE_STRUCT: - case G_IR_NODE_UNION: + case GI_IR_NODE_OBJECT: + case GI_IR_NODE_INTERFACE: + case GI_IR_NODE_BOXED: + case GI_IR_NODE_STRUCT: + case GI_IR_NODE_UNION: return TRUE; /* list others individually rather than with default: so that compiler * warns if new node types are added without adding them to the switch */ - case G_IR_NODE_INVALID: - case G_IR_NODE_FUNCTION: - case G_IR_NODE_CALLBACK: - case G_IR_NODE_ENUM: - case G_IR_NODE_FLAGS: - case G_IR_NODE_CONSTANT: - case G_IR_NODE_INVALID_0: - case G_IR_NODE_PARAM: - case G_IR_NODE_TYPE: - case G_IR_NODE_PROPERTY: - case G_IR_NODE_SIGNAL: - case G_IR_NODE_VALUE: - case G_IR_NODE_VFUNC: - case G_IR_NODE_FIELD: - case G_IR_NODE_XREF: + case GI_IR_NODE_INVALID: + case GI_IR_NODE_FUNCTION: + case GI_IR_NODE_CALLBACK: + case GI_IR_NODE_ENUM: + case GI_IR_NODE_FLAGS: + case GI_IR_NODE_CONSTANT: + case GI_IR_NODE_INVALID_0: + case GI_IR_NODE_PARAM: + case GI_IR_NODE_TYPE: + case GI_IR_NODE_PROPERTY: + case GI_IR_NODE_SIGNAL: + case GI_IR_NODE_VALUE: + case GI_IR_NODE_VFUNC: + case GI_IR_NODE_FIELD: + case GI_IR_NODE_XREF: return FALSE; default: g_assert_not_reached (); @@ -949,45 +949,45 @@ _g_ir_node_can_have_member (GIrNode *node) } void -_g_ir_node_add_member (GIrNode *node, - GIrNodeFunction *member) +_gi_ir_node_add_member (GIIrNode *node, + GIIrNodeFunction *member) { g_return_if_fail (node != NULL); g_return_if_fail (member != NULL); switch (node->type) { - case G_IR_NODE_OBJECT: - case G_IR_NODE_INTERFACE: + case GI_IR_NODE_OBJECT: + case GI_IR_NODE_INTERFACE: { - GIrNodeInterface *iface = (GIrNodeInterface *)node; + GIIrNodeInterface *iface = (GIIrNodeInterface *)node; iface->members = g_list_insert_sorted (iface->members, member, - (GCompareFunc) _g_ir_node_cmp); + (GCompareFunc) _gi_ir_node_cmp); break; } - case G_IR_NODE_BOXED: + case GI_IR_NODE_BOXED: { - GIrNodeBoxed *boxed = (GIrNodeBoxed *)node; + GIIrNodeBoxed *boxed = (GIIrNodeBoxed *)node; boxed->members = g_list_insert_sorted (boxed->members, member, - (GCompareFunc) _g_ir_node_cmp); + (GCompareFunc) _gi_ir_node_cmp); break; } - case G_IR_NODE_STRUCT: + case GI_IR_NODE_STRUCT: { - GIrNodeStruct *struct_ = (GIrNodeStruct *)node; + GIIrNodeStruct *struct_ = (GIIrNodeStruct *)node; struct_->members = g_list_insert_sorted (struct_->members, member, - (GCompareFunc) _g_ir_node_cmp); + (GCompareFunc) _gi_ir_node_cmp); break; } - case G_IR_NODE_UNION: + case GI_IR_NODE_UNION: { - GIrNodeUnion *union_ = (GIrNodeUnion *)node; + GIIrNodeUnion *union_ = (GIIrNodeUnion *)node; union_->members = g_list_insert_sorted (union_->members, member, - (GCompareFunc) _g_ir_node_cmp); + (GCompareFunc) _gi_ir_node_cmp); break; } default: @@ -998,7 +998,7 @@ _g_ir_node_add_member (GIrNode *node, } const gchar * -_g_ir_node_param_direction_string (GIrNodeParam * node) +_gi_ir_node_param_direction_string (GIIrNodeParam * node) { if (node->out) { @@ -1040,18 +1040,18 @@ parse_boolean_value (const gchar *str) return parse_int_value (str) ? TRUE : FALSE; } -static GIrNode * -find_entry_node (GIrTypelibBuild *build, - const gchar *name, - guint16 *idx) +static GIIrNode * +find_entry_node (GIIrTypelibBuild *build, + const gchar *name, + guint16 *idx) { - GIrModule *module = build->module; + GIIrModule *module = build->module; GList *l; gint i; gchar **names; gint n_names; - GIrNode *result = NULL; + GIIrNode *result = NULL; g_assert (name != NULL); g_assert (strlen (name) > 0); @@ -1063,15 +1063,15 @@ find_entry_node (GIrTypelibBuild *build, for (l = module->entries, i = 1; l; l = l->next, i++) { - GIrNode *node = (GIrNode *)l->data; + GIIrNode *node = (GIIrNode *)l->data; if (n_names > 1) { - if (node->type != G_IR_NODE_XREF) + if (node->type != GI_IR_NODE_XREF) continue; - if (((GIrNodeXRef *)node)->namespace == NULL || - strcmp (((GIrNodeXRef *)node)->namespace, names[0]) != 0) + if (((GIIrNodeXRef *)node)->namespace == NULL || + strcmp (((GIIrNodeXRef *)node)->namespace, names[0]) != 0) continue; } @@ -1087,9 +1087,9 @@ find_entry_node (GIrTypelibBuild *build, if (n_names > 1) { - GIrNode *node = _g_ir_node_new (G_IR_NODE_XREF, module); + GIIrNode *node = _gi_ir_node_new (GI_IR_NODE_XREF, module); - ((GIrNodeXRef *)node)->namespace = g_strdup (names[0]); + ((GIIrNodeXRef *)node)->namespace = g_strdup (names[0]); node->name = g_strdup (names[1]); module->entries = g_list_append (module->entries, node); @@ -1105,8 +1105,7 @@ find_entry_node (GIrTypelibBuild *build, } - _g_ir_module_fatal (build, -1, "type reference '%s' not found", - name); + _gi_ir_module_fatal (build, -1, "type reference '%s' not found", name); out: g_strfreev (names); @@ -1115,8 +1114,8 @@ find_entry_node (GIrTypelibBuild *build, } static guint16 -find_entry (GIrTypelibBuild *build, - const gchar *name) +find_entry (GIIrTypelibBuild *build, + const gchar *name) { guint16 idx = 0; @@ -1125,11 +1124,11 @@ find_entry (GIrTypelibBuild *build, return idx; } -static GIrModule * -find_namespace (GIrModule *module, - const char *name) +static GIIrModule * +find_namespace (GIIrModule *module, + const char *name) { - GIrModule *target; + GIIrModule *target; GList *l; if (strcmp (module->name, name) == 0) @@ -1137,7 +1136,7 @@ find_namespace (GIrModule *module, for (l = module->include_modules; l; l = l->next) { - GIrModule *submodule = l->data; + GIIrModule *submodule = l->data; if (strcmp (submodule->name, name) == 0) return submodule; @@ -1149,17 +1148,17 @@ find_namespace (GIrModule *module, return NULL; } -GIrNode * -_g_ir_find_node (GIrTypelibBuild *build, - GIrModule *src_module, - const char *name) +GIIrNode * +_gi_ir_find_node (GIIrTypelibBuild *build, + GIIrModule *src_module, + const char *name) { GList *l; - GIrNode *return_node = NULL; + GIIrNode *return_node = NULL; char **names = g_strsplit (name, ".", 0); gint n_names = g_strv_length (names); const char *target_name; - GIrModule *target_module; + GIIrModule *target_module; if (n_names == 1) { @@ -1178,7 +1177,7 @@ _g_ir_find_node (GIrTypelibBuild *build, for (l = target_module->entries; l; l = l->next) { - GIrNode *node = (GIrNode *)l->data; + GIIrNode *node = (GIIrNode *)l->data; if (strcmp (node->name, target_name) == 0) { @@ -1194,16 +1193,16 @@ done: } static int -get_index_of_member_type (GIrNodeInterface *node, - GIrNodeTypeId type, - const char *name) +get_index_of_member_type (GIIrNodeInterface *node, + GIIrNodeTypeId type, + const char *name) { guint index = -1; GList *l; for (l = node->members; l; l = l->next) { - GIrNode *member_node = l->data; + GIIrNode *member_node = l->data; if (member_node->type != type) continue; @@ -1218,15 +1217,15 @@ get_index_of_member_type (GIrNodeInterface *node, } static void -serialize_type (GIrTypelibBuild *build, - GIrNodeType *node, - GString *str) +serialize_type (GIIrTypelibBuild *build, + GIIrNodeType *node, + GString *str) { gint i; if (GI_TYPE_TAG_IS_BASIC (node->tag)) { - g_string_append_printf (str, "%s%s", g_type_tag_to_string (node->tag), + g_string_append_printf (str, "%s%s", gi_type_tag_to_string (node->tag), node->is_pointer ? "*" : ""); } else if (node->tag == GI_TYPE_TAG_ARRAY) @@ -1272,14 +1271,14 @@ serialize_type (GIrTypelibBuild *build, } else if (node->tag == GI_TYPE_TAG_INTERFACE) { - GIrNode *iface; + GIIrNode *iface; gchar *name; iface = find_entry_node (build, node->giinterface, NULL); if (iface) { - if (iface->type == G_IR_NODE_XREF) - g_string_append_printf (str, "%s.", ((GIrNodeXRef *)iface)->namespace); + if (iface->type == GI_IR_NODE_XREF) + g_string_append_printf (str, "%s.", ((GIIrNodeXRef *)iface)->namespace); name = iface->name; } else @@ -1341,26 +1340,26 @@ serialize_type (GIrTypelibBuild *build, } static void -_g_ir_node_build_members (GList **members, - GIrNodeTypeId type, - guint16 *count, - GIrNode *parent, - GIrTypelibBuild *build, - guint32 *offset, - guint32 *offset2, - guint16 *count2) +_gi_ir_node_build_members (GList **members, + GIIrNodeTypeId type, + guint16 *count, + GIIrNode *parent, + GIIrTypelibBuild *build, + guint32 *offset, + guint32 *offset2, + guint16 *count2) { GList *l = *members; while (l) { - GIrNode *member = (GIrNode *)l->data; + GIIrNode *member = (GIIrNode *)l->data; GList *next = l->next; if (member->type == type) { (*count)++; - _g_ir_node_build_typelib (member, parent, build, offset, offset2, count2); + _gi_ir_node_build_typelib (member, parent, build, offset, offset2, count2); *members = g_list_delete_link (*members, l); } l = next; @@ -1368,8 +1367,8 @@ _g_ir_node_build_members (GList **members, } static void -_g_ir_node_check_unhandled_members (GList **members, - GIrNodeTypeId container_type) +_gi_ir_node_check_unhandled_members (GList **members, + GIIrNodeTypeId container_type) { #if 0 if (*members) @@ -1378,11 +1377,11 @@ _g_ir_node_check_unhandled_members (GList **members, for (l = *members; l; l = l->next) { - GIrNode *member = (GIrNode *)l->data; + GIIrNode *member = (GIIrNode *)l->data; g_printerr ("Unhandled '%s' member '%s' type '%s'\n", - _g_ir_node_type_to_string (container_type), + _gi_ir_node_type_to_string (container_type), member->name, - _g_ir_node_type_to_string (member->type)); + _gi_ir_node_type_to_string (member->type)); } g_list_free (*members); @@ -1397,12 +1396,12 @@ _g_ir_node_check_unhandled_members (GList **members, } void -_g_ir_node_build_typelib (GIrNode *node, - GIrNode *parent, - GIrTypelibBuild *build, - guint32 *offset, - guint32 *offset2, - guint16 *count2) +_gi_ir_node_build_typelib (GIIrNode *node, + GIIrNode *parent, + GIIrTypelibBuild *build, + guint32 *offset, + guint32 *offset2, + guint16 *count2) { gboolean appended_stack; GHashTable *strings = build->strings; @@ -1417,16 +1416,16 @@ _g_ir_node_build_typelib (GIrNode *node, g_debug ("build_typelib: %s%s(%s)", node->name ? node->name : "", node->name ? " " : "", - _g_ir_node_type_to_string (node->type)); + _gi_ir_node_type_to_string (node->type)); if (build->stack) - appended_stack = node != (GIrNode*)build->stack->data; + appended_stack = node != (GIIrNode*)build->stack->data; else appended_stack = TRUE; if (appended_stack) build->stack = g_list_prepend (build->stack, node); - _g_ir_node_compute_offsets (build, node); + _gi_ir_node_compute_offsets (build, node); /* We should only be building each node once. If we do a typelib expansion, we also * reset the offset in girmodule.c. @@ -1439,9 +1438,9 @@ _g_ir_node_build_typelib (GIrNode *node, switch (node->type) { - case G_IR_NODE_TYPE: + case GI_IR_NODE_TYPE: { - GIrNodeType *type = (GIrNodeType *)node; + GIIrNodeType *type = (GIIrNodeType *)node; SimpleTypeBlob *blob = (SimpleTypeBlob *)&data[*offset]; *offset += sizeof (SimpleTypeBlob); @@ -1502,8 +1501,8 @@ _g_ir_node_build_typelib (GIrNode *node, pos = *offset2 + G_STRUCT_OFFSET (ArrayTypeBlob, type); *offset2 += sizeof (ArrayTypeBlob); - _g_ir_node_build_typelib ((GIrNode *)type->parameter_type1, - node, build, &pos, offset2, NULL); + _gi_ir_node_build_typelib ((GIIrNode *)type->parameter_type1, + node, build, &pos, offset2, NULL); } break; @@ -1536,8 +1535,8 @@ _g_ir_node_build_typelib (GIrNode *node, pos = *offset2 + G_STRUCT_OFFSET (ParamTypeBlob, type); *offset2 += sizeof (ParamTypeBlob) + sizeof (SimpleTypeBlob); - _g_ir_node_build_typelib ((GIrNode *)type->parameter_type1, - node, build, &pos, offset2, NULL); + _gi_ir_node_build_typelib ((GIIrNode *)type->parameter_type1, + node, build, &pos, offset2, NULL); } break; @@ -1555,10 +1554,10 @@ _g_ir_node_build_typelib (GIrNode *node, pos = *offset2 + G_STRUCT_OFFSET (ParamTypeBlob, type); *offset2 += sizeof (ParamTypeBlob) + sizeof (SimpleTypeBlob)*2; - _g_ir_node_build_typelib ((GIrNode *)type->parameter_type1, - node, build, &pos, offset2, NULL); - _g_ir_node_build_typelib ((GIrNode *)type->parameter_type2, - node, build, &pos, offset2, NULL); + _gi_ir_node_build_typelib ((GIIrNode *)type->parameter_type1, + node, build, &pos, offset2, NULL); + _gi_ir_node_build_typelib ((GIIrNode *)type->parameter_type2, + node, build, &pos, offset2, NULL); } break; @@ -1585,14 +1584,14 @@ _g_ir_node_build_typelib (GIrNode *node, } break; - case G_IR_NODE_FIELD: + case GI_IR_NODE_FIELD: { - GIrNodeField *field = (GIrNodeField *)node; + GIIrNodeField *field = (GIIrNodeField *)node; FieldBlob *blob; blob = (FieldBlob *)&data[*offset]; - blob->name = _g_ir_write_string (node->name, strings, data, offset2); + blob->name = _gi_ir_write_string (node->name, strings, data, offset2); blob->readable = field->readable; blob->writable = field->writable; blob->reserved = 0; @@ -1607,8 +1606,8 @@ _g_ir_node_build_typelib (GIrNode *node, blob->has_embedded_type = TRUE; blob->type.offset = GI_INFO_TYPE_CALLBACK; *offset += sizeof (FieldBlob); - _g_ir_node_build_typelib ((GIrNode *)field->callback, - node, build, offset, offset2, NULL); + _gi_ir_node_build_typelib ((GIIrNode *)field->callback, + node, build, offset, offset2, NULL); /* Fields with callbacks are bigger than normal, update count2 * as an extra hint which represents the number of fields which are * callbacks. This allows us to gain constant time performance in the @@ -1622,20 +1621,20 @@ _g_ir_node_build_typelib (GIrNode *node, blob->has_embedded_type = FALSE; /* We handle the size member specially below, so subtract it */ *offset += sizeof (FieldBlob) - sizeof (SimpleTypeBlob); - _g_ir_node_build_typelib ((GIrNode *)field->type, - node, build, offset, offset2, NULL); + _gi_ir_node_build_typelib ((GIIrNode *)field->type, + node, build, offset, offset2, NULL); } } break; - case G_IR_NODE_PROPERTY: + case GI_IR_NODE_PROPERTY: { - GIrNodeProperty *prop = (GIrNodeProperty *)node; + GIIrNodeProperty *prop = (GIIrNodeProperty *)node; PropertyBlob *blob = (PropertyBlob *)&data[*offset]; /* We handle the size member specially below, so subtract it */ *offset += sizeof (PropertyBlob) - sizeof (SimpleTypeBlob); - blob->name = _g_ir_write_string (node->name, strings, data, offset2); + blob->name = _gi_ir_write_string (node->name, strings, data, offset2); blob->deprecated = prop->deprecated; blob->readable = prop->readable; blob->writable = prop->writable; @@ -1647,8 +1646,8 @@ _g_ir_node_build_typelib (GIrNode *node, if (prop->setter != NULL) { - int index = get_index_of_member_type ((GIrNodeInterface*)parent, - G_IR_NODE_FUNCTION, + int index = get_index_of_member_type ((GIIrNodeInterface*)parent, + GI_IR_NODE_FUNCTION, prop->setter); if (index == -1) { @@ -1662,8 +1661,8 @@ _g_ir_node_build_typelib (GIrNode *node, if (prop->getter != NULL) { - int index = get_index_of_member_type ((GIrNodeInterface*)parent, - G_IR_NODE_FUNCTION, + int index = get_index_of_member_type ((GIIrNodeInterface*)parent, + GI_IR_NODE_FUNCTION, prop->getter); if (index == -1) { @@ -1675,16 +1674,16 @@ _g_ir_node_build_typelib (GIrNode *node, else blob->getter = ACCESSOR_SENTINEL; - _g_ir_node_build_typelib ((GIrNode *)prop->type, - node, build, offset, offset2, NULL); + _gi_ir_node_build_typelib ((GIIrNode *)prop->type, + node, build, offset, offset2, NULL); } break; - case G_IR_NODE_FUNCTION: + case GI_IR_NODE_FUNCTION: { FunctionBlob *blob = (FunctionBlob *)&data[*offset]; SignatureBlob *blob2 = (SignatureBlob *)&data[*offset2]; - GIrNodeFunction *function = (GIrNodeFunction *)node; + GIIrNodeFunction *function = (GIIrNodeFunction *)node; guint32 signature; gint n; @@ -1703,14 +1702,14 @@ _g_ir_node_build_typelib (GIrNode *node, blob->wraps_vfunc = function->wraps_vfunc; blob->throws = function->throws; /* Deprecated. Also stored in SignatureBlob. */ blob->index = 0; - blob->name = _g_ir_write_string (node->name, strings, data, offset2); - blob->symbol = _g_ir_write_string (function->symbol, strings, data, offset2); + blob->name = _gi_ir_write_string (node->name, strings, data, offset2); + blob->symbol = _gi_ir_write_string (function->symbol, strings, data, offset2); blob->signature = signature; if (function->is_setter || function->is_getter) { - int index = get_index_of_member_type ((GIrNodeInterface*)parent, - G_IR_NODE_PROPERTY, + int index = get_index_of_member_type ((GIIrNodeInterface*)parent, + GI_IR_NODE_PROPERTY, function->property); if (index == -1) { @@ -1726,14 +1725,14 @@ _g_ir_node_build_typelib (GIrNode *node, * we do want the attributes for it to appear */ build->nodes_with_attributes = g_list_prepend (build->nodes_with_attributes, function->result); - build->n_attributes += g_hash_table_size (((GIrNode *) function->result)->attributes); - g_assert (((GIrNode *) function->result)->offset == 0); - ((GIrNode *) function->result)->offset = signature; + build->n_attributes += g_hash_table_size (((GIIrNode *) function->result)->attributes); + g_assert (((GIIrNode *) function->result)->offset == 0); + ((GIIrNode *) function->result)->offset = signature; g_debug ("building function '%s'", function->symbol); - _g_ir_node_build_typelib ((GIrNode *)function->result->type, - node, build, &signature, offset2, NULL); + _gi_ir_node_build_typelib ((GIIrNode *)function->result->type, + node, build, &signature, offset2, NULL); blob2->may_return_null = function->result->nullable; blob2->caller_owns_return_value = function->result->transfer; @@ -1748,19 +1747,19 @@ _g_ir_node_build_typelib (GIrNode *node, for (l = function->parameters; l; l = l->next) { - GIrNode *param = (GIrNode *)l->data; + GIIrNode *param = (GIIrNode *)l->data; - _g_ir_node_build_typelib (param, node, build, &signature, offset2, NULL); + _gi_ir_node_build_typelib (param, node, build, &signature, offset2, NULL); } } break; - case G_IR_NODE_CALLBACK: + case GI_IR_NODE_CALLBACK: { CallbackBlob *blob = (CallbackBlob *)&data[*offset]; SignatureBlob *blob2 = (SignatureBlob *)&data[*offset2]; - GIrNodeFunction *function = (GIrNodeFunction *)node; + GIIrNodeFunction *function = (GIIrNodeFunction *)node; guint32 signature; gint n; @@ -1773,11 +1772,11 @@ _g_ir_node_build_typelib (GIrNode *node, blob->blob_type = BLOB_TYPE_CALLBACK; blob->deprecated = function->deprecated; blob->reserved = 0; - blob->name = _g_ir_write_string (node->name, strings, data, offset2); + blob->name = _gi_ir_write_string (node->name, strings, data, offset2); blob->signature = signature; - _g_ir_node_build_typelib ((GIrNode *)function->result->type, - node, build, &signature, offset2, NULL); + _gi_ir_node_build_typelib ((GIIrNode *)function->result->type, + node, build, &signature, offset2, NULL); blob2->may_return_null = function->result->nullable; blob2->caller_owns_return_value = function->result->transfer; @@ -1790,18 +1789,18 @@ _g_ir_node_build_typelib (GIrNode *node, for (l = function->parameters; l; l = l->next) { - GIrNode *param = (GIrNode *)l->data; + GIIrNode *param = (GIIrNode *)l->data; - _g_ir_node_build_typelib (param, node, build, &signature, offset2, NULL); + _gi_ir_node_build_typelib (param, node, build, &signature, offset2, NULL); } } break; - case G_IR_NODE_SIGNAL: + case GI_IR_NODE_SIGNAL: { SignalBlob *blob = (SignalBlob *)&data[*offset]; SignatureBlob *blob2 = (SignatureBlob *)&data[*offset2]; - GIrNodeSignal *signal = (GIrNodeSignal *)node; + GIIrNodeSignal *signal = (GIIrNodeSignal *)node; guint32 signature; gint n; @@ -1823,19 +1822,19 @@ _g_ir_node_build_typelib (GIrNode *node, blob->true_stops_emit = 0; /* FIXME */ blob->reserved = 0; blob->class_closure = 0; /* FIXME */ - blob->name = _g_ir_write_string (node->name, strings, data, offset2); + blob->name = _gi_ir_write_string (node->name, strings, data, offset2); blob->signature = signature; /* signal->result is special since it doesn't appear in the serialized format but * we do want the attributes for it to appear */ build->nodes_with_attributes = g_list_prepend (build->nodes_with_attributes, signal->result); - build->n_attributes += g_hash_table_size (((GIrNode *) signal->result)->attributes); - g_assert (((GIrNode *) signal->result)->offset == 0); - ((GIrNode *) signal->result)->offset = signature; + build->n_attributes += g_hash_table_size (((GIIrNode *) signal->result)->attributes); + g_assert (((GIIrNode *) signal->result)->offset == 0); + ((GIIrNode *) signal->result)->offset = signature; - _g_ir_node_build_typelib ((GIrNode *)signal->result->type, - node, build, &signature, offset2, NULL); + _gi_ir_node_build_typelib ((GIIrNode *)signal->result->type, + node, build, &signature, offset2, NULL); blob2->may_return_null = signal->result->nullable; blob2->caller_owns_return_value = signal->result->transfer; @@ -1848,18 +1847,18 @@ _g_ir_node_build_typelib (GIrNode *node, for (l = signal->parameters; l; l = l->next) { - GIrNode *param = (GIrNode *)l->data; + GIIrNode *param = (GIIrNode *)l->data; - _g_ir_node_build_typelib (param, node, build, &signature, offset2, NULL); + _gi_ir_node_build_typelib (param, node, build, &signature, offset2, NULL); } } break; - case G_IR_NODE_VFUNC: + case GI_IR_NODE_VFUNC: { VFuncBlob *blob = (VFuncBlob *)&data[*offset]; SignatureBlob *blob2 = (SignatureBlob *)&data[*offset2]; - GIrNodeVFunc *vfunc = (GIrNodeVFunc *)node; + GIIrNodeVFunc *vfunc = (GIIrNodeVFunc *)node; guint32 signature; gint n; @@ -1869,7 +1868,7 @@ _g_ir_node_build_typelib (GIrNode *node, *offset += sizeof (VFuncBlob); *offset2 += sizeof (SignatureBlob) + n * sizeof (ArgBlob); - blob->name = _g_ir_write_string (node->name, strings, data, offset2); + blob->name = _gi_ir_write_string (node->name, strings, data, offset2); blob->must_chain_up = 0; /* FIXME */ blob->must_be_implemented = 0; /* FIXME */ blob->must_not_be_implemented = 0; /* FIXME */ @@ -1879,7 +1878,7 @@ _g_ir_node_build_typelib (GIrNode *node, if (vfunc->invoker) { - int index = get_index_of_member_type ((GIrNodeInterface*)parent, G_IR_NODE_FUNCTION, vfunc->invoker); + int index = get_index_of_member_type ((GIIrNodeInterface*)parent, GI_IR_NODE_FUNCTION, vfunc->invoker); if (index == -1) { g_error ("Unknown member function %s for vfunc %s", vfunc->invoker, node->name); @@ -1893,8 +1892,8 @@ _g_ir_node_build_typelib (GIrNode *node, blob->reserved2 = 0; blob->signature = signature; - _g_ir_node_build_typelib ((GIrNode *)vfunc->result->type, - node, build, &signature, offset2, NULL); + _gi_ir_node_build_typelib ((GIIrNode *)vfunc->result->type, + node, build, &signature, offset2, NULL); blob2->may_return_null = vfunc->result->nullable; blob2->caller_owns_return_value = vfunc->result->transfer; @@ -1908,24 +1907,24 @@ _g_ir_node_build_typelib (GIrNode *node, for (l = vfunc->parameters; l; l = l->next) { - GIrNode *param = (GIrNode *)l->data; + GIIrNode *param = (GIIrNode *)l->data; - _g_ir_node_build_typelib (param, node, build, &signature, offset2, NULL); + _gi_ir_node_build_typelib (param, node, build, &signature, offset2, NULL); } } break; - case G_IR_NODE_PARAM: + case GI_IR_NODE_PARAM: { ArgBlob *blob = (ArgBlob *)&data[*offset]; - GIrNodeParam *param = (GIrNodeParam *)node; + GIIrNodeParam *param = (GIIrNodeParam *)node; /* The offset for this one is smaller than the struct because * we recursively build the simple type inline here below. */ *offset += sizeof (ArgBlob) - sizeof (SimpleTypeBlob); - blob->name = _g_ir_write_string (node->name, strings, data, offset2); + blob->name = _gi_ir_write_string (node->name, strings, data, offset2); blob->in = param->in; blob->out = param->out; blob->caller_allocates = param->caller_allocates; @@ -1940,14 +1939,14 @@ _g_ir_node_build_typelib (GIrNode *node, blob->closure = param->closure; blob->destroy = param->destroy; - _g_ir_node_build_typelib ((GIrNode *)param->type, node, build, offset, offset2, NULL); + _gi_ir_node_build_typelib ((GIIrNode *)param->type, node, build, offset, offset2, NULL); } break; - case G_IR_NODE_STRUCT: + case GI_IR_NODE_STRUCT: { StructBlob *blob = (StructBlob *)&data[*offset]; - GIrNodeStruct *struct_ = (GIrNodeStruct *)node; + GIIrNodeStruct *struct_ = (GIIrNodeStruct *)node; GList *members; blob->blob_type = BLOB_TYPE_STRUCT; @@ -1955,15 +1954,15 @@ _g_ir_node_build_typelib (GIrNode *node, blob->deprecated = struct_->deprecated; blob->is_gtype_struct = struct_->is_gtype_struct; blob->reserved = 0; - blob->name = _g_ir_write_string (node->name, strings, data, offset2); + blob->name = _gi_ir_write_string (node->name, strings, data, offset2); blob->alignment = struct_->alignment; blob->size = struct_->size; if (struct_->gtype_name) { blob->unregistered = FALSE; - blob->gtype_name = _g_ir_write_string (struct_->gtype_name, strings, data, offset2); - blob->gtype_init = _g_ir_write_string (struct_->gtype_init, strings, data, offset2); + blob->gtype_name = _gi_ir_write_string (struct_->gtype_name, strings, data, offset2); + blob->gtype_init = _gi_ir_write_string (struct_->gtype_init, strings, data, offset2); } else { @@ -1973,9 +1972,9 @@ _g_ir_node_build_typelib (GIrNode *node, } if (struct_->copy_func) - blob->copy_func = _g_ir_write_string (struct_->copy_func, strings, data, offset2); + blob->copy_func = _gi_ir_write_string (struct_->copy_func, strings, data, offset2); if (struct_->free_func) - blob->free_func = _g_ir_write_string (struct_->free_func, strings, data, offset2); + blob->free_func = _gi_ir_write_string (struct_->free_func, strings, data, offset2); blob->n_fields = 0; blob->n_methods = 0; @@ -1984,31 +1983,31 @@ _g_ir_node_build_typelib (GIrNode *node, members = g_list_copy (struct_->members); - _g_ir_node_build_members (&members, G_IR_NODE_FIELD, &blob->n_fields, - node, build, offset, offset2, NULL); + _gi_ir_node_build_members (&members, GI_IR_NODE_FIELD, &blob->n_fields, + node, build, offset, offset2, NULL); - _g_ir_node_build_members (&members, G_IR_NODE_FUNCTION, &blob->n_methods, - node, build, offset, offset2, NULL); + _gi_ir_node_build_members (&members, GI_IR_NODE_FUNCTION, &blob->n_methods, + node, build, offset, offset2, NULL); - _g_ir_node_check_unhandled_members (&members, node->type); + _gi_ir_node_check_unhandled_members (&members, node->type); g_assert (members == NULL); } break; - case G_IR_NODE_BOXED: + case GI_IR_NODE_BOXED: { StructBlob *blob = (StructBlob *)&data[*offset]; - GIrNodeBoxed *boxed = (GIrNodeBoxed *)node; + GIIrNodeBoxed *boxed = (GIIrNodeBoxed *)node; GList *members; blob->blob_type = BLOB_TYPE_BOXED; blob->deprecated = boxed->deprecated; blob->unregistered = FALSE; blob->reserved = 0; - blob->name = _g_ir_write_string (node->name, strings, data, offset2); - blob->gtype_name = _g_ir_write_string (boxed->gtype_name, strings, data, offset2); - blob->gtype_init = _g_ir_write_string (boxed->gtype_init, strings, data, offset2); + blob->name = _gi_ir_write_string (node->name, strings, data, offset2); + blob->gtype_name = _gi_ir_write_string (boxed->gtype_name, strings, data, offset2); + blob->gtype_init = _gi_ir_write_string (boxed->gtype_init, strings, data, offset2); blob->alignment = boxed->alignment; blob->size = boxed->size; @@ -2019,35 +2018,35 @@ _g_ir_node_build_typelib (GIrNode *node, members = g_list_copy (boxed->members); - _g_ir_node_build_members (&members, G_IR_NODE_FIELD, &blob->n_fields, - node, build, offset, offset2, NULL); + _gi_ir_node_build_members (&members, GI_IR_NODE_FIELD, &blob->n_fields, + node, build, offset, offset2, NULL); - _g_ir_node_build_members (&members, G_IR_NODE_FUNCTION, &blob->n_methods, - node, build, offset, offset2, NULL); + _gi_ir_node_build_members (&members, GI_IR_NODE_FUNCTION, &blob->n_methods, + node, build, offset, offset2, NULL); - _g_ir_node_check_unhandled_members (&members, node->type); + _gi_ir_node_check_unhandled_members (&members, node->type); g_assert (members == NULL); } break; - case G_IR_NODE_UNION: + case GI_IR_NODE_UNION: { UnionBlob *blob = (UnionBlob *)&data[*offset]; - GIrNodeUnion *union_ = (GIrNodeUnion *)node; + GIIrNodeUnion *union_ = (GIIrNodeUnion *)node; GList *members; blob->blob_type = BLOB_TYPE_UNION; blob->deprecated = union_->deprecated; blob->reserved = 0; - blob->name = _g_ir_write_string (node->name, strings, data, offset2); + blob->name = _gi_ir_write_string (node->name, strings, data, offset2); blob->alignment = union_->alignment; blob->size = union_->size; if (union_->gtype_name) { blob->unregistered = FALSE; - blob->gtype_name = _g_ir_write_string (union_->gtype_name, strings, data, offset2); - blob->gtype_init = _g_ir_write_string (union_->gtype_init, strings, data, offset2); + blob->gtype_name = _gi_ir_write_string (union_->gtype_name, strings, data, offset2); + blob->gtype_init = _gi_ir_write_string (union_->gtype_init, strings, data, offset2); } else { @@ -2062,9 +2061,9 @@ _g_ir_node_build_typelib (GIrNode *node, blob->discriminator_offset = union_->discriminator_offset; if (union_->copy_func) - blob->copy_func = _g_ir_write_string (union_->copy_func, strings, data, offset2); + blob->copy_func = _gi_ir_write_string (union_->copy_func, strings, data, offset2); if (union_->free_func) - blob->free_func = _g_ir_write_string (union_->free_func, strings, data, offset2); + blob->free_func = _gi_ir_write_string (union_->free_func, strings, data, offset2); /* We don't support Union discriminators right now. */ /* @@ -2072,8 +2071,8 @@ _g_ir_node_build_typelib (GIrNode *node, { *offset += 28; blob->discriminated = TRUE; - _g_ir_node_build_typelib ((GIrNode *)union_->discriminator_type, - build, offset, offset2, NULL); + _gi_ir_node_build_typelib ((GIIrNode *)union_->discriminator_type, + build, offset, offset2, NULL); } else { @@ -2084,13 +2083,13 @@ _g_ir_node_build_typelib (GIrNode *node, members = g_list_copy (union_->members); - _g_ir_node_build_members (&members, G_IR_NODE_FIELD, &blob->n_fields, - node, build, offset, offset2, NULL); + _gi_ir_node_build_members (&members, GI_IR_NODE_FIELD, &blob->n_fields, + node, build, offset, offset2, NULL); - _g_ir_node_build_members (&members, G_IR_NODE_FUNCTION, &blob->n_functions, - node, build, offset, offset2, NULL); + _gi_ir_node_build_members (&members, GI_IR_NODE_FUNCTION, &blob->n_functions, + node, build, offset, offset2, NULL); - _g_ir_node_check_unhandled_members (&members, node->type); + _gi_ir_node_check_unhandled_members (&members, node->type); g_assert (members == NULL); @@ -2098,23 +2097,23 @@ _g_ir_node_build_typelib (GIrNode *node, { for (l = union_->discriminators; l; l = l->next) { - GIrNode *member = (GIrNode *)l->data; + GIIrNode *member = (GIIrNode *)l->data; - _g_ir_node_build_typelib (member, node, build, offset, offset2, NULL); + _gi_ir_node_build_typelib (member, node, build, offset, offset2, NULL); } } } break; - case G_IR_NODE_ENUM: - case G_IR_NODE_FLAGS: + case GI_IR_NODE_ENUM: + case GI_IR_NODE_FLAGS: { EnumBlob *blob = (EnumBlob *)&data[*offset]; - GIrNodeEnum *enum_ = (GIrNodeEnum *)node; + GIIrNodeEnum *enum_ = (GIIrNodeEnum *)node; *offset += sizeof (EnumBlob); - if (node->type == G_IR_NODE_ENUM) + if (node->type == GI_IR_NODE_ENUM) blob->blob_type = BLOB_TYPE_ENUM; else blob->blob_type = BLOB_TYPE_FLAGS; @@ -2122,12 +2121,12 @@ _g_ir_node_build_typelib (GIrNode *node, blob->deprecated = enum_->deprecated; blob->reserved = 0; blob->storage_type = enum_->storage_type; - blob->name = _g_ir_write_string (node->name, strings, data, offset2); + blob->name = _gi_ir_write_string (node->name, strings, data, offset2); if (enum_->gtype_name) { blob->unregistered = FALSE; - blob->gtype_name = _g_ir_write_string (enum_->gtype_name, strings, data, offset2); - blob->gtype_init = _g_ir_write_string (enum_->gtype_init, strings, data, offset2); + blob->gtype_name = _gi_ir_write_string (enum_->gtype_name, strings, data, offset2); + blob->gtype_init = _gi_ir_write_string (enum_->gtype_init, strings, data, offset2); } else { @@ -2136,7 +2135,7 @@ _g_ir_node_build_typelib (GIrNode *node, blob->gtype_init = 0; } if (enum_->error_domain) - blob->error_domain = _g_ir_write_string (enum_->error_domain, strings, data, offset2); + blob->error_domain = _gi_ir_write_string (enum_->error_domain, strings, data, offset2); else blob->error_domain = 0; @@ -2145,26 +2144,26 @@ _g_ir_node_build_typelib (GIrNode *node, for (l = enum_->values; l; l = l->next) { - GIrNode *value = (GIrNode *)l->data; + GIIrNode *value = (GIIrNode *)l->data; blob->n_values++; - _g_ir_node_build_typelib (value, node, build, offset, offset2, NULL); + _gi_ir_node_build_typelib (value, node, build, offset, offset2, NULL); } for (l = enum_->methods; l; l = l->next) { - GIrNode *method = (GIrNode *)l->data; + GIIrNode *method = (GIIrNode *)l->data; blob->n_methods++; - _g_ir_node_build_typelib (method, node, build, offset, offset2, NULL); + _gi_ir_node_build_typelib (method, node, build, offset, offset2, NULL); } } break; - case G_IR_NODE_OBJECT: + case GI_IR_NODE_OBJECT: { ObjectBlob *blob = (ObjectBlob *)&data[*offset]; - GIrNodeInterface *object = (GIrNodeInterface *)node; + GIIrNodeInterface *object = (GIIrNodeInterface *)node; GList *members; blob->blob_type = BLOB_TYPE_OBJECT; @@ -2173,17 +2172,17 @@ _g_ir_node_build_typelib (GIrNode *node, blob->final_ = object->final_; blob->deprecated = object->deprecated; blob->reserved = 0; - blob->name = _g_ir_write_string (node->name, strings, data, offset2); - blob->gtype_name = _g_ir_write_string (object->gtype_name, strings, data, offset2); - blob->gtype_init = _g_ir_write_string (object->gtype_init, strings, data, offset2); + blob->name = _gi_ir_write_string (node->name, strings, data, offset2); + blob->gtype_name = _gi_ir_write_string (object->gtype_name, strings, data, offset2); + blob->gtype_init = _gi_ir_write_string (object->gtype_init, strings, data, offset2); if (object->ref_func) - blob->ref_func = _g_ir_write_string (object->ref_func, strings, data, offset2); + blob->ref_func = _gi_ir_write_string (object->ref_func, strings, data, offset2); if (object->unref_func) - blob->unref_func = _g_ir_write_string (object->unref_func, strings, data, offset2); + blob->unref_func = _gi_ir_write_string (object->unref_func, strings, data, offset2); if (object->set_value_func) - blob->set_value_func = _g_ir_write_string (object->set_value_func, strings, data, offset2); + blob->set_value_func = _gi_ir_write_string (object->set_value_func, strings, data, offset2); if (object->get_value_func) - blob->get_value_func = _g_ir_write_string (object->get_value_func, strings, data, offset2); + blob->get_value_func = _gi_ir_write_string (object->get_value_func, strings, data, offset2); if (object->parent) blob->parent = find_entry (build, object->parent); else @@ -2213,47 +2212,47 @@ _g_ir_node_build_typelib (GIrNode *node, members = g_list_copy (object->members); *offset = ALIGN_VALUE (*offset, 4); - _g_ir_node_build_members (&members, G_IR_NODE_FIELD, &blob->n_fields, - node, build, offset, offset2, &blob->n_field_callbacks); + _gi_ir_node_build_members (&members, GI_IR_NODE_FIELD, &blob->n_fields, + node, build, offset, offset2, &blob->n_field_callbacks); *offset = ALIGN_VALUE (*offset, 4); - _g_ir_node_build_members (&members, G_IR_NODE_PROPERTY, &blob->n_properties, - node, build, offset, offset2, NULL); + _gi_ir_node_build_members (&members, GI_IR_NODE_PROPERTY, &blob->n_properties, + node, build, offset, offset2, NULL); *offset = ALIGN_VALUE (*offset, 4); - _g_ir_node_build_members (&members, G_IR_NODE_FUNCTION, &blob->n_methods, - node, build, offset, offset2, NULL); + _gi_ir_node_build_members (&members, GI_IR_NODE_FUNCTION, &blob->n_methods, + node, build, offset, offset2, NULL); *offset = ALIGN_VALUE (*offset, 4); - _g_ir_node_build_members (&members, G_IR_NODE_SIGNAL, &blob->n_signals, - node, build, offset, offset2, NULL); + _gi_ir_node_build_members (&members, GI_IR_NODE_SIGNAL, &blob->n_signals, + node, build, offset, offset2, NULL); *offset = ALIGN_VALUE (*offset, 4); - _g_ir_node_build_members (&members, G_IR_NODE_VFUNC, &blob->n_vfuncs, - node, build, offset, offset2, NULL); + _gi_ir_node_build_members (&members, GI_IR_NODE_VFUNC, &blob->n_vfuncs, + node, build, offset, offset2, NULL); *offset = ALIGN_VALUE (*offset, 4); - _g_ir_node_build_members (&members, G_IR_NODE_CONSTANT, &blob->n_constants, - node, build, offset, offset2, NULL); + _gi_ir_node_build_members (&members, GI_IR_NODE_CONSTANT, &blob->n_constants, + node, build, offset, offset2, NULL); - _g_ir_node_check_unhandled_members (&members, node->type); + _gi_ir_node_check_unhandled_members (&members, node->type); g_assert (members == NULL); } break; - case G_IR_NODE_INTERFACE: + case GI_IR_NODE_INTERFACE: { InterfaceBlob *blob = (InterfaceBlob *)&data[*offset]; - GIrNodeInterface *iface = (GIrNodeInterface *)node; + GIIrNodeInterface *iface = (GIIrNodeInterface *)node; GList *members; blob->blob_type = BLOB_TYPE_INTERFACE; blob->deprecated = iface->deprecated; blob->reserved = 0; - blob->name = _g_ir_write_string (node->name, strings, data, offset2); - blob->gtype_name = _g_ir_write_string (iface->gtype_name, strings, data, offset2); - blob->gtype_init = _g_ir_write_string (iface->gtype_init, strings, data, offset2); + blob->name = _gi_ir_write_string (node->name, strings, data, offset2); + blob->gtype_name = _gi_ir_write_string (iface->gtype_name, strings, data, offset2); + blob->gtype_init = _gi_ir_write_string (iface->gtype_init, strings, data, offset2); if (iface->glib_type_struct) blob->gtype_struct = find_entry (build, iface->glib_type_struct); else @@ -2276,49 +2275,49 @@ _g_ir_node_build_typelib (GIrNode *node, members = g_list_copy (iface->members); *offset = ALIGN_VALUE (*offset, 4); - _g_ir_node_build_members (&members, G_IR_NODE_PROPERTY, &blob->n_properties, - node, build, offset, offset2, NULL); + _gi_ir_node_build_members (&members, GI_IR_NODE_PROPERTY, &blob->n_properties, + node, build, offset, offset2, NULL); *offset = ALIGN_VALUE (*offset, 4); - _g_ir_node_build_members (&members, G_IR_NODE_FUNCTION, &blob->n_methods, - node, build, offset, offset2, NULL); + _gi_ir_node_build_members (&members, GI_IR_NODE_FUNCTION, &blob->n_methods, + node, build, offset, offset2, NULL); *offset = ALIGN_VALUE (*offset, 4); - _g_ir_node_build_members (&members, G_IR_NODE_SIGNAL, &blob->n_signals, - node, build, offset, offset2, NULL); + _gi_ir_node_build_members (&members, GI_IR_NODE_SIGNAL, &blob->n_signals, + node, build, offset, offset2, NULL); *offset = ALIGN_VALUE (*offset, 4); - _g_ir_node_build_members (&members, G_IR_NODE_VFUNC, &blob->n_vfuncs, - node, build, offset, offset2, NULL); + _gi_ir_node_build_members (&members, GI_IR_NODE_VFUNC, &blob->n_vfuncs, + node, build, offset, offset2, NULL); *offset = ALIGN_VALUE (*offset, 4); - _g_ir_node_build_members (&members, G_IR_NODE_CONSTANT, &blob->n_constants, - node, build, offset, offset2, NULL); + _gi_ir_node_build_members (&members, GI_IR_NODE_CONSTANT, &blob->n_constants, + node, build, offset, offset2, NULL); - _g_ir_node_check_unhandled_members (&members, node->type); + _gi_ir_node_check_unhandled_members (&members, node->type); g_assert (members == NULL); } break; - case G_IR_NODE_VALUE: + case GI_IR_NODE_VALUE: { - GIrNodeValue *value = (GIrNodeValue *)node; + GIIrNodeValue *value = (GIIrNodeValue *)node; ValueBlob *blob = (ValueBlob *)&data[*offset]; *offset += sizeof (ValueBlob); blob->deprecated = value->deprecated; blob->reserved = 0; blob->unsigned_value = value->value >= 0 ? 1 : 0; - blob->name = _g_ir_write_string (node->name, strings, data, offset2); + blob->name = _gi_ir_write_string (node->name, strings, data, offset2); blob->value = (gint32)value->value; } break; - case G_IR_NODE_CONSTANT: + case GI_IR_NODE_CONSTANT: { - GIrNodeConstant *constant = (GIrNodeConstant *)node; + GIIrNodeConstant *constant = (GIIrNodeConstant *)node; ConstantBlob *blob = (ConstantBlob *)&data[*offset]; guint32 pos; @@ -2328,7 +2327,7 @@ _g_ir_node_build_typelib (GIrNode *node, blob->blob_type = BLOB_TYPE_CONSTANT; blob->deprecated = constant->deprecated; blob->reserved = 0; - blob->name = _g_ir_write_string (node->name, strings, data, offset2); + blob->name = _gi_ir_write_string (node->name, strings, data, offset2); blob->offset = *offset2; switch (constant->type->tag) @@ -2387,7 +2386,7 @@ _g_ir_node_build_typelib (GIrNode *node, } *offset2 += ALIGN_VALUE (blob->size, 4); - _g_ir_node_build_typelib ((GIrNode *)constant->type, node, build, &pos, offset2, NULL); + _gi_ir_node_build_typelib ((GIIrNode *)constant->type, node, build, &pos, offset2, NULL); } break; default: @@ -2398,12 +2397,12 @@ _g_ir_node_build_typelib (GIrNode *node, node->name ? "'" : "", node->name ? node->name : "", node->name ? "' " : "", - node, _g_ir_node_type_to_string (node->type), + node, _gi_ir_node_type_to_string (node->type), old_offset, *offset, old_offset2, *offset2); - if (*offset2 - old_offset2 + *offset - old_offset > _g_ir_node_get_full_size (node)) + if (*offset2 - old_offset2 + *offset - old_offset > _gi_ir_node_get_full_size (node)) g_error ("exceeding space reservation; offset: %d (prev %d) offset2: %d (prev %d) nodesize: %d", - *offset, old_offset, *offset2, old_offset2, _g_ir_node_get_full_size (node)); + *offset, old_offset, *offset2, old_offset2, _gi_ir_node_get_full_size (node)); if (appended_stack) build->stack = g_list_delete_link (build->stack, build->stack); @@ -2414,10 +2413,10 @@ _g_ir_node_build_typelib (GIrNode *node, * typelib is not large enough to hold the string, reallocate it. */ guint32 -_g_ir_write_string (const gchar *str, - GHashTable *strings, - guchar *data, - guint32 *offset) +_gi_ir_write_string (const gchar *str, + GHashTable *strings, + guchar *data, + guint32 *offset) { gpointer value; guint32 start; diff --git a/girepository/giroffsets.c b/girepository/giroffsets.c index b562566ee..2fa2a1e18 100644 --- a/girepository/giroffsets.c +++ b/girepository/giroffsets.c @@ -70,7 +70,7 @@ typedef enum { } Enum9; static void -compute_enum_storage_type (GIrNodeEnum *enum_node) +compute_enum_storage_type (GIIrNodeEnum *enum_node) { GList *l; gint64 max_value = 0; @@ -83,7 +83,7 @@ compute_enum_storage_type (GIrNodeEnum *enum_node) for (l = enum_node->values; l; l = l->next) { - GIrNodeValue *value = l->data; + GIIrNodeValue *value = l->data; if (value->value > max_value) max_value = value->value; if (value->value < min_value) @@ -148,9 +148,9 @@ compute_enum_storage_type (GIrNodeEnum *enum_node) } static gboolean -get_enum_size_alignment (GIrNodeEnum *enum_node, - gint *size, - gint *alignment) +get_enum_size_alignment (GIIrNodeEnum *enum_node, + gint *size, + gint *alignment) { ffi_type *type_ffi; @@ -176,7 +176,7 @@ get_enum_size_alignment (GIrNodeEnum *enum_node, break; default: g_error ("Unexpected enum storage type %s", - g_type_tag_to_string (enum_node->storage_type)); + gi_type_tag_to_string (enum_node->storage_type)); } *size = type_ffi->size; @@ -186,63 +186,63 @@ get_enum_size_alignment (GIrNodeEnum *enum_node, } static gboolean -get_interface_size_alignment (GIrTypelibBuild *build, - GIrNodeType *type, - gint *size, - gint *alignment, - const char *who) +get_interface_size_alignment (GIIrTypelibBuild *build, + GIIrNodeType *type, + gint *size, + gint *alignment, + const char *who) { - GIrNode *iface; + GIIrNode *iface; - iface = _g_ir_find_node (build, ((GIrNode*)type)->module, type->giinterface); + iface = _gi_ir_find_node (build, ((GIIrNode*)type)->module, type->giinterface); if (!iface) { - _g_ir_module_fatal (build, 0, "Can't resolve type '%s' for %s", type->giinterface, who); + _gi_ir_module_fatal (build, 0, "Can't resolve type '%s' for %s", type->giinterface, who); *size = -1; *alignment = -1; return FALSE; } - _g_ir_node_compute_offsets (build, iface); + _gi_ir_node_compute_offsets (build, iface); switch (iface->type) { - case G_IR_NODE_BOXED: + case GI_IR_NODE_BOXED: { - GIrNodeBoxed *boxed = (GIrNodeBoxed *)iface; + GIIrNodeBoxed *boxed = (GIIrNodeBoxed *)iface; *size = boxed->size; *alignment = boxed->alignment; break; } - case G_IR_NODE_STRUCT: + case GI_IR_NODE_STRUCT: { - GIrNodeStruct *struct_ = (GIrNodeStruct *)iface; + GIIrNodeStruct *struct_ = (GIIrNodeStruct *)iface; *size = struct_->size; *alignment = struct_->alignment; break; } - case G_IR_NODE_OBJECT: - case G_IR_NODE_INTERFACE: + case GI_IR_NODE_OBJECT: + case GI_IR_NODE_INTERFACE: { - GIrNodeInterface *interface = (GIrNodeInterface *)iface; + GIIrNodeInterface *interface = (GIIrNodeInterface *)iface; *size = interface->size; *alignment = interface->alignment; break; } - case G_IR_NODE_UNION: + case GI_IR_NODE_UNION: { - GIrNodeUnion *union_ = (GIrNodeUnion *)iface; + GIIrNodeUnion *union_ = (GIIrNodeUnion *)iface; *size = union_->size; *alignment = union_->alignment; break; } - case G_IR_NODE_ENUM: - case G_IR_NODE_FLAGS: + case GI_IR_NODE_ENUM: + case GI_IR_NODE_FLAGS: { - return get_enum_size_alignment ((GIrNodeEnum *)iface, + return get_enum_size_alignment ((GIIrNodeEnum *)iface, size, alignment); } - case G_IR_NODE_CALLBACK: + case GI_IR_NODE_CALLBACK: { *size = ffi_type_pointer.size; *alignment = ffi_type_pointer.alignment; @@ -252,7 +252,7 @@ get_interface_size_alignment (GIrTypelibBuild *build, { g_warning ("%s has is not a pointer and is of type %s", who, - _g_ir_node_type_to_string (iface->type)); + _gi_ir_node_type_to_string (iface->type)); *size = -1; *alignment = -1; break; @@ -263,11 +263,11 @@ get_interface_size_alignment (GIrTypelibBuild *build, } static gboolean -get_type_size_alignment (GIrTypelibBuild *build, - GIrNodeType *type, - gint *size, - gint *alignment, - const char *who) +get_type_size_alignment (GIIrTypelibBuild *build, + GIIrNodeType *type, + gint *size, + gint *alignment, + const char *who) { ffi_type *type_ffi; @@ -314,7 +314,7 @@ get_type_size_alignment (GIrTypelibBuild *build, { g_warning ("%s has is not a pointer and is of type %s", who, - g_type_tag_to_string (type->tag)); + gi_type_tag_to_string (type->tag)); *size = -1; *alignment = -1; return FALSE; @@ -330,17 +330,17 @@ get_type_size_alignment (GIrTypelibBuild *build, } static gboolean -get_field_size_alignment (GIrTypelibBuild *build, - GIrNodeField *field, - GIrNode *parent_node, - gint *size, - gint *alignment) +get_field_size_alignment (GIIrTypelibBuild *build, + GIIrNodeField *field, + GIIrNode *parent_node, + gint *size, + gint *alignment) { - GIrModule *module = build->module; + GIIrModule *module = build->module; gchar *who; gboolean success; - who = g_strdup_printf ("field %s.%s.%s", module->name, parent_node->name, ((GIrNode *)field)->name); + who = g_strdup_printf ("field %s.%s.%s", module->name, parent_node->name, ((GIIrNode *)field)->name); if (field->callback) { @@ -358,11 +358,11 @@ get_field_size_alignment (GIrTypelibBuild *build, #define GI_ALIGN(n, align) (((n) + (align) - 1) & ~((align) - 1)) static gboolean -compute_struct_field_offsets (GIrTypelibBuild *build, - GIrNode *node, - GList *members, - gint *size_out, - gint *alignment_out) +compute_struct_field_offsets (GIIrTypelibBuild *build, + GIIrNode *node, + GList *members, + gint *size_out, + gint *alignment_out) { int size = 0; int alignment = 1; @@ -373,11 +373,11 @@ compute_struct_field_offsets (GIrTypelibBuild *build, for (l = members; l; l = l->next) { - GIrNode *member = (GIrNode *)l->data; + GIIrNode *member = (GIIrNode *)l->data; - if (member->type == G_IR_NODE_FIELD) + if (member->type == GI_IR_NODE_FIELD) { - GIrNodeField *field = (GIrNodeField *)member; + GIIrNodeField *field = (GIIrNodeField *)member; if (!have_error) { @@ -399,7 +399,7 @@ compute_struct_field_offsets (GIrTypelibBuild *build, if (have_error) field->offset = -1; } - else if (member->type == G_IR_NODE_CALLBACK) + else if (member->type == GI_IR_NODE_CALLBACK) { size = GI_ALIGN (size, ffi_type_pointer.alignment); alignment = MAX (alignment, ffi_type_pointer.alignment); @@ -425,11 +425,11 @@ compute_struct_field_offsets (GIrTypelibBuild *build, } static gboolean -compute_union_field_offsets (GIrTypelibBuild *build, - GIrNode *node, - GList *members, - gint *size_out, - gint *alignment_out) +compute_union_field_offsets (GIIrTypelibBuild *build, + GIIrNode *node, + GList *members, + gint *size_out, + gint *alignment_out) { int size = 0; int alignment = 1; @@ -440,11 +440,11 @@ compute_union_field_offsets (GIrTypelibBuild *build, for (l = members; l; l = l->next) { - GIrNode *member = (GIrNode *)l->data; + GIIrNode *member = (GIIrNode *)l->data; - if (member->type == G_IR_NODE_FIELD) + if (member->type == GI_IR_NODE_FIELD) { - GIrNodeField *field = (GIrNodeField *)member; + GIIrNodeField *field = (GIIrNodeField *)member; if (!have_error) { @@ -481,11 +481,11 @@ compute_union_field_offsets (GIrTypelibBuild *build, } static gboolean -check_needs_computation (GIrTypelibBuild *build, - GIrNode *node, - gint alignment) +check_needs_computation (GIIrTypelibBuild *build, + GIIrNode *node, + gint alignment) { - GIrModule *module = build->module; + GIIrModule *module = build->module; /* * 0: Not yet computed * >0: Previously succeeded @@ -502,22 +502,22 @@ check_needs_computation (GIrTypelibBuild *build, } /* - * _g_ir_node_compute_offsets: + * _gi_ir_node_compute_offsets: * @build: Current typelib build - * @node: a #GIrNode + * @node: a #GIIrNode * * If a node is a a structure or union, makes sure that the field * offsets have been computed, and also computes the overall size and * alignment for the type. */ void -_g_ir_node_compute_offsets (GIrTypelibBuild *build, - GIrNode *node) +_gi_ir_node_compute_offsets (GIIrTypelibBuild *build, + GIIrNode *node) { gboolean appended_stack; if (build->stack) - appended_stack = node != (GIrNode*)build->stack->data; + appended_stack = node != (GIIrNode*)build->stack->data; else appended_stack = TRUE; if (appended_stack) @@ -525,9 +525,9 @@ _g_ir_node_compute_offsets (GIrTypelibBuild *build, switch (node->type) { - case G_IR_NODE_BOXED: + case GI_IR_NODE_BOXED: { - GIrNodeBoxed *boxed = (GIrNodeBoxed *)node; + GIIrNodeBoxed *boxed = (GIIrNodeBoxed *)node; if (!check_needs_computation (build, node, boxed->alignment)) return; @@ -536,9 +536,9 @@ _g_ir_node_compute_offsets (GIrTypelibBuild *build, &boxed->size, &boxed->alignment); break; } - case G_IR_NODE_STRUCT: + case GI_IR_NODE_STRUCT: { - GIrNodeStruct *struct_ = (GIrNodeStruct *)node; + GIIrNodeStruct *struct_ = (GIIrNodeStruct *)node; if (!check_needs_computation (build, node, struct_->alignment)) return; @@ -547,10 +547,10 @@ _g_ir_node_compute_offsets (GIrTypelibBuild *build, &struct_->size, &struct_->alignment); break; } - case G_IR_NODE_OBJECT: - case G_IR_NODE_INTERFACE: + case GI_IR_NODE_OBJECT: + case GI_IR_NODE_INTERFACE: { - GIrNodeInterface *iface = (GIrNodeInterface *)node; + GIIrNodeInterface *iface = (GIIrNodeInterface *)node; if (!check_needs_computation (build, node, iface->alignment)) return; @@ -559,21 +559,21 @@ _g_ir_node_compute_offsets (GIrTypelibBuild *build, &iface->size, &iface->alignment); break; } - case G_IR_NODE_UNION: + case GI_IR_NODE_UNION: { - GIrNodeUnion *union_ = (GIrNodeUnion *)node; + GIIrNodeUnion *union_ = (GIIrNodeUnion *)node; if (!check_needs_computation (build, node, union_->alignment)) return; - compute_union_field_offsets (build, (GIrNode*)union_, union_->members, + compute_union_field_offsets (build, (GIIrNode*)union_, union_->members, &union_->size, &union_->alignment); break; } - case G_IR_NODE_ENUM: - case G_IR_NODE_FLAGS: + case GI_IR_NODE_ENUM: + case GI_IR_NODE_FLAGS: { - GIrNodeEnum *enum_ = (GIrNodeEnum *)node; + GIIrNodeEnum *enum_ = (GIIrNodeEnum *)node; if (enum_->storage_type != GI_TYPE_TAG_VOID) /* already done */ return; diff --git a/girepository/girparser-private.h b/girepository/girparser-private.h index a7e704fd4..6683ce6b1 100644 --- a/girepository/girparser-private.h +++ b/girepository/girparser-private.h @@ -29,21 +29,21 @@ G_BEGIN_DECLS #include "girmodule-private.h" -typedef struct _GIrParser GIrParser; +typedef struct _GIIrParser GIIrParser; -GIrParser *_g_ir_parser_new (void); -void _g_ir_parser_free (GIrParser *parser); -void _g_ir_parser_set_includes (GIrParser *parser, - const gchar *const *includes); +GIIrParser *_gi_ir_parser_new (void); +void _gi_ir_parser_free (GIIrParser *parser); +void _gi_ir_parser_set_includes (GIIrParser *parser, + const gchar *const *includes); -GIrModule *_g_ir_parser_parse_string (GIrParser *parser, - const gchar *namespace, - const gchar *filename, - const gchar *buffer, - gssize length, - GError **error); -GIrModule *_g_ir_parser_parse_file (GIrParser *parser, - const gchar *filename, - GError **error); +GIIrModule *_gi_ir_parser_parse_string (GIIrParser *parser, + const gchar *namespace, + const gchar *filename, + const gchar *buffer, + gssize length, + GError **error); +GIIrModule *_gi_ir_parser_parse_file (GIIrParser *parser, + const gchar *filename, + GError **error); G_END_DECLS diff --git a/girepository/girparser.c b/girepository/girparser.c index 57cd26bf4..fd360f189 100644 --- a/girepository/girparser.c +++ b/girepository/girparser.c @@ -56,7 +56,7 @@ NULL) #endif -struct _GIrParser +struct _GIIrParser { gchar **includes; gchar **gi_gir_path; @@ -105,7 +105,7 @@ typedef enum typedef struct _ParseContext ParseContext; struct _ParseContext { - GIrParser *parser; + GIIrParser *parser; ParseState state; int unknown_depth; @@ -121,16 +121,16 @@ struct _ParseContext const char *file_path; const char *namespace; const char *c_prefix; - GIrModule *current_module; + GIIrModule *current_module; GSList *node_stack; char *current_alias; - GIrNode *current_typed; + GIIrNode *current_typed; GList *type_stack; GList *type_parameters; int type_depth; ParseState in_embedded_state; }; -#define CURRENT_NODE(ctx) ((GIrNode *)((ctx)->node_stack->data)) +#define CURRENT_NODE(ctx) ((GIIrNode *)((ctx)->node_stack->data)) static void start_element_handler (GMarkupParseContext *context, const gchar *element_name, @@ -182,10 +182,10 @@ static const gchar *find_attribute (const gchar *name, const gchar **attribute_values); -GIrParser * -_g_ir_parser_new (void) +GIIrParser * +_gi_ir_parser_new (void) { - GIrParser *parser = g_slice_new0 (GIrParser); + GIIrParser *parser = g_slice_new0 (GIIrParser); const char *gi_gir_path = g_getenv ("GI_GIR_PATH"); if (gi_gir_path != NULL) @@ -195,7 +195,7 @@ _g_ir_parser_new (void) } void -_g_ir_parser_free (GIrParser *parser) +_gi_ir_parser_free (GIIrParser *parser) { GList *l; @@ -203,14 +203,14 @@ _g_ir_parser_free (GIrParser *parser) g_strfreev (parser->gi_gir_path); for (l = parser->parsed_modules; l; l = l->next) - _g_ir_module_free (l->data); + _gi_ir_module_free (l->data); - g_slice_free (GIrParser, parser); + g_slice_free (GIIrParser, parser); } void -_g_ir_parser_set_includes (GIrParser *parser, - const gchar *const *includes) +_gi_ir_parser_set_includes (GIIrParser *parser, + const gchar *const *includes) { g_strfreev (parser->includes); @@ -291,8 +291,8 @@ static GMarkupParser firstpass_parser = }; static char * -locate_gir (GIrParser *parser, - const char *girname) +locate_gir (GIIrParser *parser, + const char *girname) { const gchar *const *datadirs; const gchar *const *dir; @@ -403,11 +403,11 @@ state_switch (ParseContext *ctx, ParseState newstate) ctx->unknown_depth = 1; } -static GIrNode * +static GIIrNode * pop_node (ParseContext *ctx) { GSList *top; - GIrNode *node; + GIIrNode *node; g_assert (ctx->node_stack != 0); top = ctx->node_stack; @@ -420,16 +420,16 @@ pop_node (ParseContext *ctx) } static void -push_node (ParseContext *ctx, GIrNode *node) +push_node (ParseContext *ctx, GIIrNode *node) { g_assert (node != NULL); g_debug ("pushing node %d %s", node->type, node->name); ctx->node_stack = g_slist_prepend (ctx->node_stack, node); } -static GIrNodeType * parse_type_internal (GIrModule *module, - const gchar *str, gchar **next, gboolean in_glib, - gboolean in_gobject); +static GIIrNodeType * parse_type_internal (GIIrModule *module, + const gchar *str, gchar **next, gboolean in_glib, + gboolean in_gobject); typedef struct { const gchar *str; @@ -530,18 +530,18 @@ parse_basic (const char *str) return NULL; } -static GIrNodeType * -parse_type_internal (GIrModule *module, - const gchar *str, - char **next, - gboolean in_glib, - gboolean in_gobject) +static GIIrNodeType * +parse_type_internal (GIIrModule *module, + const gchar *str, + char **next, + gboolean in_glib, + gboolean in_gobject) { const BasicTypeInfo *basic; - GIrNodeType *type; + GIIrNodeType *type; char *temporary_type = NULL; - type = (GIrNodeType *)_g_ir_node_new (G_IR_NODE_TYPE, module); + type = (GIIrNodeType *)_gi_ir_node_new (GI_IR_NODE_TYPE, module); type->unparsed = g_strdup (str); @@ -670,7 +670,7 @@ parse_type_internal (GIrModule *module, return type; /* error: */ - _g_ir_node_free ((GIrNode *)type); + _gi_ir_node_free ((GIIrNode *)type); g_free (temporary_type); return NULL; } @@ -743,10 +743,10 @@ is_pointer_or_disguised_structure (ParseContext *ctx, g_free (prefixed); } -static GIrNodeType * +static GIIrNodeType * parse_type (ParseContext *ctx, const gchar *type) { - GIrNodeType *node; + GIIrNodeType *node; const BasicTypeInfo *basic; gboolean in_glib, in_gobject; @@ -805,7 +805,7 @@ start_glib_boxed (GMarkupParseContext *context, const gchar *typename; const gchar *typeinit; const gchar *deprecated; - GIrNodeBoxed *boxed; + GIIrNodeBoxed *boxed; if (!(strcmp (element_name, "glib:boxed") == 0 && ctx->state == STATE_NAMESPACE)) @@ -835,10 +835,10 @@ start_glib_boxed (GMarkupParseContext *context, return FALSE; } - boxed = (GIrNodeBoxed *) _g_ir_node_new (G_IR_NODE_BOXED, - ctx->current_module); + boxed = (GIIrNodeBoxed *) _gi_ir_node_new (GI_IR_NODE_BOXED, + ctx->current_module); - ((GIrNode *)boxed)->name = g_strdup (name); + ((GIIrNode *)boxed)->name = g_strdup (name); boxed->gtype_name = g_strdup (typename); boxed->gtype_init = g_strdup (typeinit); if (deprecated) @@ -846,7 +846,7 @@ start_glib_boxed (GMarkupParseContext *context, else boxed->deprecated = FALSE; - push_node (ctx, (GIrNode *)boxed); + push_node (ctx, (GIIrNode *)boxed); ctx->current_module->entries = g_list_append (ctx->current_module->entries, boxed); @@ -868,7 +868,7 @@ start_function (GMarkupParseContext *context, const gchar *throws; const gchar *set_property; const gchar *get_property; - GIrNodeFunction *function; + GIIrNodeFunction *function; gboolean found = FALSE; ParseState in_embedded_state = STATE_NONE; @@ -933,10 +933,10 @@ start_function (GMarkupParseContext *context, if (shadows) name = shadows; - function = (GIrNodeFunction *) _g_ir_node_new (G_IR_NODE_FUNCTION, - ctx->current_module); + function = (GIIrNodeFunction *) _gi_ir_node_new (GI_IR_NODE_FUNCTION, + ctx->current_module); - ((GIrNode *)function)->name = g_strdup (name); + ((GIIrNode *)function)->name = g_strdup (name); function->symbol = g_strdup (symbol); function->parameters = NULL; if (deprecated) @@ -980,7 +980,7 @@ start_function (GMarkupParseContext *context, function->is_getter = FALSE; function->is_constructor = FALSE; if (strcmp (element_name, "callback") == 0) - ((GIrNode *)function)->type = G_IR_NODE_CALLBACK; + ((GIIrNode *)function)->type = GI_IR_NODE_CALLBACK; } if (throws && strcmp (throws, "1") == 0) @@ -995,52 +995,52 @@ start_function (GMarkupParseContext *context, } else if (ctx->current_typed) { - GIrNodeField *field; + GIIrNodeField *field; - field = (GIrNodeField *)ctx->current_typed; + field = (GIIrNodeField *)ctx->current_typed; field->callback = function; } else switch (CURRENT_NODE (ctx)->type) { - case G_IR_NODE_INTERFACE: - case G_IR_NODE_OBJECT: + case GI_IR_NODE_INTERFACE: + case GI_IR_NODE_OBJECT: { - GIrNodeInterface *iface; + GIIrNodeInterface *iface; - iface = (GIrNodeInterface *)CURRENT_NODE (ctx); + iface = (GIIrNodeInterface *)CURRENT_NODE (ctx); iface->members = g_list_append (iface->members, function); } break; - case G_IR_NODE_BOXED: + case GI_IR_NODE_BOXED: { - GIrNodeBoxed *boxed; + GIIrNodeBoxed *boxed; - boxed = (GIrNodeBoxed *)CURRENT_NODE (ctx); + boxed = (GIIrNodeBoxed *)CURRENT_NODE (ctx); boxed->members = g_list_append (boxed->members, function); } break; - case G_IR_NODE_STRUCT: + case GI_IR_NODE_STRUCT: { - GIrNodeStruct *struct_; + GIIrNodeStruct *struct_; - struct_ = (GIrNodeStruct *)CURRENT_NODE (ctx); + struct_ = (GIIrNodeStruct *)CURRENT_NODE (ctx); struct_->members = g_list_append (struct_->members, function); } break; - case G_IR_NODE_UNION: + case GI_IR_NODE_UNION: { - GIrNodeUnion *union_; + GIIrNodeUnion *union_; - union_ = (GIrNodeUnion *)CURRENT_NODE (ctx); + union_ = (GIIrNodeUnion *)CURRENT_NODE (ctx); union_->members = g_list_append (union_->members, function); } break; - case G_IR_NODE_ENUM: - case G_IR_NODE_FLAGS: + case GI_IR_NODE_ENUM: + case GI_IR_NODE_FLAGS: { - GIrNodeEnum *enum_; + GIIrNodeEnum *enum_; - enum_ = (GIrNodeEnum *)CURRENT_NODE (ctx); + enum_ = (GIIrNodeEnum *)CURRENT_NODE (ctx); enum_->methods = g_list_append (enum_->methods, function); } break; @@ -1048,20 +1048,20 @@ start_function (GMarkupParseContext *context, g_assert_not_reached (); } - push_node(ctx, (GIrNode *)function); + push_node(ctx, (GIIrNode *)function); return TRUE; } static void -parse_property_transfer (GIrNodeProperty *property, - const gchar *transfer, - ParseContext *ctx) +parse_property_transfer (GIIrNodeProperty *property, + const gchar *transfer, + ParseContext *ctx) { if (transfer == NULL) { #if 0 - GIrNodeInterface *iface = (GIrNodeInterface *)CURRENT_NODE (ctx); + GIIrNodeInterface *iface = (GIIrNodeInterface *)CURRENT_NODE (ctx); g_debug ("required attribute 'transfer-ownership' is missing from " "property '%s' in type '%s.%s'. Assuming 'none'\n", @@ -1086,7 +1086,7 @@ parse_property_transfer (GIrNodeProperty *property, } else { - GIrNodeInterface *iface = (GIrNodeInterface *)CURRENT_NODE (ctx); + GIIrNodeInterface *iface = (GIIrNodeInterface *)CURRENT_NODE (ctx); g_warning ("Unknown transfer-ownership value: '%s' for property '%s' in " "type '%s.%s'", transfer, property->node.name, ctx->namespace, @@ -1095,7 +1095,7 @@ parse_property_transfer (GIrNodeProperty *property, } static gboolean -parse_param_transfer (GIrNodeParam *param, const gchar *transfer, const gchar *name, +parse_param_transfer (GIIrNodeParam *param, const gchar *transfer, const gchar *name, GError **error) { if (transfer == NULL) @@ -1163,28 +1163,28 @@ start_instance_parameter (GMarkupParseContext *context, switch (CURRENT_NODE (ctx)->type) { - case G_IR_NODE_FUNCTION: - case G_IR_NODE_CALLBACK: + case GI_IR_NODE_FUNCTION: + case GI_IR_NODE_CALLBACK: { - GIrNodeFunction *func; + GIIrNodeFunction *func; - func = (GIrNodeFunction *)CURRENT_NODE (ctx); + func = (GIIrNodeFunction *)CURRENT_NODE (ctx); func->instance_transfer_full = transfer_full; } break; - case G_IR_NODE_SIGNAL: + case GI_IR_NODE_SIGNAL: { - GIrNodeSignal *signal; + GIIrNodeSignal *signal; - signal = (GIrNodeSignal *)CURRENT_NODE (ctx); + signal = (GIIrNodeSignal *)CURRENT_NODE (ctx); signal->instance_transfer_full = transfer_full; } break; - case G_IR_NODE_VFUNC: + case GI_IR_NODE_VFUNC: { - GIrNodeVFunc *vfunc; + GIIrNodeVFunc *vfunc; - vfunc = (GIrNodeVFunc *)CURRENT_NODE (ctx); + vfunc = (GIIrNodeVFunc *)CURRENT_NODE (ctx); vfunc->instance_transfer_full = transfer_full; } break; @@ -1215,7 +1215,7 @@ start_parameter (GMarkupParseContext *context, const gchar *destroy; const gchar *skip; const gchar *nullable; - GIrNodeParam *param; + GIIrNodeParam *param; if (!(strcmp (element_name, "parameter") == 0 && ctx->state == STATE_FUNCTION_PARAMETERS)) @@ -1237,10 +1237,10 @@ start_parameter (GMarkupParseContext *context, if (name == NULL) name = "unknown"; - param = (GIrNodeParam *)_g_ir_node_new (G_IR_NODE_PARAM, - ctx->current_module); + param = (GIIrNodeParam *)_gi_ir_node_new (GI_IR_NODE_PARAM, + ctx->current_module); - ctx->current_typed = (GIrNode*) param; + ctx->current_typed = (GIIrNode*) param; ctx->current_typed->name = g_strdup (name); state_switch (ctx, STATE_FUNCTION_PARAMETER); @@ -1312,32 +1312,32 @@ start_parameter (GMarkupParseContext *context, param->closure = closure ? atoi (closure) : -1; param->destroy = destroy ? atoi (destroy) : -1; - ((GIrNode *)param)->name = g_strdup (name); + ((GIIrNode *)param)->name = g_strdup (name); switch (CURRENT_NODE (ctx)->type) { - case G_IR_NODE_FUNCTION: - case G_IR_NODE_CALLBACK: + case GI_IR_NODE_FUNCTION: + case GI_IR_NODE_CALLBACK: { - GIrNodeFunction *func; + GIIrNodeFunction *func; - func = (GIrNodeFunction *)CURRENT_NODE (ctx); + func = (GIIrNodeFunction *)CURRENT_NODE (ctx); func->parameters = g_list_append (func->parameters, param); } break; - case G_IR_NODE_SIGNAL: + case GI_IR_NODE_SIGNAL: { - GIrNodeSignal *signal; + GIIrNodeSignal *signal; - signal = (GIrNodeSignal *)CURRENT_NODE (ctx); + signal = (GIIrNodeSignal *)CURRENT_NODE (ctx); signal->parameters = g_list_append (signal->parameters, param); } break; - case G_IR_NODE_VFUNC: + case GI_IR_NODE_VFUNC: { - GIrNodeVFunc *vfunc; + GIIrNodeVFunc *vfunc; - vfunc = (GIrNodeVFunc *)CURRENT_NODE (ctx); + vfunc = (GIIrNodeVFunc *)CURRENT_NODE (ctx); vfunc->parameters = g_list_append (vfunc->parameters, param); } break; @@ -1361,7 +1361,7 @@ start_field (GMarkupParseContext *context, const gchar *writable; const gchar *bits; const gchar *branch; - GIrNodeField *field; + GIIrNodeField *field; ParseState target_state; gboolean introspectable; @@ -1408,18 +1408,18 @@ start_field (GMarkupParseContext *context, return FALSE; } - field = (GIrNodeField *)_g_ir_node_new (G_IR_NODE_FIELD, - ctx->current_module); + field = (GIIrNodeField *)_gi_ir_node_new (GI_IR_NODE_FIELD, + ctx->current_module); if (introspectable) { - ctx->current_typed = (GIrNode*) field; + ctx->current_typed = (GIIrNode*) field; } else { field->type = parse_type (ctx, "gpointer"); } - ((GIrNode *)field)->name = g_strdup (name); + ((GIIrNode *)field)->name = g_strdup (name); /* Fields are assumed to be read-only. * (see also girwriter.py and generate.c) */ @@ -1433,51 +1433,51 @@ start_field (GMarkupParseContext *context, switch (CURRENT_NODE (ctx)->type) { - case G_IR_NODE_OBJECT: + case GI_IR_NODE_OBJECT: { - GIrNodeInterface *iface; + GIIrNodeInterface *iface; - iface = (GIrNodeInterface *)CURRENT_NODE (ctx); + iface = (GIIrNodeInterface *)CURRENT_NODE (ctx); iface->members = g_list_append (iface->members, field); } break; - case G_IR_NODE_INTERFACE: + case GI_IR_NODE_INTERFACE: { - GIrNodeInterface *iface; + GIIrNodeInterface *iface; - iface = (GIrNodeInterface *)CURRENT_NODE (ctx); + iface = (GIIrNodeInterface *)CURRENT_NODE (ctx); iface->members = g_list_append (iface->members, field); } break; - case G_IR_NODE_BOXED: + case GI_IR_NODE_BOXED: { - GIrNodeBoxed *boxed; + GIIrNodeBoxed *boxed; - boxed = (GIrNodeBoxed *)CURRENT_NODE (ctx); + boxed = (GIIrNodeBoxed *)CURRENT_NODE (ctx); boxed->members = g_list_append (boxed->members, field); } break; - case G_IR_NODE_STRUCT: + case GI_IR_NODE_STRUCT: { - GIrNodeStruct *struct_; + GIIrNodeStruct *struct_; - struct_ = (GIrNodeStruct *)CURRENT_NODE (ctx); + struct_ = (GIIrNodeStruct *)CURRENT_NODE (ctx); struct_->members = g_list_append (struct_->members, field); } break; - case G_IR_NODE_UNION: + case GI_IR_NODE_UNION: { - GIrNodeUnion *union_; + GIIrNodeUnion *union_; - union_ = (GIrNodeUnion *)CURRENT_NODE (ctx); + union_ = (GIIrNodeUnion *)CURRENT_NODE (ctx); union_->members = g_list_append (union_->members, field); if (branch) { - GIrNodeConstant *constant; + GIIrNodeConstant *constant; - constant = (GIrNodeConstant *) _g_ir_node_new (G_IR_NODE_CONSTANT, - ctx->current_module); - ((GIrNode *)constant)->name = g_strdup (name); + constant = (GIIrNodeConstant *) _gi_ir_node_new (GI_IR_NODE_CONSTANT, + ctx->current_module); + ((GIIrNode *)constant)->name = g_strdup (name); constant->value = g_strdup (branch); constant->type = union_->discriminator_type; constant->deprecated = FALSE; @@ -1529,7 +1529,7 @@ start_enum (GMarkupParseContext *context, const gchar *typeinit; const gchar *deprecated; const gchar *error_domain; - GIrNodeEnum *enum_; + GIIrNodeEnum *enum_; if (!((strcmp (element_name, "enumeration") == 0 && ctx->state == STATE_NAMESPACE) || (strcmp (element_name, "bitfield") == 0 && ctx->state == STATE_NAMESPACE))) @@ -1551,12 +1551,12 @@ start_enum (GMarkupParseContext *context, } if (strcmp (element_name, "enumeration") == 0) - enum_ = (GIrNodeEnum *) _g_ir_node_new (G_IR_NODE_ENUM, - ctx->current_module); + enum_ = (GIIrNodeEnum *) _gi_ir_node_new (GI_IR_NODE_ENUM, + ctx->current_module); else - enum_ = (GIrNodeEnum *) _g_ir_node_new (G_IR_NODE_FLAGS, - ctx->current_module); - ((GIrNode *)enum_)->name = g_strdup (name); + enum_ = (GIIrNodeEnum *) _gi_ir_node_new (GI_IR_NODE_FLAGS, + ctx->current_module); + ((GIIrNode *)enum_)->name = g_strdup (name); enum_->gtype_name = g_strdup (typename); enum_->gtype_init = g_strdup (typeinit); enum_->error_domain = g_strdup (error_domain); @@ -1566,7 +1566,7 @@ start_enum (GMarkupParseContext *context, else enum_->deprecated = FALSE; - push_node (ctx, (GIrNode *) enum_); + push_node (ctx, (GIIrNode *) enum_); ctx->current_module->entries = g_list_append (ctx->current_module->entries, enum_); @@ -1590,8 +1590,8 @@ start_property (GMarkupParseContext *context, const gchar *transfer; const gchar *setter; const gchar *getter; - GIrNodeProperty *property; - GIrNodeInterface *iface; + GIIrNodeProperty *property; + GIIrNodeInterface *iface; if (!(strcmp (element_name, "property") == 0 && (ctx->state == STATE_CLASS || @@ -1624,11 +1624,11 @@ start_property (GMarkupParseContext *context, return FALSE; } - property = (GIrNodeProperty *) _g_ir_node_new (G_IR_NODE_PROPERTY, - ctx->current_module); - ctx->current_typed = (GIrNode*) property; + property = (GIIrNodeProperty *) _gi_ir_node_new (GI_IR_NODE_PROPERTY, + ctx->current_module); + ctx->current_typed = (GIIrNode*) property; - ((GIrNode *)property)->name = g_strdup (name); + ((GIIrNode *)property)->name = g_strdup (name); /* Assume properties are readable */ if (readable == NULL || strcmp (readable, "1") == 0) @@ -1653,7 +1653,7 @@ start_property (GMarkupParseContext *context, parse_property_transfer (property, transfer, ctx); - iface = (GIrNodeInterface *)CURRENT_NODE (ctx); + iface = (GIIrNodeInterface *)CURRENT_NODE (ctx); iface->members = g_list_append (iface->members, property); return TRUE; @@ -1694,8 +1694,8 @@ start_member (GMarkupParseContext *context, const gchar *value; const gchar *deprecated; const gchar *c_identifier; - GIrNodeEnum *enum_; - GIrNodeValue *value_; + GIIrNodeEnum *enum_; + GIIrNodeValue *value_; if (!(strcmp (element_name, "member") == 0 && ctx->state == STATE_ENUM)) @@ -1712,10 +1712,10 @@ start_member (GMarkupParseContext *context, return FALSE; } - value_ = (GIrNodeValue *) _g_ir_node_new (G_IR_NODE_VALUE, - ctx->current_module); + value_ = (GIIrNodeValue *) _gi_ir_node_new (GI_IR_NODE_VALUE, + ctx->current_module); - ((GIrNode *)value_)->name = g_strdup (name); + ((GIIrNode *)value_)->name = g_strdup (name); value_->value = parse_value (value); @@ -1724,11 +1724,11 @@ start_member (GMarkupParseContext *context, else value_->deprecated = FALSE; - g_hash_table_insert (((GIrNode *)value_)->attributes, + g_hash_table_insert (((GIIrNode *)value_)->attributes, g_strdup ("c:identifier"), g_strdup (c_identifier)); - enum_ = (GIrNodeEnum *)CURRENT_NODE (ctx); + enum_ = (GIIrNodeEnum *)CURRENT_NODE (ctx); enum_->values = g_list_append (enum_->values, value_); return TRUE; @@ -1747,7 +1747,7 @@ start_constant (GMarkupParseContext *context, const gchar *name; const gchar *value; const gchar *deprecated; - GIrNodeConstant *constant; + GIIrNodeConstant *constant; if (!(strcmp (element_name, "constant") == 0 && (ctx->state == STATE_NAMESPACE || @@ -1790,13 +1790,13 @@ start_constant (GMarkupParseContext *context, return FALSE; } - constant = (GIrNodeConstant *) _g_ir_node_new (G_IR_NODE_CONSTANT, - ctx->current_module); + constant = (GIIrNodeConstant *) _gi_ir_node_new (GI_IR_NODE_CONSTANT, + ctx->current_module); - ((GIrNode *)constant)->name = g_strdup (name); + ((GIIrNode *)constant)->name = g_strdup (name); constant->value = g_strdup (value); - ctx->current_typed = (GIrNode*) constant; + ctx->current_typed = (GIIrNode*) constant; if (deprecated) constant->deprecated = TRUE; @@ -1805,15 +1805,15 @@ start_constant (GMarkupParseContext *context, if (prev_state == STATE_NAMESPACE) { - push_node (ctx, (GIrNode *) constant); + push_node (ctx, (GIIrNode *) constant); ctx->current_module->entries = g_list_append (ctx->current_module->entries, constant); } else { - GIrNodeInterface *iface; + GIIrNodeInterface *iface; - iface = (GIrNodeInterface *)CURRENT_NODE (ctx); + iface = (GIIrNodeInterface *)CURRENT_NODE (ctx); iface->members = g_list_append (iface->members, constant); } @@ -1833,7 +1833,7 @@ start_interface (GMarkupParseContext *context, const gchar *typeinit; const gchar *deprecated; const gchar *glib_type_struct; - GIrNodeInterface *iface; + GIIrNodeInterface *iface; if (!(strcmp (element_name, "interface") == 0 && ctx->state == STATE_NAMESPACE)) @@ -1864,9 +1864,9 @@ start_interface (GMarkupParseContext *context, return FALSE; } - iface = (GIrNodeInterface *) _g_ir_node_new (G_IR_NODE_INTERFACE, - ctx->current_module); - ((GIrNode *)iface)->name = g_strdup (name); + iface = (GIIrNodeInterface *) _gi_ir_node_new (GI_IR_NODE_INTERFACE, + ctx->current_module); + ((GIIrNode *)iface)->name = g_strdup (name); iface->gtype_name = g_strdup (typename); iface->gtype_init = g_strdup (typeinit); iface->glib_type_struct = g_strdup (glib_type_struct); @@ -1875,7 +1875,7 @@ start_interface (GMarkupParseContext *context, else iface->deprecated = FALSE; - push_node (ctx, (GIrNode *) iface); + push_node (ctx, (GIIrNode *) iface); ctx->current_module->entries = g_list_append (ctx->current_module->entries, iface); @@ -1903,7 +1903,7 @@ start_class (GMarkupParseContext *context, const gchar *unref_func; const gchar *set_value_func; const gchar *get_value_func; - GIrNodeInterface *iface; + GIIrNodeInterface *iface; if (!(strcmp (element_name, "class") == 0 && ctx->state == STATE_NAMESPACE)) @@ -1942,9 +1942,9 @@ start_class (GMarkupParseContext *context, return FALSE; } - iface = (GIrNodeInterface *) _g_ir_node_new (G_IR_NODE_OBJECT, - ctx->current_module); - ((GIrNode *)iface)->name = g_strdup (name); + iface = (GIIrNodeInterface *) _gi_ir_node_new (GI_IR_NODE_OBJECT, + ctx->current_module); + ((GIIrNode *)iface)->name = g_strdup (name); iface->gtype_name = g_strdup (typename); iface->gtype_init = g_strdup (typeinit); iface->parent = g_strdup (parent); @@ -1968,7 +1968,7 @@ start_class (GMarkupParseContext *context, if (get_value_func) iface->get_value_func = g_strdup (get_value_func); - push_node (ctx, (GIrNode *) iface); + push_node (ctx, (GIIrNode *) iface); ctx->current_module->entries = g_list_append (ctx->current_module->entries, iface); @@ -1988,7 +1988,7 @@ start_type (GMarkupParseContext *context, gboolean in_alias = FALSE; gboolean is_array; gboolean is_varargs; - GIrNodeType *typenode; + GIIrNodeType *typenode; is_array = strcmp (element_name, "array") == 0; is_varargs = strcmp (element_name, "varargs") == 0; @@ -2080,8 +2080,8 @@ start_type (GMarkupParseContext *context, const char *len; const char *size; - typenode = (GIrNodeType *)_g_ir_node_new (G_IR_NODE_TYPE, - ctx->current_module); + typenode = (GIIrNodeType *)_gi_ir_node_new (GI_IR_NODE_TYPE, + ctx->current_module); typenode->tag = GI_TYPE_TAG_ARRAY; typenode->is_pointer = TRUE; @@ -2114,7 +2114,7 @@ start_type (GMarkupParseContext *context, /* If neither zero-terminated nor length nor fixed-size is given, assume zero-terminated. */ typenode->zero_terminated = !(typenode->has_length || typenode->has_size); - if (typenode->has_size && ctx->current_typed->type == G_IR_NODE_FIELD) + if (typenode->has_size && ctx->current_typed->type == GI_IR_NODE_FIELD) typenode->is_pointer = FALSE; } else { typenode->zero_terminated = FALSE; @@ -2147,8 +2147,8 @@ start_type (GMarkupParseContext *context, pointer_depth++; } - if (ctx->current_typed->type == G_IR_NODE_PARAM && - ((GIrNodeParam *)ctx->current_typed)->out && + if (ctx->current_typed->type == GI_IR_NODE_PARAM && + ((GIIrNodeParam *)ctx->current_typed)->out && pointer_depth > 0) pointer_depth--; @@ -2183,12 +2183,12 @@ start_type (GMarkupParseContext *context, static void end_type_top (ParseContext *ctx) { - GIrNodeType *typenode; + GIIrNodeType *typenode; if (!ctx->type_parameters) goto out; - typenode = (GIrNodeType*)ctx->type_parameters->data; + typenode = (GIIrNodeType*)ctx->type_parameters->data; /* Default to pointer for unspecified containers */ if (typenode->tag == GI_TYPE_TAG_ARRAY || @@ -2209,27 +2209,27 @@ end_type_top (ParseContext *ctx) switch (ctx->current_typed->type) { - case G_IR_NODE_PARAM: + case GI_IR_NODE_PARAM: { - GIrNodeParam *param = (GIrNodeParam *)ctx->current_typed; + GIIrNodeParam *param = (GIIrNodeParam *)ctx->current_typed; param->type = typenode; } break; - case G_IR_NODE_FIELD: + case GI_IR_NODE_FIELD: { - GIrNodeField *field = (GIrNodeField *)ctx->current_typed; + GIIrNodeField *field = (GIIrNodeField *)ctx->current_typed; field->type = typenode; } break; - case G_IR_NODE_PROPERTY: + case GI_IR_NODE_PROPERTY: { - GIrNodeProperty *property = (GIrNodeProperty *) ctx->current_typed; + GIIrNodeProperty *property = (GIIrNodeProperty *) ctx->current_typed; property->type = typenode; } break; - case G_IR_NODE_CONSTANT: + case GI_IR_NODE_CONSTANT: { - GIrNodeConstant *constant = (GIrNodeConstant *)ctx->current_typed; + GIIrNodeConstant *constant = (GIIrNodeConstant *)ctx->current_typed; constant->type = typenode; } break; @@ -2248,12 +2248,12 @@ end_type_top (ParseContext *ctx) static void end_type_recurse (ParseContext *ctx) { - GIrNodeType *parent; - GIrNodeType *param = NULL; + GIIrNodeType *parent; + GIIrNodeType *param = NULL; - parent = (GIrNodeType *) ((GList*)ctx->type_stack->data)->data; + parent = (GIIrNodeType *) ((GList*)ctx->type_stack->data)->data; if (ctx->type_parameters) - param = (GIrNodeType *) ctx->type_parameters->data; + param = (GIIrNodeType *) ctx->type_parameters->data; if (parent->tag == GI_TYPE_TAG_ARRAY || parent->tag == GI_TYPE_TAG_GLIST || @@ -2307,7 +2307,7 @@ start_attribute (GMarkupParseContext *context, { const gchar *name; const gchar *value; - GIrNode *curnode; + GIIrNode *curnode; if (strcmp (element_name, "attribute") != 0 || ctx->node_stack == NULL) return FALSE; @@ -2330,7 +2330,7 @@ start_attribute (GMarkupParseContext *context, curnode = CURRENT_NODE (ctx); - if (ctx->current_typed && ctx->current_typed->type == G_IR_NODE_PARAM) + if (ctx->current_typed && ctx->current_typed->type == GI_IR_NODE_PARAM) { g_hash_table_insert (ctx->current_typed->attributes, g_strdup (name), g_strdup (value)); } @@ -2350,7 +2350,7 @@ start_return_value (GMarkupParseContext *context, ParseContext *ctx, GError **error) { - GIrNodeParam *param; + GIIrNodeParam *param; const gchar *transfer; const gchar *skip; const gchar *nullable; @@ -2359,13 +2359,13 @@ start_return_value (GMarkupParseContext *context, ctx->state == STATE_FUNCTION)) return FALSE; - param = (GIrNodeParam *)_g_ir_node_new (G_IR_NODE_PARAM, - ctx->current_module); + param = (GIIrNodeParam *)_gi_ir_node_new (GI_IR_NODE_PARAM, + ctx->current_module); param->in = FALSE; param->out = FALSE; param->retval = TRUE; - ctx->current_typed = (GIrNode*) param; + ctx->current_typed = (GIIrNode*) param; state_switch (ctx, STATE_FUNCTION_RETURN); @@ -2385,22 +2385,22 @@ start_return_value (GMarkupParseContext *context, switch (CURRENT_NODE (ctx)->type) { - case G_IR_NODE_FUNCTION: - case G_IR_NODE_CALLBACK: + case GI_IR_NODE_FUNCTION: + case GI_IR_NODE_CALLBACK: { - GIrNodeFunction *func = (GIrNodeFunction *)CURRENT_NODE (ctx); + GIIrNodeFunction *func = (GIIrNodeFunction *)CURRENT_NODE (ctx); func->result = param; } break; - case G_IR_NODE_SIGNAL: + case GI_IR_NODE_SIGNAL: { - GIrNodeSignal *signal = (GIrNodeSignal *)CURRENT_NODE (ctx); + GIIrNodeSignal *signal = (GIIrNodeSignal *)CURRENT_NODE (ctx); signal->result = param; } break; - case G_IR_NODE_VFUNC: + case GI_IR_NODE_VFUNC: { - GIrNodeVFunc *vfunc = (GIrNodeVFunc *)CURRENT_NODE (ctx); + GIIrNodeVFunc *vfunc = (GIIrNodeVFunc *)CURRENT_NODE (ctx); vfunc->result = param; } break; @@ -2419,7 +2419,7 @@ start_implements (GMarkupParseContext *context, ParseContext *ctx, GError **error) { - GIrNodeInterface *iface; + GIIrNodeInterface *iface; const char *name; if (strcmp (element_name, "implements") != 0 || @@ -2435,7 +2435,7 @@ start_implements (GMarkupParseContext *context, return FALSE; } - iface = (GIrNodeInterface *)CURRENT_NODE (ctx); + iface = (GIIrNodeInterface *)CURRENT_NODE (ctx); iface->interfaces = g_list_append (iface->interfaces, g_strdup (name)); return TRUE; @@ -2456,8 +2456,8 @@ start_glib_signal (GMarkupParseContext *context, const gchar *action; const gchar *no_hooks; const gchar *has_class_closure; - GIrNodeInterface *iface; - GIrNodeSignal *signal; + GIIrNodeInterface *iface; + GIIrNodeSignal *signal; if (!(strcmp (element_name, "glib:signal") == 0 && (ctx->state == STATE_CLASS || @@ -2480,10 +2480,10 @@ start_glib_signal (GMarkupParseContext *context, MISSING_ATTRIBUTE (context, error, element_name, "name"); return FALSE; } - signal = (GIrNodeSignal *)_g_ir_node_new (G_IR_NODE_SIGNAL, - ctx->current_module); + signal = (GIIrNodeSignal *)_gi_ir_node_new (GI_IR_NODE_SIGNAL, + ctx->current_module); - ((GIrNode *)signal)->name = g_strdup (name); + ((GIIrNode *)signal)->name = g_strdup (name); signal->run_first = FALSE; signal->run_last = FALSE; @@ -2516,10 +2516,10 @@ start_glib_signal (GMarkupParseContext *context, else signal->has_class_closure = FALSE; - iface = (GIrNodeInterface *)CURRENT_NODE (ctx); + iface = (GIIrNodeInterface *)CURRENT_NODE (ctx); iface->members = g_list_append (iface->members, signal); - push_node (ctx, (GIrNode *)signal); + push_node (ctx, (GIIrNode *)signal); return TRUE; } @@ -2539,8 +2539,8 @@ start_vfunc (GMarkupParseContext *context, const gchar *offset; const gchar *invoker; const gchar *throws; - GIrNodeInterface *iface; - GIrNodeVFunc *vfunc; + GIIrNodeInterface *iface; + GIIrNodeVFunc *vfunc; if (!(strcmp (element_name, "virtual-method") == 0 && (ctx->state == STATE_CLASS || @@ -2564,10 +2564,10 @@ start_vfunc (GMarkupParseContext *context, return FALSE; } - vfunc = (GIrNodeVFunc *)_g_ir_node_new (G_IR_NODE_VFUNC, - ctx->current_module); + vfunc = (GIIrNodeVFunc *)_gi_ir_node_new (GI_IR_NODE_VFUNC, + ctx->current_module); - ((GIrNode *)vfunc)->name = g_strdup (name); + ((GIIrNode *)vfunc)->name = g_strdup (name); if (must_chain_up && strcmp (must_chain_up, "1") == 0) vfunc->must_chain_up = TRUE; @@ -2607,10 +2607,10 @@ start_vfunc (GMarkupParseContext *context, vfunc->invoker = g_strdup (invoker); - iface = (GIrNodeInterface *)CURRENT_NODE (ctx); + iface = (GIIrNodeInterface *)CURRENT_NODE (ctx); iface->members = g_list_append (iface->members, vfunc); - push_node (ctx, (GIrNode *)vfunc); + push_node (ctx, (GIIrNode *)vfunc); return TRUE; } @@ -2634,7 +2634,7 @@ start_struct (GMarkupParseContext *context, const gchar *foreign; const gchar *copy_func; const gchar *free_func; - GIrNodeStruct *struct_; + GIIrNodeStruct *struct_; if (!(strcmp (element_name, "record") == 0 && (ctx->state == STATE_NAMESPACE || @@ -2674,10 +2674,10 @@ start_struct (GMarkupParseContext *context, return FALSE; } - struct_ = (GIrNodeStruct *) _g_ir_node_new (G_IR_NODE_STRUCT, - ctx->current_module); + struct_ = (GIIrNodeStruct *) _gi_ir_node_new (GI_IR_NODE_STRUCT, + ctx->current_module); - ((GIrNode *)struct_)->name = g_strdup (name ? name : ""); + ((GIIrNode *)struct_)->name = g_strdup (name ? name : ""); if (deprecated) struct_->deprecated = TRUE; else @@ -2705,7 +2705,7 @@ start_struct (GMarkupParseContext *context, if (ctx->node_stack == NULL) ctx->current_module->entries = g_list_append (ctx->current_module->entries, struct_); - push_node (ctx, (GIrNode *)struct_); + push_node (ctx, (GIIrNode *)struct_); return TRUE; } @@ -2723,7 +2723,7 @@ start_union (GMarkupParseContext *context, const gchar *typeinit; const gchar *copy_func; const gchar *free_func; - GIrNodeUnion *union_; + GIIrNodeUnion *union_; if (!(strcmp (element_name, "union") == 0 && (ctx->state == STATE_NAMESPACE || @@ -2748,10 +2748,10 @@ start_union (GMarkupParseContext *context, return FALSE; } - union_ = (GIrNodeUnion *) _g_ir_node_new (G_IR_NODE_UNION, - ctx->current_module); + union_ = (GIIrNodeUnion *) _gi_ir_node_new (GI_IR_NODE_UNION, + ctx->current_module); - ((GIrNode *)union_)->name = g_strdup (name ? name : ""); + ((GIIrNode *)union_)->name = g_strdup (name ? name : ""); union_->gtype_name = g_strdup (typename); union_->gtype_init = g_strdup (typeinit); union_->copy_func = g_strdup (copy_func); @@ -2764,7 +2764,7 @@ start_union (GMarkupParseContext *context, if (ctx->node_stack == NULL) ctx->current_module->entries = g_list_append (ctx->current_module->entries, union_); - push_node (ctx, (GIrNode *)union_); + push_node (ctx, (GIIrNode *)union_); return TRUE; } @@ -2795,9 +2795,9 @@ start_discriminator (GMarkupParseContext *context, return FALSE; } - ((GIrNodeUnion *)CURRENT_NODE (ctx))->discriminator_type + ((GIIrNodeUnion *)CURRENT_NODE (ctx))->discriminator_type = parse_type (ctx, type); - ((GIrNodeUnion *)CURRENT_NODE (ctx))->discriminator_offset + ((GIIrNodeUnion *)CURRENT_NODE (ctx))->discriminator_offset = atoi (offset); return TRUE; @@ -2813,12 +2813,12 @@ parse_include (GMarkupParseContext *context, gchar *buffer; gsize length; gchar *girpath, *girname; - GIrModule *module; + GIIrModule *module; GList *l; for (l = ctx->parser->parsed_modules; l; l = l->next) { - GIrModule *m = l->data; + GIIrModule *m = l->data; if (strcmp (m->name, name) == 0) { @@ -2859,7 +2859,7 @@ parse_include (GMarkupParseContext *context, return FALSE; } - module = _g_ir_parser_parse_string (ctx->parser, name, girpath, buffer, length, &error); + module = _gi_ir_parser_parse_string (ctx->parser, name, girpath, buffer, length, &error); g_free (buffer); if (error != NULL) { @@ -3106,7 +3106,7 @@ start_element_handler (GMarkupParseContext *context, " name element '%s' doesn't match file name '%s'", name, ctx->namespace); - ctx->current_module = _g_ir_module_new (name, version, shared_library, cprefix); + ctx->current_module = _gi_ir_module_new (name, version, shared_library, cprefix); ctx->current_module->aliases = ctx->aliases; ctx->aliases = NULL; @@ -3116,7 +3116,7 @@ start_element_handler (GMarkupParseContext *context, ctx->pointer_structures = NULL; for (l = ctx->include_modules; l; l = l->next) - _g_ir_module_add_include_module (ctx->current_module, l->data); + _gi_ir_module_add_include_module (ctx->current_module, l->data); g_list_free (ctx->include_modules); ctx->include_modules = NULL; @@ -3159,9 +3159,9 @@ start_element_handler (GMarkupParseContext *context, MISSING_ATTRIBUTE (context, error, element_name, "name"); else { - GIrNodeInterface *iface; + GIIrNodeInterface *iface; - iface = (GIrNodeInterface *)CURRENT_NODE(ctx); + iface = (GIIrNodeInterface *)CURRENT_NODE(ctx); iface->prerequisites = g_list_append (iface->prerequisites, g_strdup (name)); } goto out; @@ -3311,11 +3311,11 @@ state_switch_end_struct_or_union (GMarkupParseContext *context, } else { - if (CURRENT_NODE (ctx)->type == G_IR_NODE_STRUCT) + if (CURRENT_NODE (ctx)->type == GI_IR_NODE_STRUCT) state_switch (ctx, STATE_STRUCT); - else if (CURRENT_NODE (ctx)->type == G_IR_NODE_UNION) + else if (CURRENT_NODE (ctx)->type == GI_IR_NODE_UNION) state_switch (ctx, STATE_UNION); - else if (CURRENT_NODE (ctx)->type == G_IR_NODE_OBJECT) + else if (CURRENT_NODE (ctx)->type == GI_IR_NODE_OBJECT) state_switch (ctx, STATE_CLASS); else { @@ -3442,18 +3442,18 @@ end_element_handler (GMarkupParseContext *context, state_switch (ctx, ctx->in_embedded_state); ctx->in_embedded_state = STATE_NONE; } - else if (CURRENT_NODE (ctx)->type == G_IR_NODE_INTERFACE) + else if (CURRENT_NODE (ctx)->type == GI_IR_NODE_INTERFACE) state_switch (ctx, STATE_INTERFACE); - else if (CURRENT_NODE (ctx)->type == G_IR_NODE_OBJECT) + else if (CURRENT_NODE (ctx)->type == GI_IR_NODE_OBJECT) state_switch (ctx, STATE_CLASS); - else if (CURRENT_NODE (ctx)->type == G_IR_NODE_BOXED) + else if (CURRENT_NODE (ctx)->type == GI_IR_NODE_BOXED) state_switch (ctx, STATE_BOXED); - else if (CURRENT_NODE (ctx)->type == G_IR_NODE_STRUCT) + else if (CURRENT_NODE (ctx)->type == GI_IR_NODE_STRUCT) state_switch (ctx, STATE_STRUCT); - else if (CURRENT_NODE (ctx)->type == G_IR_NODE_UNION) + else if (CURRENT_NODE (ctx)->type == GI_IR_NODE_UNION) state_switch (ctx, STATE_UNION); - else if (CURRENT_NODE (ctx)->type == G_IR_NODE_ENUM || - CURRENT_NODE (ctx)->type == G_IR_NODE_FLAGS) + else if (CURRENT_NODE (ctx)->type == GI_IR_NODE_ENUM || + CURRENT_NODE (ctx)->type == GI_IR_NODE_FLAGS) state_switch (ctx, STATE_ENUM); else { @@ -3663,7 +3663,7 @@ cleanup (GMarkupParseContext *context, GList *m; for (m = ctx->modules; m; m = m->next) - _g_ir_module_free (m->data); + _gi_ir_module_free (m->data); g_list_free (ctx->modules); ctx->modules = NULL; @@ -3671,8 +3671,8 @@ cleanup (GMarkupParseContext *context, } /** - * _g_ir_parser_parse_string: - * @parser: a #GIrParser + * _gi_ir_parser_parse_string: + * @parser: a #GIIrParser * @namespace: the namespace of the string * @filename: (allow-none): Path to parsed file, or %NULL * @buffer: the data containing the XML @@ -3684,13 +3684,13 @@ cleanup (GMarkupParseContext *context, * * Returns: (transfer none): a new #GirModule */ -GIrModule * -_g_ir_parser_parse_string (GIrParser *parser, - const gchar *namespace, - const gchar *filename, - const gchar *buffer, - gssize length, - GError **error) +GIIrModule * +_gi_ir_parser_parse_string (GIIrParser *parser, + const gchar *namespace, + const gchar *filename, + const gchar *buffer, + gssize length, + GError **error) { ParseContext ctx = { 0 }; GMarkupParseContext *context; @@ -3755,25 +3755,25 @@ _g_ir_parser_parse_string (GIrParser *parser, } /** - * _g_ir_parser_parse_file: - * @parser: a #GIrParser + * _gi_ir_parser_parse_file: + * @parser: a #GIIrParser * @filename: filename to parse * @error: return location for a #GError, or %NULL * * Parse GIR XML file, and return a list of a a #GirModule for each * <namespace/> element within the file. * - * Returns: (transfer container): a newly allocated list of #GIrModule. The modules themselves - * are owned by the #GIrParser and will be freed along with the parser. + * Returns: (transfer container): a newly allocated list of #GIIrModule. The modules themselves + * are owned by the #GIIrParser and will be freed along with the parser. */ -GIrModule * -_g_ir_parser_parse_file (GIrParser *parser, - const gchar *filename, - GError **error) +GIIrModule * +_gi_ir_parser_parse_file (GIIrParser *parser, + const gchar *filename, + GError **error) { gchar *buffer; gsize length; - GIrModule *module; + GIIrModule *module; char *dash; char *namespace; @@ -3803,7 +3803,7 @@ _g_ir_parser_parse_file (GIrParser *parser, return NULL; } - module = _g_ir_parser_parse_string (parser, namespace, filename, buffer, length, error); + module = _gi_ir_parser_parse_string (parser, namespace, filename, buffer, length, error); g_free (namespace); diff --git a/girepository/girwriter-private.h b/girepository/girwriter-private.h index ec1fafdc7..3d060ef3b 100644 --- a/girepository/girwriter-private.h +++ b/girepository/girwriter-private.h @@ -27,9 +27,9 @@ G_BEGIN_DECLS -void g_ir_writer_write (const char *filename, - const char *ns, - gboolean needs_prefix, - gboolean show_all); +void gi_ir_writer_write (const char *filename, + const char *ns, + gboolean needs_prefix, + gboolean show_all); G_END_DECLS diff --git a/girepository/girwriter.c b/girepository/girwriter.c index 85dcc25a0..453e9eb3d 100644 --- a/girepository/girwriter.c +++ b/girepository/girwriter.c @@ -165,11 +165,11 @@ xml_free (Xml *xml) static void check_unresolved (GIBaseInfo *info) { - if (g_base_info_get_type (info) != GI_INFO_TYPE_UNRESOLVED) + if (gi_base_info_get_type (info) != GI_INFO_TYPE_UNRESOLVED) return; g_critical ("Found unresolved type '%s' '%s'\n", - g_base_info_get_name (info), g_base_info_get_namespace (info)); + gi_base_info_get_name (info), gi_base_info_get_namespace (info)); } static void @@ -177,10 +177,10 @@ write_type_name (const gchar *ns, GIBaseInfo *info, Xml *file) { - if (strcmp (ns, g_base_info_get_namespace (info)) != 0) - xml_printf (file, "%s.", g_base_info_get_namespace (info)); + if (strcmp (ns, gi_base_info_get_namespace (info)) != 0) + xml_printf (file, "%s.", gi_base_info_get_namespace (info)); - xml_printf (file, "%s", g_base_info_get_name (info)); + xml_printf (file, "%s", gi_base_info_get_name (info)); } static void @@ -225,8 +225,8 @@ write_type_info (const gchar *ns, check_unresolved ((GIBaseInfo*)info); - tag = g_type_info_get_tag (info); - is_pointer = g_type_info_is_pointer (info); + tag = gi_type_info_get_tag (info); + is_pointer = gi_type_info_is_pointer (info); if (tag == GI_TYPE_TAG_VOID) { @@ -239,7 +239,7 @@ write_type_info (const gchar *ns, else if (GI_TYPE_TAG_IS_BASIC (tag)) { xml_start_element (file, "type"); - xml_printf (file, " name=\"%s\"", g_type_tag_to_string (tag)); + xml_printf (file, " name=\"%s\"", gi_type_tag_to_string (tag)); xml_end_element (file, "type"); } else if (tag == GI_TYPE_TAG_ARRAY) @@ -249,7 +249,7 @@ write_type_info (const gchar *ns, xml_start_element (file, "array"); - switch (g_type_info_get_array_type (info)) { + switch (gi_type_info_get_array_type (info)) { case GI_ARRAY_TYPE_C: break; case GI_ARRAY_TYPE_ARRAY: @@ -268,42 +268,42 @@ write_type_info (const gchar *ns, if (name) xml_printf (file, " name=\"%s\"", name); - type = g_type_info_get_param_type (info, 0); + type = gi_type_info_get_param_type (info, 0); - length = g_type_info_get_array_length (info); + length = gi_type_info_get_array_length (info); if (length >= 0) xml_printf (file, " length=\"%d\"", length); - size = g_type_info_get_array_fixed_size (info); + size = gi_type_info_get_array_fixed_size (info); if (size >= 0) xml_printf (file, " fixed-size=\"%d\"", size); - if (g_type_info_is_zero_terminated (info)) + if (gi_type_info_is_zero_terminated (info)) xml_printf (file, " zero-terminated=\"1\""); write_type_info (ns, type, file); - g_base_info_unref ((GIBaseInfo *)type); + gi_base_info_unref ((GIBaseInfo *)type); xml_end_element (file, "array"); } else if (tag == GI_TYPE_TAG_INTERFACE) { - GIBaseInfo *iface = g_type_info_get_interface (info); + GIBaseInfo *iface = gi_type_info_get_interface (info); xml_start_element (file, "type"); write_type_name_attribute (ns, iface, "name", file); xml_end_element (file, "type"); - g_base_info_unref (iface); + gi_base_info_unref (iface); } else if (tag == GI_TYPE_TAG_GLIST) { xml_start_element (file, "type"); xml_printf (file, " name=\"GLib.List\""); - type = g_type_info_get_param_type (info, 0); + type = gi_type_info_get_param_type (info, 0); if (type) { write_type_info (ns, type, file); - g_base_info_unref ((GIBaseInfo *)type); + gi_base_info_unref ((GIBaseInfo *)type); } xml_end_element (file, "type"); } @@ -311,11 +311,11 @@ write_type_info (const gchar *ns, { xml_start_element (file, "type"); xml_printf (file, " name=\"GLib.SList\""); - type = g_type_info_get_param_type (info, 0); + type = gi_type_info_get_param_type (info, 0); if (type) { write_type_info (ns, type, file); - g_base_info_unref ((GIBaseInfo *)type); + gi_base_info_unref ((GIBaseInfo *)type); } xml_end_element (file, "type"); } @@ -323,14 +323,14 @@ write_type_info (const gchar *ns, { xml_start_element (file, "type"); xml_printf (file, " name=\"GLib.HashTable\""); - type = g_type_info_get_param_type (info, 0); + type = gi_type_info_get_param_type (info, 0); if (type) { write_type_info (ns, type, file); - g_base_info_unref ((GIBaseInfo *)type); - type = g_type_info_get_param_type (info, 1); + gi_base_info_unref ((GIBaseInfo *)type); + type = gi_type_info_get_param_type (info, 1); write_type_info (ns, type, file); - g_base_info_unref ((GIBaseInfo *)type); + gi_base_info_unref ((GIBaseInfo *)type); } xml_end_element (file, "type"); } @@ -354,7 +354,7 @@ write_attributes (Xml *file, GIAttributeIter iter = { 0, }; char *name, *value; - while (g_base_info_iterate_attributes (info, &iter, &name, &value)) + while (gi_base_info_iterate_attributes (info, &iter, &name, &value)) { xml_start_element (file, "attribute"); xml_printf (file, " name=\"%s\" value=\"%s\"", name, value); @@ -369,7 +369,7 @@ write_return_value_attributes (Xml *file, GIAttributeIter iter = { 0, }; char *name, *value; - while (g_callable_info_iterate_return_attributes (info, &iter, &name, &value)) + while (gi_callable_info_iterate_return_attributes (info, &iter, &name, &value)) { xml_start_element (file, "attribute"); xml_printf (file, " name=\"%s\" value=\"%s\"", name, value); @@ -402,10 +402,10 @@ write_field_info (const gchar *ns, GIBaseInfo *interface; GIArgument value; - name = g_base_info_get_name ((GIBaseInfo *)info); - flags = g_field_info_get_flags (info); - size = g_field_info_get_size (info); - offset = g_field_info_get_offset (info); + name = gi_base_info_get_name ((GIBaseInfo *)info); + flags = gi_field_info_get_flags (info); + size = gi_field_info_get_size (info); + offset = gi_field_info_get_offset (info); xml_start_element (file, "field"); xml_printf (file, " name=\"%s\"", name); @@ -423,14 +423,14 @@ write_field_info (const gchar *ns, write_attributes (file, (GIBaseInfo*) info); - type = g_field_info_get_type (info); + type = gi_field_info_get_type (info); if (branch) { xml_printf (file, " branch=\""); - g_base_info_unref ((GIBaseInfo *)type); - type = g_constant_info_get_type (branch); - g_constant_info_get_value (branch, &value); + gi_base_info_unref ((GIBaseInfo *)type); + type = gi_constant_info_get_type (branch); + gi_constant_info_get_value (branch, &value); write_constant_value (ns, type, &value, file); xml_printf (file, "\""); } @@ -441,16 +441,16 @@ write_field_info (const gchar *ns, xml_printf (file, "offset=\"%d\"", offset); } - interface = g_type_info_get_interface (type); - if (interface && g_base_info_get_type(interface) == GI_INFO_TYPE_CALLBACK) + interface = gi_type_info_get_interface (type); + if (interface && gi_base_info_get_type(interface) == GI_INFO_TYPE_CALLBACK) write_callback_info (ns, (GICallbackInfo *)interface, file); else write_type_info (ns, type, file); if (interface) - g_base_info_unref (interface); + gi_base_info_unref (interface); - g_base_info_unref ((GIBaseInfo *)type); + gi_base_info_unref ((GIBaseInfo *)type); xml_end_element (file, "field"); } @@ -463,21 +463,21 @@ write_callable_info (const gchar *ns, GITypeInfo *type; gint i; - if (g_callable_info_can_throw_gerror (info)) + if (gi_callable_info_can_throw_gerror (info)) xml_printf (file, " throws=\"1\""); write_attributes (file, (GIBaseInfo*) info); - type = g_callable_info_get_return_type (info); + type = gi_callable_info_get_return_type (info); xml_start_element (file, "return-value"); - write_ownership_transfer (g_callable_info_get_caller_owns (info), file); + write_ownership_transfer (gi_callable_info_get_caller_owns (info), file); - if (g_callable_info_may_return_null (info)) + if (gi_callable_info_may_return_null (info)) xml_printf (file, " allow-none=\"1\""); - if (g_callable_info_skip_return (info)) + if (gi_callable_info_skip_return (info)) xml_printf (file, " skip=\"1\""); write_return_value_attributes (file, info); @@ -486,27 +486,27 @@ write_callable_info (const gchar *ns, xml_end_element (file, "return-value"); - if (g_callable_info_get_n_args (info) <= 0) + if (gi_callable_info_get_n_args (info) <= 0) return; xml_start_element (file, "parameters"); - for (i = 0; i < g_callable_info_get_n_args (info); i++) + for (i = 0; i < gi_callable_info_get_n_args (info); i++) { - GIArgInfo *arg = g_callable_info_get_arg (info, i); + GIArgInfo *arg = gi_callable_info_get_arg (info, i); xml_start_element (file, "parameter"); xml_printf (file, " name=\"%s\"", - g_base_info_get_name ((GIBaseInfo *) arg)); + gi_base_info_get_name ((GIBaseInfo *) arg)); - write_ownership_transfer (g_arg_info_get_ownership_transfer (arg), file); + write_ownership_transfer (gi_arg_info_get_ownership_transfer (arg), file); - switch (g_arg_info_get_direction (arg)) + switch (gi_arg_info_get_direction (arg)) { case GI_DIRECTION_IN: break; case GI_DIRECTION_OUT: xml_printf (file, " direction=\"out\" caller-allocates=\"%s\"", - g_arg_info_is_caller_allocates (arg) ? "1" : "0"); + gi_arg_info_is_caller_allocates (arg) ? "1" : "0"); break; case GI_DIRECTION_INOUT: xml_printf (file, " direction=\"inout\""); @@ -515,16 +515,16 @@ write_callable_info (const gchar *ns, g_assert_not_reached (); } - if (g_arg_info_may_be_null (arg)) + if (gi_arg_info_may_be_null (arg)) xml_printf (file, " allow-none=\"1\""); - if (g_arg_info_is_return_value (arg)) + if (gi_arg_info_is_return_value (arg)) xml_printf (file, " retval=\"1\""); - if (g_arg_info_is_optional (arg)) + if (gi_arg_info_is_optional (arg)) xml_printf (file, " optional=\"1\""); - switch (g_arg_info_get_scope (arg)) + switch (gi_arg_info_get_scope (arg)) { case GI_SCOPE_TYPE_INVALID: break; @@ -544,27 +544,27 @@ write_callable_info (const gchar *ns, g_assert_not_reached (); } - if (g_arg_info_get_closure (arg) >= 0) - xml_printf (file, " closure=\"%d\"", g_arg_info_get_closure (arg)); + if (gi_arg_info_get_closure (arg) >= 0) + xml_printf (file, " closure=\"%d\"", gi_arg_info_get_closure (arg)); - if (g_arg_info_get_destroy (arg) >= 0) - xml_printf (file, " destroy=\"%d\"", g_arg_info_get_destroy (arg)); + if (gi_arg_info_get_destroy (arg) >= 0) + xml_printf (file, " destroy=\"%d\"", gi_arg_info_get_destroy (arg)); - if (g_arg_info_is_skip (arg)) + if (gi_arg_info_is_skip (arg)) xml_printf (file, " skip=\"1\""); write_attributes (file, (GIBaseInfo*) arg); - type = g_arg_info_get_type (arg); + type = gi_arg_info_get_type (arg); write_type_info (ns, type, file); xml_end_element (file, "parameter"); - g_base_info_unref ((GIBaseInfo *)arg); + gi_base_info_unref ((GIBaseInfo *)arg); } xml_end_element (file, "parameters"); - g_base_info_unref ((GIBaseInfo *)type); + gi_base_info_unref ((GIBaseInfo *)type); } static void @@ -578,10 +578,10 @@ write_function_info (const gchar *ns, const gchar *symbol; gboolean deprecated; - flags = g_function_info_get_flags (info); - name = g_base_info_get_name ((GIBaseInfo *)info); - symbol = g_function_info_get_symbol (info); - deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info); + flags = gi_function_info_get_flags (info); + name = gi_base_info_get_name ((GIBaseInfo *)info); + symbol = gi_function_info_get_symbol (info); + deprecated = gi_base_info_is_deprecated ((GIBaseInfo *)info); if (flags & GI_FUNCTION_IS_CONSTRUCTOR) tag = "constructor"; @@ -596,18 +596,18 @@ write_function_info (const gchar *ns, if ((flags & GI_FUNCTION_IS_SETTER) || (flags & GI_FUNCTION_IS_GETTER)) { - GIPropertyInfo *property = g_function_info_get_property (info); + GIPropertyInfo *property = gi_function_info_get_property (info); if (property != NULL) { - const char *property_name = g_base_info_get_name ((GIBaseInfo *)property); + const char *property_name = gi_base_info_get_name ((GIBaseInfo *)property); if (flags & GI_FUNCTION_IS_SETTER) xml_printf (file, " glib:set-property=\"%s\"", property_name); else if (flags & GI_FUNCTION_IS_GETTER) xml_printf (file, " glib:get-property=\"%s\"", property_name); - g_base_info_unref (property); + gi_base_info_unref (property); } } @@ -626,8 +626,8 @@ write_callback_info (const gchar *ns, const gchar *name; gboolean deprecated; - name = g_base_info_get_name ((GIBaseInfo *)info); - deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info); + name = gi_base_info_get_name ((GIBaseInfo *)info); + deprecated = gi_base_info_is_deprecated ((GIBaseInfo *)info); xml_start_element (file, "callback"); xml_printf (file, " name=\"%s\"", name); @@ -655,13 +655,13 @@ write_struct_info (const gchar *ns, gint size; int n_elts; - name = g_base_info_get_name ((GIBaseInfo *)info); - deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info); + name = gi_base_info_get_name ((GIBaseInfo *)info); + deprecated = gi_base_info_is_deprecated ((GIBaseInfo *)info); - type_name = g_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info); - type_init = g_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info); + type_name = gi_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info); + type_init = gi_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info); - if (g_base_info_get_type ((GIBaseInfo *)info) == GI_INFO_TYPE_BOXED) + if (gi_base_info_get_type ((GIBaseInfo *)info) == GI_INFO_TYPE_BOXED) { xml_start_element (file, "glib:boxed"); xml_printf (file, " glib:name=\"%s\"", name); @@ -678,43 +678,43 @@ write_struct_info (const gchar *ns, if (deprecated) xml_printf (file, " deprecated=\"1\""); - is_gtype_struct = g_struct_info_is_gtype_struct (info); + is_gtype_struct = gi_struct_info_is_gtype_struct (info); if (is_gtype_struct) xml_printf (file, " glib:is-gtype-struct=\"1\""); - func = g_struct_info_get_copy_function (info); + func = gi_struct_info_get_copy_function (info); if (func) xml_printf (file, " copy-function=\"%s\"", func); - func = g_struct_info_get_free_function (info); + func = gi_struct_info_get_free_function (info); if (func) xml_printf (file, " free-function=\"%s\"", func); write_attributes (file, (GIBaseInfo*) info); - size = g_struct_info_get_size (info); + size = gi_struct_info_get_size (info); if (file->show_all && size >= 0) xml_printf (file, " size=\"%d\"", size); - foreign = g_struct_info_is_foreign (info); + foreign = gi_struct_info_is_foreign (info); if (foreign) xml_printf (file, " foreign=\"1\""); - n_elts = g_struct_info_get_n_fields (info) + g_struct_info_get_n_methods (info); + n_elts = gi_struct_info_get_n_fields (info) + gi_struct_info_get_n_methods (info); if (n_elts > 0) { - for (i = 0; i < g_struct_info_get_n_fields (info); i++) + for (i = 0; i < gi_struct_info_get_n_fields (info); i++) { - GIFieldInfo *field = g_struct_info_get_field (info, i); + GIFieldInfo *field = gi_struct_info_get_field (info, i); write_field_info (ns, field, NULL, file); - g_base_info_unref ((GIBaseInfo *)field); + gi_base_info_unref ((GIBaseInfo *)field); } - for (i = 0; i < g_struct_info_get_n_methods (info); i++) + for (i = 0; i < gi_struct_info_get_n_methods (info); i++) { - GIFunctionInfo *function = g_struct_info_get_method (info, i); + GIFunctionInfo *function = gi_struct_info_get_method (info, i); write_function_info (ns, function, file); - g_base_info_unref ((GIBaseInfo *)function); + gi_base_info_unref ((GIBaseInfo *)function); } } @@ -732,9 +732,9 @@ write_value_info (const gchar *ns, gchar *value_str; gboolean deprecated; - name = g_base_info_get_name ((GIBaseInfo *)info); - value = g_value_info_get_value (info); - deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info); + name = gi_base_info_get_name ((GIBaseInfo *)info); + value = gi_value_info_get_value (info); + deprecated = gi_base_info_is_deprecated ((GIBaseInfo *)info); xml_start_element (file, "member"); value_str = g_strdup_printf ("%" G_GINT64_FORMAT, value); @@ -755,7 +755,7 @@ write_constant_value (const gchar *ns, GIArgument *value, Xml *file) { - switch (g_type_info_get_tag (type)) + switch (gi_type_info_get_tag (type)) { case GI_TYPE_TAG_BOOLEAN: xml_printf (file, "%d", value->v_boolean); @@ -808,15 +808,15 @@ write_constant_info (const gchar *ns, const gchar *name; GIArgument value; - name = g_base_info_get_name ((GIBaseInfo *)info); + name = gi_base_info_get_name ((GIBaseInfo *)info); xml_start_element (file, "constant"); xml_printf (file, " name=\"%s\"", name); - type = g_constant_info_get_type (info); + type = gi_constant_info_get_type (info); xml_printf (file, " value=\""); - g_constant_info_get_value (info, &value); + gi_constant_info_get_value (info, &value); write_constant_value (ns, type, &value, file); xml_printf (file, "\""); @@ -826,7 +826,7 @@ write_constant_info (const gchar *ns, xml_end_element (file, "constant"); - g_base_info_unref ((GIBaseInfo *)type); + gi_base_info_unref ((GIBaseInfo *)type); } @@ -842,14 +842,14 @@ write_enum_info (const gchar *ns, gboolean deprecated; gint i; - name = g_base_info_get_name ((GIBaseInfo *)info); - deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info); + name = gi_base_info_get_name ((GIBaseInfo *)info); + deprecated = gi_base_info_is_deprecated ((GIBaseInfo *)info); - type_name = g_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info); - type_init = g_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info); - error_domain = g_enum_info_get_error_domain (info); + type_name = gi_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info); + type_init = gi_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info); + error_domain = gi_enum_info_get_error_domain (info); - if (g_base_info_get_type ((GIBaseInfo *)info) == GI_INFO_TYPE_ENUM) + if (gi_base_info_get_type ((GIBaseInfo *)info) == GI_INFO_TYPE_ENUM) xml_start_element (file, "enumeration"); else xml_start_element (file, "bitfield"); @@ -865,11 +865,11 @@ write_enum_info (const gchar *ns, write_attributes (file, (GIBaseInfo*) info); - for (i = 0; i < g_enum_info_get_n_values (info); i++) + for (i = 0; i < gi_enum_info_get_n_values (info); i++) { - GIValueInfo *value = g_enum_info_get_value (info, i); + GIValueInfo *value = gi_enum_info_get_value (info, i); write_value_info (ns, value, file); - g_base_info_unref ((GIBaseInfo *)value); + gi_base_info_unref ((GIBaseInfo *)value); } xml_end_element_unchecked (file); @@ -884,9 +884,9 @@ write_signal_info (const gchar *ns, const gchar *name; gboolean deprecated; - name = g_base_info_get_name ((GIBaseInfo *)info); - flags = g_signal_info_get_flags (info); - deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info); + name = gi_base_info_get_name ((GIBaseInfo *)info); + flags = gi_signal_info_get_flags (info); + deprecated = gi_base_info_is_deprecated ((GIBaseInfo *)info); xml_start_element (file, "glib:signal"); xml_printf (file, " name=\"%s\"", name); @@ -929,11 +929,11 @@ write_vfunc_info (const gchar *ns, gboolean deprecated; gint offset; - name = g_base_info_get_name ((GIBaseInfo *)info); - flags = g_vfunc_info_get_flags (info); - deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info); - offset = g_vfunc_info_get_offset (info); - invoker = g_vfunc_info_get_invoker (info); + name = gi_base_info_get_name ((GIBaseInfo *)info); + flags = gi_vfunc_info_get_flags (info); + deprecated = gi_base_info_is_deprecated ((GIBaseInfo *)info); + offset = gi_vfunc_info_get_offset (info); + invoker = gi_vfunc_info_get_invoker (info); xml_start_element (file, "virtual-method"); xml_printf (file, " name=\"%s\"", name); @@ -953,8 +953,8 @@ write_vfunc_info (const gchar *ns, if (invoker) { - xml_printf (file, " invoker=\"%s\"", g_base_info_get_name ((GIBaseInfo*)invoker)); - g_base_info_unref ((GIBaseInfo *)invoker); + xml_printf (file, " invoker=\"%s\"", gi_base_info_get_name ((GIBaseInfo*)invoker)); + gi_base_info_unref ((GIBaseInfo *)invoker); } write_callable_info (ns, (GICallableInfo*)info, file); @@ -972,9 +972,9 @@ write_property_info (const gchar *ns, gboolean deprecated; GITypeInfo *type; - name = g_base_info_get_name ((GIBaseInfo *)info); - flags = g_property_info_get_flags (info); - deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info); + name = gi_base_info_get_name ((GIBaseInfo *)info); + flags = gi_property_info_get_flags (info); + deprecated = gi_base_info_is_deprecated ((GIBaseInfo *)info); xml_start_element (file, "property"); xml_printf (file, " name=\"%s\"", name); @@ -996,31 +996,31 @@ write_property_info (const gchar *ns, if (flags & G_PARAM_READABLE) { - GIFunctionInfo *getter = g_property_info_get_getter (info); + GIFunctionInfo *getter = gi_property_info_get_getter (info); if (getter != NULL) { - xml_printf (file, " getter=\"%s\"", g_base_info_get_name ((GIBaseInfo *) getter)); - g_base_info_unref ((GIBaseInfo *) getter); + xml_printf (file, " getter=\"%s\"", gi_base_info_get_name ((GIBaseInfo *) getter)); + gi_base_info_unref ((GIBaseInfo *) getter); } } if (flags & G_PARAM_WRITABLE) { - GIFunctionInfo *setter = g_property_info_get_setter (info); + GIFunctionInfo *setter = gi_property_info_get_setter (info); if (setter != NULL) { - xml_printf (file, " setter=\"%s\"", g_base_info_get_name ((GIBaseInfo *) setter)); - g_base_info_unref ((GIBaseInfo *) setter); + xml_printf (file, " setter=\"%s\"", gi_base_info_get_name ((GIBaseInfo *) setter)); + gi_base_info_unref ((GIBaseInfo *) setter); } } - write_ownership_transfer (g_property_info_get_ownership_transfer (info), file); + write_ownership_transfer (gi_property_info_get_ownership_transfer (info), file); write_attributes (file, (GIBaseInfo*) info); - type = g_property_info_get_type (info); + type = gi_property_info_get_type (info); write_type_info (ns, type, file); @@ -1044,29 +1044,29 @@ write_object_info (const gchar *ns, GIStructInfo *class_struct; gint i; - name = g_base_info_get_name ((GIBaseInfo *)info); - deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info); - is_abstract = g_object_info_get_abstract (info); - is_fundamental = g_object_info_get_fundamental (info); - is_final = g_object_info_get_final (info); + name = gi_base_info_get_name ((GIBaseInfo *)info); + deprecated = gi_base_info_is_deprecated ((GIBaseInfo *)info); + is_abstract = gi_object_info_get_abstract (info); + is_fundamental = gi_object_info_get_fundamental (info); + is_final = gi_object_info_get_final (info); - type_name = g_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info); - type_init = g_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info); + type_name = gi_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info); + type_init = gi_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info); xml_start_element (file, "class"); xml_printf (file, " name=\"%s\"", name); - pnode = g_object_info_get_parent (info); + pnode = gi_object_info_get_parent (info); if (pnode) { write_type_name_attribute (ns, (GIBaseInfo *)pnode, "parent", file); - g_base_info_unref ((GIBaseInfo *)pnode); + gi_base_info_unref ((GIBaseInfo *)pnode); } - class_struct = g_object_info_get_class_struct (info); + class_struct = gi_object_info_get_class_struct (info); if (class_struct) { write_type_name_attribute (ns, (GIBaseInfo*) class_struct, "glib:type-struct", file); - g_base_info_unref ((GIBaseInfo*)class_struct); + gi_base_info_unref ((GIBaseInfo*)class_struct); } if (is_abstract) @@ -1080,19 +1080,19 @@ write_object_info (const gchar *ns, if (is_fundamental) xml_printf (file, " glib:fundamental=\"1\""); - func = g_object_info_get_unref_function (info); + func = gi_object_info_get_unref_function (info); if (func) xml_printf (file, " glib:unref-function=\"%s\"", func); - func = g_object_info_get_ref_function (info); + func = gi_object_info_get_ref_function (info); if (func) xml_printf (file, " glib:ref-function=\"%s\"", func); - func = g_object_info_get_set_value_function (info); + func = gi_object_info_get_set_value_function (info); if (func) xml_printf (file, " glib:set-value-function=\"%s\"", func); - func = g_object_info_get_get_value_function (info); + func = gi_object_info_get_get_value_function (info); if (func) xml_printf (file, " glib:get-value-function=\"%s\"", func); @@ -1101,58 +1101,58 @@ write_object_info (const gchar *ns, write_attributes (file, (GIBaseInfo*) info); - if (g_object_info_get_n_interfaces (info) > 0) + if (gi_object_info_get_n_interfaces (info) > 0) { - for (i = 0; i < g_object_info_get_n_interfaces (info); i++) + for (i = 0; i < gi_object_info_get_n_interfaces (info); i++) { - GIInterfaceInfo *imp = g_object_info_get_interface (info, i); + GIInterfaceInfo *imp = gi_object_info_get_interface (info, i); xml_start_element (file, "implements"); write_type_name_attribute (ns, (GIBaseInfo *)imp, "name", file); xml_end_element (file, "implements"); - g_base_info_unref ((GIBaseInfo*)imp); + gi_base_info_unref ((GIBaseInfo*)imp); } } - for (i = 0; i < g_object_info_get_n_fields (info); i++) + for (i = 0; i < gi_object_info_get_n_fields (info); i++) { - GIFieldInfo *field = g_object_info_get_field (info, i); + GIFieldInfo *field = gi_object_info_get_field (info, i); write_field_info (ns, field, NULL, file); - g_base_info_unref ((GIBaseInfo *)field); + gi_base_info_unref ((GIBaseInfo *)field); } - for (i = 0; i < g_object_info_get_n_methods (info); i++) + for (i = 0; i < gi_object_info_get_n_methods (info); i++) { - GIFunctionInfo *function = g_object_info_get_method (info, i); + GIFunctionInfo *function = gi_object_info_get_method (info, i); write_function_info (ns, function, file); - g_base_info_unref ((GIBaseInfo *)function); + gi_base_info_unref ((GIBaseInfo *)function); } - for (i = 0; i < g_object_info_get_n_properties (info); i++) + for (i = 0; i < gi_object_info_get_n_properties (info); i++) { - GIPropertyInfo *prop = g_object_info_get_property (info, i); + GIPropertyInfo *prop = gi_object_info_get_property (info, i); write_property_info (ns, prop, file); - g_base_info_unref ((GIBaseInfo *)prop); + gi_base_info_unref ((GIBaseInfo *)prop); } - for (i = 0; i < g_object_info_get_n_signals (info); i++) + for (i = 0; i < gi_object_info_get_n_signals (info); i++) { - GISignalInfo *signal = g_object_info_get_signal (info, i); + GISignalInfo *signal = gi_object_info_get_signal (info, i); write_signal_info (ns, signal, file); - g_base_info_unref ((GIBaseInfo *)signal); + gi_base_info_unref ((GIBaseInfo *)signal); } - for (i = 0; i < g_object_info_get_n_vfuncs (info); i++) + for (i = 0; i < gi_object_info_get_n_vfuncs (info); i++) { - GIVFuncInfo *vfunc = g_object_info_get_vfunc (info, i); + GIVFuncInfo *vfunc = gi_object_info_get_vfunc (info, i); write_vfunc_info (ns, vfunc, file); - g_base_info_unref ((GIBaseInfo *)vfunc); + gi_base_info_unref ((GIBaseInfo *)vfunc); } - for (i = 0; i < g_object_info_get_n_constants (info); i++) + for (i = 0; i < gi_object_info_get_n_constants (info); i++) { - GIConstantInfo *constant = g_object_info_get_constant (info, i); + GIConstantInfo *constant = gi_object_info_get_constant (info, i); write_constant_info (ns, constant, file); - g_base_info_unref ((GIBaseInfo *)constant); + gi_base_info_unref ((GIBaseInfo *)constant); } xml_end_element (file, "class"); @@ -1170,20 +1170,20 @@ write_interface_info (const gchar *ns, gboolean deprecated; gint i; - name = g_base_info_get_name ((GIBaseInfo *)info); - deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info); + name = gi_base_info_get_name ((GIBaseInfo *)info); + deprecated = gi_base_info_is_deprecated ((GIBaseInfo *)info); - type_name = g_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info); - type_init = g_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info); + type_name = gi_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info); + type_init = gi_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info); xml_start_element (file, "interface"); xml_printf (file, " name=\"%s\" glib:type-name=\"%s\" glib:get-type=\"%s\"", name, type_name, type_init); - class_struct = g_interface_info_get_iface_struct (info); + class_struct = gi_interface_info_get_iface_struct (info); if (class_struct) { write_type_name_attribute (ns, (GIBaseInfo*) class_struct, "glib:type-struct", file); - g_base_info_unref ((GIBaseInfo*)class_struct); + gi_base_info_unref ((GIBaseInfo*)class_struct); } if (deprecated) @@ -1191,53 +1191,53 @@ write_interface_info (const gchar *ns, write_attributes (file, (GIBaseInfo*) info); - if (g_interface_info_get_n_prerequisites (info) > 0) + if (gi_interface_info_get_n_prerequisites (info) > 0) { - for (i = 0; i < g_interface_info_get_n_prerequisites (info); i++) + for (i = 0; i < gi_interface_info_get_n_prerequisites (info); i++) { - GIBaseInfo *req = g_interface_info_get_prerequisite (info, i); + GIBaseInfo *req = gi_interface_info_get_prerequisite (info, i); xml_start_element (file, "prerequisite"); write_type_name_attribute (ns, req, "name", file); xml_end_element_unchecked (file); - g_base_info_unref (req); + gi_base_info_unref (req); } } - for (i = 0; i < g_interface_info_get_n_methods (info); i++) + for (i = 0; i < gi_interface_info_get_n_methods (info); i++) { - GIFunctionInfo *function = g_interface_info_get_method (info, i); + GIFunctionInfo *function = gi_interface_info_get_method (info, i); write_function_info (ns, function, file); - g_base_info_unref ((GIBaseInfo *)function); + gi_base_info_unref ((GIBaseInfo *)function); } - for (i = 0; i < g_interface_info_get_n_properties (info); i++) + for (i = 0; i < gi_interface_info_get_n_properties (info); i++) { - GIPropertyInfo *prop = g_interface_info_get_property (info, i); + GIPropertyInfo *prop = gi_interface_info_get_property (info, i); write_property_info (ns, prop, file); - g_base_info_unref ((GIBaseInfo *)prop); + gi_base_info_unref ((GIBaseInfo *)prop); } - for (i = 0; i < g_interface_info_get_n_signals (info); i++) + for (i = 0; i < gi_interface_info_get_n_signals (info); i++) { - GISignalInfo *signal = g_interface_info_get_signal (info, i); + GISignalInfo *signal = gi_interface_info_get_signal (info, i); write_signal_info (ns, signal, file); - g_base_info_unref ((GIBaseInfo *)signal); + gi_base_info_unref ((GIBaseInfo *)signal); } - for (i = 0; i < g_interface_info_get_n_vfuncs (info); i++) + for (i = 0; i < gi_interface_info_get_n_vfuncs (info); i++) { - GIVFuncInfo *vfunc = g_interface_info_get_vfunc (info, i); + GIVFuncInfo *vfunc = gi_interface_info_get_vfunc (info, i); write_vfunc_info (ns, vfunc, file); - g_base_info_unref ((GIBaseInfo *)vfunc); + gi_base_info_unref ((GIBaseInfo *)vfunc); } - for (i = 0; i < g_interface_info_get_n_constants (info); i++) + for (i = 0; i < gi_interface_info_get_n_constants (info); i++) { - GIConstantInfo *constant = g_interface_info_get_constant (info, i); + GIConstantInfo *constant = gi_interface_info_get_constant (info, i); write_constant_info (ns, constant, file); - g_base_info_unref ((GIBaseInfo *)constant); + gi_base_info_unref ((GIBaseInfo *)constant); } xml_end_element (file, "interface"); @@ -1256,11 +1256,11 @@ write_union_info (const gchar *ns, gint i; gint size; - name = g_base_info_get_name ((GIBaseInfo *)info); - deprecated = g_base_info_is_deprecated ((GIBaseInfo *)info); + name = gi_base_info_get_name ((GIBaseInfo *)info); + deprecated = gi_base_info_is_deprecated ((GIBaseInfo *)info); - type_name = g_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info); - type_init = g_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info); + type_name = gi_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info); + type_init = gi_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info); xml_start_element (file, "union"); xml_printf (file, " name=\"%s\"", name); @@ -1271,50 +1271,50 @@ write_union_info (const gchar *ns, if (deprecated) xml_printf (file, " deprecated=\"1\""); - size = g_union_info_get_size (info); + size = gi_union_info_get_size (info); if (file->show_all && size >= 0) xml_printf (file, " size=\"%d\"", size); - func = g_union_info_get_copy_function (info); + func = gi_union_info_get_copy_function (info); if (func) xml_printf (file, " copy-function=\"%s\"", func); - func = g_union_info_get_free_function (info); + func = gi_union_info_get_free_function (info); if (func) xml_printf (file, " free-function=\"%s\"", func); write_attributes (file, (GIBaseInfo*) info); - if (g_union_info_is_discriminated (info)) + if (gi_union_info_is_discriminated (info)) { gint offset; GITypeInfo *type; - offset = g_union_info_get_discriminator_offset (info); - type = g_union_info_get_discriminator_type (info); + offset = gi_union_info_get_discriminator_offset (info); + type = gi_union_info_get_discriminator_type (info); xml_start_element (file, "discriminator"); xml_printf (file, " offset=\"%d\" type=\"", offset); write_type_info (ns, type, file); xml_end_element (file, "discriminator"); - g_base_info_unref ((GIBaseInfo *)type); + gi_base_info_unref ((GIBaseInfo *)type); } - for (i = 0; i < g_union_info_get_n_fields (info); i++) + for (i = 0; i < gi_union_info_get_n_fields (info); i++) { - GIFieldInfo *field = g_union_info_get_field (info, i); - GIConstantInfo *constant = g_union_info_get_discriminator (info, i); + GIFieldInfo *field = gi_union_info_get_field (info, i); + GIConstantInfo *constant = gi_union_info_get_discriminator (info, i); write_field_info (ns, field, constant, file); - g_base_info_unref ((GIBaseInfo *)field); + gi_base_info_unref ((GIBaseInfo *)field); if (constant) - g_base_info_unref ((GIBaseInfo *)constant); + gi_base_info_unref ((GIBaseInfo *)constant); } - for (i = 0; i < g_union_info_get_n_methods (info); i++) + for (i = 0; i < gi_union_info_get_n_methods (info); i++) { - GIFunctionInfo *function = g_union_info_get_method (info, i); + GIFunctionInfo *function = gi_union_info_get_method (info, i); write_function_info (ns, function, file); - g_base_info_unref ((GIBaseInfo *)function); + gi_base_info_unref ((GIBaseInfo *)function); } xml_end_element (file, "union"); @@ -1322,7 +1322,7 @@ write_union_info (const gchar *ns, /* - * g_ir_writer_write: + * gi_ir_writer_write: * @filename: filename to write to * @ns: GIR namespace to write * @needs_prefix: if the filename needs prefixing @@ -1332,10 +1332,10 @@ write_union_info (const gchar *ns, * into a GIR xml file named @filename. */ void -g_ir_writer_write (const char *filename, - const char *ns, - gboolean needs_prefix, - gboolean show_all) +gi_ir_writer_write (const char *filename, + const char *ns, + gboolean needs_prefix, + gboolean show_all) { FILE *ofile; gint i, j; @@ -1343,7 +1343,7 @@ g_ir_writer_write (const char *filename, GIRepository *repository; Xml *xml; - repository = g_irepository_get_default (); + repository = gi_repository_get_default (); if (filename == NULL) ofile = stdout; @@ -1378,7 +1378,7 @@ g_ir_writer_write (const char *filename, " xmlns:c=\"http://www.gtk.org/introspection/c/1.0\"\n" " xmlns:glib=\"http://www.gtk.org/introspection/glib/1.0\""); - dependencies = g_irepository_get_immediate_dependencies (repository, ns); + dependencies = gi_repository_get_immediate_dependencies (repository, ns); if (dependencies != NULL) { for (i = 0; dependencies[i]; i++) @@ -1399,10 +1399,10 @@ g_ir_writer_write (const char *filename, const char *cur_version; gint n_infos; - cur_version = g_irepository_get_version (repository, cur_ns); + cur_version = gi_repository_get_version (repository, cur_ns); - shared_library = g_irepository_get_shared_library (repository, cur_ns); - c_prefix = g_irepository_get_c_prefix (repository, cur_ns); + shared_library = gi_repository_get_shared_library (repository, cur_ns); + c_prefix = gi_repository_get_c_prefix (repository, cur_ns); xml_start_element (xml, "namespace"); xml_printf (xml, " name=\"%s\" version=\"%s\"", cur_ns, cur_version); if (shared_library) @@ -1410,11 +1410,11 @@ g_ir_writer_write (const char *filename, if (c_prefix) xml_printf (xml, " c:prefix=\"%s\"", c_prefix); - n_infos = g_irepository_get_n_infos (repository, cur_ns); + n_infos = gi_repository_get_n_infos (repository, cur_ns); for (j = 0; j < n_infos; j++) { - GIBaseInfo *info = g_irepository_get_info (repository, cur_ns, j); - switch (g_base_info_get_type (info)) + GIBaseInfo *info = gi_repository_get_info (repository, cur_ns, j); + switch (gi_base_info_get_type (info)) { case GI_INFO_TYPE_FUNCTION: write_function_info (ns, (GIFunctionInfo *)info, xml); @@ -1451,10 +1451,10 @@ g_ir_writer_write (const char *filename, break; default: - g_error ("unknown info type %d\n", g_base_info_get_type (info)); + g_error ("unknown info type %d\n", gi_base_info_get_type (info)); } - g_base_info_unref (info); + gi_base_info_unref (info); } xml_end_element (xml, "namespace"); diff --git a/girepository/gisignalinfo.c b/girepository/gisignalinfo.c index 0dd26e931..9424c16f9 100644 --- a/girepository/gisignalinfo.c +++ b/girepository/gisignalinfo.c @@ -46,7 +46,7 @@ */ /** - * g_signal_info_get_flags: + * gi_signal_info_get_flags: * @info: a #GISignalInfo * * Obtain the flags for this signal info. See #GSignalFlags for @@ -55,7 +55,7 @@ * Returns: the flags */ GSignalFlags -g_signal_info_get_flags (GISignalInfo *info) +gi_signal_info_get_flags (GISignalInfo *info) { GSignalFlags flags; GIRealInfo *rinfo = (GIRealInfo *)info; @@ -92,7 +92,7 @@ g_signal_info_get_flags (GISignalInfo *info) } /** - * g_signal_info_get_class_closure: + * gi_signal_info_get_class_closure: * @info: a #GISignalInfo * * Obtain the class closure for this signal if one is set. The class @@ -102,7 +102,7 @@ g_signal_info_get_flags (GISignalInfo *info) * Returns: (transfer full): the class closure or %NULL */ GIVFuncInfo * -g_signal_info_get_class_closure (GISignalInfo *info) +gi_signal_info_get_class_closure (GISignalInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; SignalBlob *blob; @@ -113,13 +113,13 @@ g_signal_info_get_class_closure (GISignalInfo *info) blob = (SignalBlob *)&rinfo->typelib->data[rinfo->offset]; if (blob->has_class_closure) - return g_interface_info_get_vfunc ((GIInterfaceInfo *)rinfo->container, blob->class_closure); + return gi_interface_info_get_vfunc ((GIInterfaceInfo *)rinfo->container, blob->class_closure); return NULL; } /** - * g_signal_info_true_stops_emit: + * gi_signal_info_true_stops_emit: * @info: a #GISignalInfo * * Obtain if the returning true in the signal handler will @@ -128,7 +128,7 @@ g_signal_info_get_class_closure (GISignalInfo *info) * Returns: %TRUE if returning true stops the signal emission */ gboolean -g_signal_info_true_stops_emit (GISignalInfo *info) +gi_signal_info_true_stops_emit (GISignalInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; SignalBlob *blob; diff --git a/girepository/gisignalinfo.h b/girepository/gisignalinfo.h index 31a5fa627..cbf6d7992 100644 --- a/girepository/gisignalinfo.h +++ b/girepository/gisignalinfo.h @@ -40,16 +40,16 @@ G_BEGIN_DECLS * Checks if @info is a #GISignalInfo. */ #define GI_IS_SIGNAL_INFO(info) \ - (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_SIGNAL) + (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_SIGNAL) GI_AVAILABLE_IN_ALL -GSignalFlags g_signal_info_get_flags (GISignalInfo *info); +GSignalFlags gi_signal_info_get_flags (GISignalInfo *info); GI_AVAILABLE_IN_ALL -GIVFuncInfo * g_signal_info_get_class_closure (GISignalInfo *info); +GIVFuncInfo * gi_signal_info_get_class_closure (GISignalInfo *info); GI_AVAILABLE_IN_ALL -gboolean g_signal_info_true_stops_emit (GISignalInfo *info); +gboolean gi_signal_info_true_stops_emit (GISignalInfo *info); G_END_DECLS diff --git a/girepository/gistructinfo.c b/girepository/gistructinfo.c index f81069450..a43ec01d1 100644 --- a/girepository/gistructinfo.c +++ b/girepository/gistructinfo.c @@ -44,7 +44,7 @@ */ /** - * g_struct_info_get_n_fields: + * gi_struct_info_get_n_fields: * @info: a #GIStructInfo * * Obtain the number of fields this structure has. @@ -52,7 +52,7 @@ * Returns: number of fields */ gint -g_struct_info_get_n_fields (GIStructInfo *info) +gi_struct_info_get_n_fields (GIStructInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset]; @@ -61,7 +61,7 @@ g_struct_info_get_n_fields (GIStructInfo *info) } /** - * g_struct_info_get_field_offset: + * gi_struct_info_get_field_offset: * @info: a #GIStructInfo * @n: index of queried field * @@ -70,8 +70,8 @@ g_struct_info_get_n_fields (GIStructInfo *info) * Returns: field offset in bytes */ static gint32 -g_struct_get_field_offset (GIStructInfo *info, - gint n) +gi_struct_get_field_offset (GIStructInfo *info, + gint n) { GIRealInfo *rinfo = (GIRealInfo *)info; Header *header = (Header *)rinfo->typelib->data; @@ -91,27 +91,27 @@ g_struct_get_field_offset (GIStructInfo *info, } /** - * g_struct_info_get_field: + * gi_struct_info_get_field: * @info: a #GIStructInfo * @n: a field index * * Obtain the type information for field with specified index. * - * Returns: (transfer full): the #GIFieldInfo, free it with g_base_info_unref() + * Returns: (transfer full): the #GIFieldInfo, free it with gi_base_info_unref() * when done. */ GIFieldInfo * -g_struct_info_get_field (GIStructInfo *info, - gint n) +gi_struct_info_get_field (GIStructInfo *info, + gint n) { GIRealInfo *rinfo = (GIRealInfo *)info; - return (GIFieldInfo *) g_info_new (GI_INFO_TYPE_FIELD, (GIBaseInfo*)info, rinfo->typelib, - g_struct_get_field_offset (info, n)); + return (GIFieldInfo *) gi_info_new (GI_INFO_TYPE_FIELD, (GIBaseInfo*)info, rinfo->typelib, + gi_struct_get_field_offset (info, n)); } /** - * g_struct_info_find_field: + * gi_struct_info_find_field: * @info: a #GIStructInfo * @name: a field name * @@ -119,11 +119,11 @@ g_struct_info_get_field (GIStructInfo *info, * * Since: 1.46 * Returns: (transfer full): the #GIFieldInfo or %NULL if not found, - * free it with g_base_info_unref() when done. + * free it with gi_base_info_unref() when done. */ GIFieldInfo * -g_struct_info_find_field (GIStructInfo *info, - const gchar *name) +gi_struct_info_find_field (GIStructInfo *info, + const gchar *name) { GIRealInfo *rinfo = (GIRealInfo *)info; StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset]; @@ -138,10 +138,10 @@ g_struct_info_find_field (GIStructInfo *info, if (strcmp (name, fname) == 0) { - return (GIFieldInfo *) g_info_new (GI_INFO_TYPE_FIELD, - (GIBaseInfo* )info, - rinfo->typelib, - offset); + return (GIFieldInfo *) gi_info_new (GI_INFO_TYPE_FIELD, + (GIBaseInfo* )info, + rinfo->typelib, + offset); } offset += header->field_blob_size; @@ -153,7 +153,7 @@ g_struct_info_find_field (GIStructInfo *info, } /** - * g_struct_info_get_n_methods: + * gi_struct_info_get_n_methods: * @info: a #GIStructInfo * * Obtain the number of methods this structure has. @@ -161,7 +161,7 @@ g_struct_info_find_field (GIStructInfo *info, * Returns: number of methods */ gint -g_struct_info_get_n_methods (GIStructInfo *info) +gi_struct_info_get_n_methods (GIStructInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset]; @@ -170,53 +170,53 @@ g_struct_info_get_n_methods (GIStructInfo *info) } /** - * g_struct_info_get_method: + * gi_struct_info_get_method: * @info: a #GIStructInfo * @n: a method index * * Obtain the type information for method with specified index. * - * Returns: (transfer full): the #GIFunctionInfo, free it with g_base_info_unref() + * Returns: (transfer full): the #GIFunctionInfo, free it with gi_base_info_unref() * when done. */ GIFunctionInfo * -g_struct_info_get_method (GIStructInfo *info, - gint n) +gi_struct_info_get_method (GIStructInfo *info, + gint n) { GIRealInfo *rinfo = (GIRealInfo *)info; StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset]; Header *header = (Header *)rinfo->typelib->data; gint offset; - offset = g_struct_get_field_offset (info, blob->n_fields) + n * header->function_blob_size; - return (GIFunctionInfo *) g_info_new (GI_INFO_TYPE_FUNCTION, (GIBaseInfo*)info, - rinfo->typelib, offset); + offset = gi_struct_get_field_offset (info, blob->n_fields) + n * header->function_blob_size; + return (GIFunctionInfo *) gi_info_new (GI_INFO_TYPE_FUNCTION, (GIBaseInfo*)info, + rinfo->typelib, offset); } /** - * g_struct_info_find_method: + * gi_struct_info_find_method: * @info: a #GIStructInfo * @name: a method name * * Obtain the type information for method named @name. * - * Returns: (transfer full): the #GIFunctionInfo, free it with g_base_info_unref() + * Returns: (transfer full): the #GIFunctionInfo, free it with gi_base_info_unref() * when done. */ GIFunctionInfo * -g_struct_info_find_method (GIStructInfo *info, - const gchar *name) +gi_struct_info_find_method (GIStructInfo *info, + const gchar *name) { gint offset; GIRealInfo *rinfo = (GIRealInfo *)info; StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset]; - offset = g_struct_get_field_offset (info, blob->n_fields); - return _g_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_methods, name); + offset = gi_struct_get_field_offset (info, blob->n_fields); + return _gi_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_methods, name); } /** - * g_struct_info_get_size: + * gi_struct_info_get_size: * @info: a #GIStructInfo * * Obtain the total size of the structure. @@ -224,7 +224,7 @@ g_struct_info_find_method (GIStructInfo *info, * Returns: size of the structure in bytes */ gsize -g_struct_info_get_size (GIStructInfo *info) +gi_struct_info_get_size (GIStructInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset]; @@ -233,7 +233,7 @@ g_struct_info_get_size (GIStructInfo *info) } /** - * g_struct_info_get_alignment: + * gi_struct_info_get_alignment: * @info: a #GIStructInfo * * Obtain the required alignment of the structure. @@ -241,7 +241,7 @@ g_struct_info_get_size (GIStructInfo *info) * Returns: required alignment in bytes */ gsize -g_struct_info_get_alignment (GIStructInfo *info) +gi_struct_info_get_alignment (GIStructInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset]; @@ -250,7 +250,7 @@ g_struct_info_get_alignment (GIStructInfo *info) } /** - * g_struct_info_is_foreign: + * gi_struct_info_is_foreign: * @info: TODO * * TODO @@ -258,7 +258,7 @@ g_struct_info_get_alignment (GIStructInfo *info) * Returns: TODO */ gboolean -g_struct_info_is_foreign (GIStructInfo *info) +gi_struct_info_is_foreign (GIStructInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset]; @@ -267,7 +267,7 @@ g_struct_info_is_foreign (GIStructInfo *info) } /** - * g_struct_info_is_gtype_struct: + * gi_struct_info_is_gtype_struct: * @info: a #GIStructInfo * * Return true if this structure represents the "class structure" for some @@ -277,7 +277,7 @@ g_struct_info_is_foreign (GIStructInfo *info) * Returns: %TRUE if this is a class struct, %FALSE otherwise */ gboolean -g_struct_info_is_gtype_struct (GIStructInfo *info) +gi_struct_info_is_gtype_struct (GIStructInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset]; @@ -286,7 +286,7 @@ g_struct_info_is_gtype_struct (GIStructInfo *info) } /** - * g_struct_info_get_copy_function: + * gi_struct_info_get_copy_function: * @info: a struct information blob * * Retrieves the name of the copy function for @info, if any is set. @@ -296,7 +296,7 @@ g_struct_info_is_gtype_struct (GIStructInfo *info) * Since: 1.76 */ const char * -g_struct_info_get_copy_function (GIStructInfo *info) +gi_struct_info_get_copy_function (GIStructInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; StructBlob *blob; @@ -307,13 +307,13 @@ g_struct_info_get_copy_function (GIStructInfo *info) blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset]; if (blob->copy_func) - return g_typelib_get_string (rinfo->typelib, blob->copy_func); + return gi_typelib_get_string (rinfo->typelib, blob->copy_func); return NULL; } /** - * g_struct_info_get_free_function: + * gi_struct_info_get_free_function: * @info: a struct information blob * * Retrieves the name of the free function for @info, if any is set. @@ -323,7 +323,7 @@ g_struct_info_get_copy_function (GIStructInfo *info) * Since: 1.76 */ const char * -g_struct_info_get_free_function (GIStructInfo *info) +gi_struct_info_get_free_function (GIStructInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; StructBlob *blob; @@ -334,7 +334,7 @@ g_struct_info_get_free_function (GIStructInfo *info) blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset]; if (blob->free_func) - return g_typelib_get_string (rinfo->typelib, blob->free_func); + return gi_typelib_get_string (rinfo->typelib, blob->free_func); return NULL; } diff --git a/girepository/gistructinfo.h b/girepository/gistructinfo.h index 74030c170..a44b1f43e 100644 --- a/girepository/gistructinfo.h +++ b/girepository/gistructinfo.h @@ -39,47 +39,47 @@ G_BEGIN_DECLS * Checks if @info is a #GIStructInfo. */ #define GI_IS_STRUCT_INFO(info) \ - (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_STRUCT) + (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_STRUCT) GI_AVAILABLE_IN_ALL -gint g_struct_info_get_n_fields (GIStructInfo *info); +gint gi_struct_info_get_n_fields (GIStructInfo *info); GI_AVAILABLE_IN_ALL -GIFieldInfo * g_struct_info_get_field (GIStructInfo *info, - gint n); +GIFieldInfo * gi_struct_info_get_field (GIStructInfo *info, + gint n); GI_AVAILABLE_IN_ALL -GIFieldInfo * g_struct_info_find_field (GIStructInfo *info, - const gchar *name); +GIFieldInfo * gi_struct_info_find_field (GIStructInfo *info, + const gchar *name); GI_AVAILABLE_IN_ALL -gint g_struct_info_get_n_methods (GIStructInfo *info); +gint gi_struct_info_get_n_methods (GIStructInfo *info); GI_AVAILABLE_IN_ALL -GIFunctionInfo * g_struct_info_get_method (GIStructInfo *info, - gint n); +GIFunctionInfo * gi_struct_info_get_method (GIStructInfo *info, + gint n); GI_AVAILABLE_IN_ALL -GIFunctionInfo * g_struct_info_find_method (GIStructInfo *info, - const gchar *name); +GIFunctionInfo * gi_struct_info_find_method (GIStructInfo *info, + const gchar *name); GI_AVAILABLE_IN_ALL -gsize g_struct_info_get_size (GIStructInfo *info); +gsize gi_struct_info_get_size (GIStructInfo *info); GI_AVAILABLE_IN_ALL -gsize g_struct_info_get_alignment (GIStructInfo *info); +gsize gi_struct_info_get_alignment (GIStructInfo *info); GI_AVAILABLE_IN_ALL -gboolean g_struct_info_is_gtype_struct (GIStructInfo *info); +gboolean gi_struct_info_is_gtype_struct (GIStructInfo *info); GI_AVAILABLE_IN_ALL -gboolean g_struct_info_is_foreign (GIStructInfo *info); +gboolean gi_struct_info_is_foreign (GIStructInfo *info); GI_AVAILABLE_IN_ALL -const char * g_struct_info_get_copy_function (GIStructInfo *info); +const char * gi_struct_info_get_copy_function (GIStructInfo *info); GI_AVAILABLE_IN_ALL -const char * g_struct_info_get_free_function (GIStructInfo *info); +const char * gi_struct_info_get_free_function (GIStructInfo *info); G_END_DECLS diff --git a/girepository/gitypeinfo.c b/girepository/gitypeinfo.c index ae6ff501c..429615c9a 100644 --- a/girepository/gitypeinfo.c +++ b/girepository/gitypeinfo.c @@ -45,12 +45,12 @@ * * A type can either be a of a basic type which is a standard C primitive * type or an interface type. For interface types you need to call - * g_type_info_get_interface() to get a reference to the base info for that + * gi_type_info_get_interface() to get a reference to the base info for that * interface. */ /** - * g_type_info_is_pointer: + * gi_type_info_is_pointer: * @info: a #GITypeInfo * * Obtain if the type is passed as a reference. @@ -63,7 +63,7 @@ * Returns: %TRUE if it is a pointer */ gboolean -g_type_info_is_pointer (GITypeInfo *info) +gi_type_info_is_pointer (GITypeInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; SimpleTypeBlob *type; @@ -84,7 +84,7 @@ g_type_info_is_pointer (GITypeInfo *info) } /** - * g_type_info_get_tag: + * gi_type_info_get_tag: * @info: a #GITypeInfo * * Obtain the type tag for the type. See #GITypeTag for a list @@ -93,7 +93,7 @@ g_type_info_is_pointer (GITypeInfo *info) * Returns: the type tag */ GITypeTag -g_type_info_get_tag (GITypeInfo *info) +gi_type_info_get_tag (GITypeInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; SimpleTypeBlob *type; @@ -116,7 +116,7 @@ g_type_info_get_tag (GITypeInfo *info) } /** - * g_type_info_get_param_type: + * gi_type_info_get_param_type: * @info: a #GITypeInfo * @n: index of the parameter * @@ -125,8 +125,8 @@ g_type_info_get_tag (GITypeInfo *info) * Returns: (transfer full): the param type info */ GITypeInfo * -g_type_info_get_param_type (GITypeInfo *info, - gint n) +gi_type_info_get_param_type (GITypeInfo *info, + gint n) { GIRealInfo *rinfo = (GIRealInfo *)info; SimpleTypeBlob *type; @@ -146,9 +146,9 @@ g_type_info_get_param_type (GITypeInfo *info, case GI_TYPE_TAG_GLIST: case GI_TYPE_TAG_GSLIST: case GI_TYPE_TAG_GHASH: - return _g_type_info_new ((GIBaseInfo*)info, rinfo->typelib, - rinfo->offset + sizeof (ParamTypeBlob) - + sizeof (SimpleTypeBlob) * n); + return _gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, + rinfo->offset + sizeof (ParamTypeBlob) + + sizeof (SimpleTypeBlob) * n); break; default: break; @@ -159,19 +159,19 @@ g_type_info_get_param_type (GITypeInfo *info, } /** - * g_type_info_get_interface: + * gi_type_info_get_interface: * @info: a #GITypeInfo * * For types which have #GI_TYPE_TAG_INTERFACE such as GObjects and boxed values, * this function returns full information about the referenced type. You can then * inspect the type of the returned #GIBaseInfo to further query whether it is - * a concrete GObject, a GInterface, a structure, etc. using g_base_info_get_type(). + * a concrete GObject, a GInterface, a structure, etc. using gi_base_info_get_type(). * * Returns: (transfer full): the #GIBaseInfo, or %NULL. Free it with - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GIBaseInfo * -g_type_info_get_interface (GITypeInfo *info) +gi_type_info_get_interface (GITypeInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; @@ -196,8 +196,8 @@ g_type_info_get_interface (GITypeInfo *info) g_assert_not_reached (); return NULL; } - return (GIBaseInfo *) g_info_new (info_type, (GIBaseInfo*)info, rinfo->typelib, - rinfo->offset); + return (GIBaseInfo *) gi_info_new (info_type, (GIBaseInfo*)info, rinfo->typelib, + rinfo->offset); } else { @@ -207,7 +207,7 @@ g_type_info_get_interface (GITypeInfo *info) InterfaceTypeBlob *blob = (InterfaceTypeBlob *)&rinfo->typelib->data[rinfo->offset]; if (blob->tag == GI_TYPE_TAG_INTERFACE) - return _g_info_from_entry (rinfo->repository, rinfo->typelib, blob->interface); + return _gi_info_from_entry (rinfo->repository, rinfo->typelib, blob->interface); } } @@ -215,7 +215,7 @@ g_type_info_get_interface (GITypeInfo *info) } /** - * g_type_info_get_array_length: + * gi_type_info_get_array_length: * @info: a #GITypeInfo * * Obtain the position of the argument which gives the array length of the type. @@ -224,7 +224,7 @@ g_type_info_get_interface (GITypeInfo *info) * Returns: the array length, or -1 if the type is not an array */ gint -g_type_info_get_array_length (GITypeInfo *info) +gi_type_info_get_array_length (GITypeInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; SimpleTypeBlob *type; @@ -249,7 +249,7 @@ g_type_info_get_array_length (GITypeInfo *info) } /** - * g_type_info_get_array_fixed_size: + * gi_type_info_get_array_fixed_size: * @info: a #GITypeInfo * * Obtain the fixed array size of the type. The type tag must be a @@ -258,7 +258,7 @@ g_type_info_get_array_length (GITypeInfo *info) * Returns: the size or -1 if it's not an array */ gint -g_type_info_get_array_fixed_size (GITypeInfo *info) +gi_type_info_get_array_fixed_size (GITypeInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; SimpleTypeBlob *type; @@ -283,7 +283,7 @@ g_type_info_get_array_fixed_size (GITypeInfo *info) } /** - * g_type_info_is_zero_terminated: + * gi_type_info_is_zero_terminated: * @info: a #GITypeInfo * * Obtain if the last element of the array is %NULL. The type tag must be a @@ -292,7 +292,7 @@ g_type_info_get_array_fixed_size (GITypeInfo *info) * Returns: %TRUE if zero terminated */ gboolean -g_type_info_is_zero_terminated (GITypeInfo *info) +gi_type_info_is_zero_terminated (GITypeInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; SimpleTypeBlob *type; @@ -314,7 +314,7 @@ g_type_info_is_zero_terminated (GITypeInfo *info) } /** - * g_type_info_get_array_type: + * gi_type_info_get_array_type: * @info: a #GITypeInfo * * Obtain the array type for this type. See #GIArrayType for a list of @@ -324,7 +324,7 @@ g_type_info_is_zero_terminated (GITypeInfo *info) * Returns: the array type or -1 */ GIArrayType -g_type_info_get_array_type (GITypeInfo *info) +gi_type_info_get_array_type (GITypeInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; SimpleTypeBlob *type; @@ -346,7 +346,7 @@ g_type_info_get_array_type (GITypeInfo *info) } /** - * g_type_info_get_storage_type: + * gi_type_info_get_storage_type: * @info: a #GITypeInfo * * Obtain the type tag corresponding to the underlying storage type in C for @@ -358,17 +358,17 @@ g_type_info_get_array_type (GITypeInfo *info) * Since: 1.66 */ GITypeTag -g_type_info_get_storage_type (GITypeInfo *info) +gi_type_info_get_storage_type (GITypeInfo *info) { - GITypeTag type_tag = g_type_info_get_tag (info); + GITypeTag type_tag = gi_type_info_get_tag (info); if (type_tag == GI_TYPE_TAG_INTERFACE) { - GIBaseInfo *interface = g_type_info_get_interface (info); - GIInfoType info_type = g_base_info_get_type (interface); + GIBaseInfo *interface = gi_type_info_get_interface (info); + GIInfoType info_type = gi_base_info_get_type (interface); if (info_type == GI_INFO_TYPE_ENUM || info_type == GI_INFO_TYPE_FLAGS) - type_tag = g_enum_info_get_storage_type (interface); - g_base_info_unref (interface); + type_tag = gi_enum_info_get_storage_type (interface); + gi_base_info_unref (interface); } return type_tag; @@ -376,7 +376,7 @@ g_type_info_get_storage_type (GITypeInfo *info) /** * gi_type_tag_argument_from_hash_pointer: - * @storage_type: a #GITypeTag obtained from g_type_info_get_storage_type() + * @storage_type: a #GITypeTag obtained from gi_type_info_get_storage_type() * @hash_pointer: A pointer, such as a #GHashTable data pointer * @arg: A #GIArgument to fill in * @@ -442,13 +442,13 @@ gi_type_tag_argument_from_hash_pointer (GITypeTag storage_type, case GI_TYPE_TAG_DOUBLE: default: g_critical ("Unsupported storage type for pointer-stuffing: %s", - g_type_tag_to_string (storage_type)); + gi_type_tag_to_string (storage_type)); arg->v_pointer = hash_pointer; } } /** - * g_type_info_argument_from_hash_pointer: + * gi_type_info_argument_from_hash_pointer: * @info: a #GITypeInfo * @hash_pointer: A pointer, such as a #GHashTable data pointer * @arg: A #GIArgument to fill in @@ -468,18 +468,18 @@ gi_type_tag_argument_from_hash_pointer (GITypeTag storage_type, * Since: 1.66 */ void -g_type_info_argument_from_hash_pointer (GITypeInfo *info, - gpointer hash_pointer, - GIArgument *arg) +gi_type_info_argument_from_hash_pointer (GITypeInfo *info, + gpointer hash_pointer, + GIArgument *arg) { - GITypeTag storage_type = g_type_info_get_storage_type (info); + GITypeTag storage_type = gi_type_info_get_storage_type (info); gi_type_tag_argument_from_hash_pointer (storage_type, hash_pointer, arg); } /** * gi_type_tag_hash_pointer_from_argument: - * @storage_type: a #GITypeTag obtained from g_type_info_get_storage_type() + * @storage_type: a #GITypeTag obtained from gi_get_storage_type() * @arg: A #GIArgument with the value to stuff into a pointer * * GLib data structures, such as #GList, #GSList, and #GHashTable, all store @@ -536,13 +536,13 @@ gi_type_tag_hash_pointer_from_argument (GITypeTag storage_type, case GI_TYPE_TAG_DOUBLE: default: g_critical ("Unsupported storage type for pointer-stuffing: %s", - g_type_tag_to_string (storage_type)); + gi_type_tag_to_string (storage_type)); return arg->v_pointer; } } /** - * g_type_info_hash_pointer_from_argument: + * gi_type_info_hash_pointer_from_argument: * @info: a #GITypeInfo * @arg: A #GIArgument with the value to stuff into a pointer * @@ -563,9 +563,9 @@ gi_type_tag_hash_pointer_from_argument (GITypeTag storage_type, * Since: 1.66 */ gpointer -g_type_info_hash_pointer_from_argument (GITypeInfo *info, - GIArgument *arg) +gi_type_info_hash_pointer_from_argument (GITypeInfo *info, + GIArgument *arg) { - GITypeTag storage_type = g_type_info_get_storage_type (info); + GITypeTag storage_type = gi_type_info_get_storage_type (info); return gi_type_tag_hash_pointer_from_argument (storage_type, arg); } diff --git a/girepository/gitypeinfo.h b/girepository/gitypeinfo.h index 1f884d97f..f2de6c23f 100644 --- a/girepository/gitypeinfo.h +++ b/girepository/gitypeinfo.h @@ -39,7 +39,7 @@ G_BEGIN_DECLS * Checks if @info is a #GITypeInfo. */ #define GI_IS_TYPE_INFO(info) \ - (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_TYPE) + (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_TYPE) /** * GI_TYPE_TAG_IS_BASIC @@ -86,7 +86,7 @@ G_BEGIN_DECLS * @tag: a type tag * * Checks if @tag is a container type. That is, a type which may have a nonnull - * return from g_type_info_get_param_type(). + * return from gi_type_info_get_param_type(). * * Since: 1.72 */ @@ -94,48 +94,48 @@ G_BEGIN_DECLS ((tag) >= GI_TYPE_TAG_GLIST && (tag) <= GI_TYPE_TAG_GHASH)) GI_AVAILABLE_IN_ALL -const gchar* g_type_tag_to_string (GITypeTag type); +const gchar* gi_type_tag_to_string (GITypeTag type); GI_AVAILABLE_IN_ALL -const gchar* g_info_type_to_string (GIInfoType type); +const gchar* gi_info_type_to_string (GIInfoType type); GI_AVAILABLE_IN_ALL -gboolean g_type_info_is_pointer (GITypeInfo *info); +gboolean gi_type_info_is_pointer (GITypeInfo *info); GI_AVAILABLE_IN_ALL -GITypeTag g_type_info_get_tag (GITypeInfo *info); +GITypeTag gi_type_info_get_tag (GITypeInfo *info); GI_AVAILABLE_IN_ALL -GITypeInfo * g_type_info_get_param_type (GITypeInfo *info, - gint n); +GITypeInfo * gi_type_info_get_param_type (GITypeInfo *info, + gint n); GI_AVAILABLE_IN_ALL -GIBaseInfo * g_type_info_get_interface (GITypeInfo *info); +GIBaseInfo * gi_type_info_get_interface (GITypeInfo *info); GI_AVAILABLE_IN_ALL -gint g_type_info_get_array_length (GITypeInfo *info); +gint gi_type_info_get_array_length (GITypeInfo *info); GI_AVAILABLE_IN_ALL -gint g_type_info_get_array_fixed_size(GITypeInfo *info); +gint gi_type_info_get_array_fixed_size(GITypeInfo *info); GI_AVAILABLE_IN_ALL -gboolean g_type_info_is_zero_terminated (GITypeInfo *info); +gboolean gi_type_info_is_zero_terminated (GITypeInfo *info); GI_AVAILABLE_IN_ALL -GIArrayType g_type_info_get_array_type (GITypeInfo *info); +GIArrayType gi_type_info_get_array_type (GITypeInfo *info); GI_AVAILABLE_IN_ALL -GITypeTag g_type_info_get_storage_type (GITypeInfo *info); +GITypeTag gi_type_info_get_storage_type (GITypeInfo *info); GI_AVAILABLE_IN_ALL -void g_type_info_argument_from_hash_pointer (GITypeInfo *info, - gpointer hash_pointer, - GIArgument *arg); +void gi_type_info_argument_from_hash_pointer (GITypeInfo *info, + gpointer hash_pointer, + GIArgument *arg); GI_AVAILABLE_IN_ALL -gpointer g_type_info_hash_pointer_from_argument (GITypeInfo *info, - GIArgument *arg); +gpointer gi_type_info_hash_pointer_from_argument (GITypeInfo *info, + GIArgument *arg); GI_AVAILABLE_IN_ALL void gi_type_tag_argument_from_hash_pointer (GITypeTag storage_type, diff --git a/girepository/gitypelib-internal.h b/girepository/gitypelib-internal.h index 244e7d996..3e9016c83 100644 --- a/girepository/gitypelib-internal.h +++ b/girepository/gitypelib-internal.h @@ -146,15 +146,15 @@ Changes since 0.1: */ /** - * G_IR_MAGIC: + * GI_IR_MAGIC: * * Identifying prefix for the typelib. This was inspired by XPCOM, * which in turn borrowed from PNG. */ -#define G_IR_MAGIC "GOBJ\nMETADATA\r\n\032" +#define GI_IR_MAGIC "GOBJ\nMETADATA\r\n\032" /** - * GTypelibBlobType: + * GITypelibBlobType: * @BLOB_TYPE_INVALID: Should not appear in code * @BLOB_TYPE_FUNCTION: A #FunctionBlob * @BLOB_TYPE_CALLBACK: A #CallbackBlob @@ -184,14 +184,14 @@ typedef enum { BLOB_TYPE_CONSTANT, BLOB_TYPE_INVALID_0, BLOB_TYPE_UNION -} GTypelibBlobType; +} GITypelibBlobType; #if defined (G_CAN_INLINE) && defined (G_ALWAYS_INLINE) G_ALWAYS_INLINE inline gboolean -_blob_is_registered_type (GTypelibBlobType blob_type) +_blob_is_registered_type (GITypelibBlobType blob_type) { switch (blob_type) { @@ -208,7 +208,7 @@ _blob_is_registered_type (GTypelibBlobType blob_type) } #define BLOB_IS_REGISTERED_TYPE(blob) \ - _blob_is_registered_type ((GTypelibBlobType) (blob)->blob_type) + _blob_is_registered_type ((GITypelibBlobType) (blob)->blob_type) #else @@ -224,7 +224,7 @@ _blob_is_registered_type (GTypelibBlobType blob_type) /** * Header: - * @magic: See #G_IR_MAGIC. + * @magic: See #GI_IR_MAGIC. * @major_version: The major version number of the typelib format. Major version * number changes indicate incompatible changes to the tyeplib format. * @minor_version: The minor version number of the typelib format. Minor version @@ -351,7 +351,7 @@ typedef struct { /** * DirEntry: - * @blob_type: A #GTypelibBlobType + * @blob_type: A #GITypelibBlobType * @local: Whether this entry refers to a blob in this typelib. * @reserved: Reserved for future use. * @name: The name of the entry. @@ -530,7 +530,7 @@ typedef struct { /** * CommonBlob: - * @blob_type: A #GTypelibBlobType + * @blob_type: A #GITypelibBlobType * @deprecated: Whether the blob is deprecated. * @reserved: Reserved for future use. * @name: The name of the blob. @@ -1256,27 +1256,27 @@ struct _GITypelib { gboolean open_attempted; }; -DirEntry *g_typelib_get_dir_entry (GITypelib *typelib, - guint16 index); +DirEntry *gi_typelib_get_dir_entry (GITypelib *typelib, + guint16 index); -DirEntry *g_typelib_get_dir_entry_by_name (GITypelib *typelib, - const char *name); +DirEntry *gi_typelib_get_dir_entry_by_name (GITypelib *typelib, + const char *name); -DirEntry *g_typelib_get_dir_entry_by_gtype_name (GITypelib *typelib, - const gchar *gtype_name); +DirEntry *gi_typelib_get_dir_entry_by_gtype_name (GITypelib *typelib, + const gchar *gtype_name); -DirEntry *g_typelib_get_dir_entry_by_error_domain (GITypelib *typelib, - GQuark error_domain); +DirEntry *gi_typelib_get_dir_entry_by_error_domain (GITypelib *typelib, + GQuark error_domain); -gboolean g_typelib_matches_gtype_name_prefix (GITypelib *typelib, - const gchar *gtype_name); +gboolean gi_typelib_matches_gtype_name_prefix (GITypelib *typelib, + const gchar *gtype_name); GI_AVAILABLE_IN_ALL -void g_typelib_check_sanity (void); +void gi_typelib_check_sanity (void); /** - * g_typelib_get_string: + * gi_typelib_get_string: * @typelib: TODO * @offset: TODO * @@ -1284,41 +1284,41 @@ void g_typelib_check_sanity (void); * * Returns: TODO */ -#define g_typelib_get_string(typelib,offset) ((const gchar*)&(typelib->data)[(offset)]) +#define gi_typelib_get_string(typelib,offset) ((const gchar*)&(typelib->data)[(offset)]) /** * GITypelibError: - * @G_TYPELIB_ERROR_INVALID: the typelib is invalid - * @G_TYPELIB_ERROR_INVALID_HEADER: the typelib header is invalid - * @G_TYPELIB_ERROR_INVALID_DIRECTORY: the typelib directory is invalid - * @G_TYPELIB_ERROR_INVALID_ENTRY: a typelib entry is invalid - * @G_TYPELIB_ERROR_INVALID_BLOB: a typelib blob is invalid + * @GI_TYPELIB_ERROR_INVALID: the typelib is invalid + * @GI_TYPELIB_ERROR_INVALID_HEADER: the typelib header is invalid + * @GI_TYPELIB_ERROR_INVALID_DIRECTORY: the typelib directory is invalid + * @GI_TYPELIB_ERROR_INVALID_ENTRY: a typelib entry is invalid + * @GI_TYPELIB_ERROR_INVALID_BLOB: a typelib blob is invalid * * A error set while validating the #GITypelib */ typedef enum { - G_TYPELIB_ERROR_INVALID, - G_TYPELIB_ERROR_INVALID_HEADER, - G_TYPELIB_ERROR_INVALID_DIRECTORY, - G_TYPELIB_ERROR_INVALID_ENTRY, - G_TYPELIB_ERROR_INVALID_BLOB + GI_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR_INVALID_HEADER, + GI_TYPELIB_ERROR_INVALID_DIRECTORY, + GI_TYPELIB_ERROR_INVALID_ENTRY, + GI_TYPELIB_ERROR_INVALID_BLOB } GITypelibError; /** - * G_TYPELIB_ERROR: + * GI_TYPELIB_ERROR: * * TODO */ -#define G_TYPELIB_ERROR (g_typelib_error_quark ()) +#define GI_TYPELIB_ERROR (gi_typelib_error_quark ()) -GQuark g_typelib_error_quark (void); +GQuark gi_typelib_error_quark (void); GI_AVAILABLE_IN_ALL -gboolean g_typelib_validate (GITypelib *typelib, - GError **error); +gboolean gi_typelib_validate (GITypelib *typelib, + GError **error); /* defined in gibaseinfo.c */ diff --git a/girepository/gitypelib.c b/girepository/gitypelib.c index 315b2cfb9..4ddad0801 100644 --- a/girepository/gitypelib.c +++ b/girepository/gitypelib.c @@ -70,8 +70,8 @@ get_dir_entry_checked (GITypelib *typelib, if (index == 0 || index > header->n_entries) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Invalid directory index %d", index); return FALSE; } @@ -81,8 +81,8 @@ get_dir_entry_checked (GITypelib *typelib, if (typelib->len < offset + sizeof (DirEntry)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "The buffer is too short"); return FALSE; } @@ -99,8 +99,8 @@ get_blob (GITypelib *typelib, if (typelib->len < offset + sizeof (CommonBlob)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "The buffer is too short"); return FALSE; } @@ -115,8 +115,8 @@ get_type_blob (GITypelib *typelib, if (simple->offset == 0) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "Expected blob for type"); return FALSE; } @@ -124,8 +124,8 @@ get_type_blob (GITypelib *typelib, if (simple->flags.reserved == 0 && simple->flags.reserved2 == 0) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "Expected non-basic type but got %d", simple->flags.tag); return FALSE; @@ -135,7 +135,7 @@ get_type_blob (GITypelib *typelib, } /** - * g_typelib_get_dir_entry: + * gi_typelib_get_dir_entry: * @typelib: TODO * @index: TODO * @@ -144,8 +144,8 @@ get_type_blob (GITypelib *typelib, * Returns: TODO */ DirEntry * -g_typelib_get_dir_entry (GITypelib *typelib, - guint16 index) +gi_typelib_get_dir_entry (GITypelib *typelib, + guint16 index) { Header *header = (Header *)typelib->data; @@ -173,7 +173,7 @@ get_section_by_id (GITypelib *typelib, } /** - * g_typelib_get_dir_entry_by_name: + * gi_typelib_get_dir_entry_by_name: * @typelib: TODO * @name: TODO * @@ -182,8 +182,8 @@ get_section_by_id (GITypelib *typelib, * Returns: TODO */ DirEntry * -g_typelib_get_dir_entry_by_name (GITypelib *typelib, - const char *name) +gi_typelib_get_dir_entry_by_name (GITypelib *typelib, + const char *name) { Section *dirindex; gint i, n_entries; @@ -197,8 +197,8 @@ g_typelib_get_dir_entry_by_name (GITypelib *typelib, { for (i = 1; i <= n_entries; i++) { - entry = g_typelib_get_dir_entry (typelib, i); - entry_name = g_typelib_get_string (typelib, entry->name); + entry = gi_typelib_get_dir_entry (typelib, i); + entry_name = gi_typelib_get_string (typelib, entry->name); if (strcmp (name, entry_name) == 0) return entry; } @@ -210,8 +210,8 @@ g_typelib_get_dir_entry_by_name (GITypelib *typelib, guint16 index; index = _gi_typelib_hash_search (hash, name, n_entries); - entry = g_typelib_get_dir_entry (typelib, index + 1); - entry_name = g_typelib_get_string (typelib, entry->name); + entry = gi_typelib_get_dir_entry (typelib, index + 1); + entry_name = gi_typelib_get_string (typelib, entry->name); if (strcmp (name, entry_name) == 0) return entry; return NULL; @@ -219,7 +219,7 @@ g_typelib_get_dir_entry_by_name (GITypelib *typelib, } /** - * g_typelib_get_dir_entry_by_gtype_name: + * gi_typelib_get_dir_entry_by_gtype_name: * @typelib: TODO * @gtype_name: TODO * @@ -228,8 +228,8 @@ g_typelib_get_dir_entry_by_name (GITypelib *typelib, * Returns: TODO */ DirEntry * -g_typelib_get_dir_entry_by_gtype_name (GITypelib *typelib, - const gchar *gtype_name) +gi_typelib_get_dir_entry_by_gtype_name (GITypelib *typelib, + const gchar *gtype_name) { Header *header = (Header *)typelib->data; guint i; @@ -238,7 +238,7 @@ g_typelib_get_dir_entry_by_gtype_name (GITypelib *typelib, { RegisteredTypeBlob *blob; const char *type; - DirEntry *entry = g_typelib_get_dir_entry (typelib, i); + DirEntry *entry = gi_typelib_get_dir_entry (typelib, i); if (!BLOB_IS_REGISTERED_TYPE (entry)) continue; @@ -246,7 +246,7 @@ g_typelib_get_dir_entry_by_gtype_name (GITypelib *typelib, if (!blob->gtype_name) continue; - type = g_typelib_get_string (typelib, blob->gtype_name); + type = gi_typelib_get_string (typelib, blob->gtype_name); if (strcmp (type, gtype_name) == 0) return entry; } @@ -313,7 +313,7 @@ strsplit_iter_clear (StrSplitIter *iter) } /** - * g_typelib_matches_gtype_name_prefix: + * gi_typelib_matches_gtype_name_prefix: * @typelib: TODO * @gtype_name: TODO * @@ -322,8 +322,8 @@ strsplit_iter_clear (StrSplitIter *iter) * Returns: TODO */ gboolean -g_typelib_matches_gtype_name_prefix (GITypelib *typelib, - const gchar *gtype_name) +gi_typelib_matches_gtype_name_prefix (GITypelib *typelib, + const gchar *gtype_name) { Header *header = (Header *)typelib->data; const char *c_prefix; @@ -332,7 +332,7 @@ g_typelib_matches_gtype_name_prefix (GITypelib *typelib, StrSplitIter split_iter; gsize gtype_name_len; - c_prefix = g_typelib_get_string (typelib, header->c_prefix); + c_prefix = gi_typelib_get_string (typelib, header->c_prefix); if (c_prefix == NULL || strlen (c_prefix) == 0) return FALSE; @@ -367,7 +367,7 @@ g_typelib_matches_gtype_name_prefix (GITypelib *typelib, } /** - * g_typelib_get_dir_entry_by_error_domain: + * gi_typelib_get_dir_entry_by_error_domain: * @typelib: TODO * @error_domain: TODO * @@ -376,8 +376,8 @@ g_typelib_matches_gtype_name_prefix (GITypelib *typelib, * Returns: TODO */ DirEntry * -g_typelib_get_dir_entry_by_error_domain (GITypelib *typelib, - GQuark error_domain) +gi_typelib_get_dir_entry_by_error_domain (GITypelib *typelib, + GQuark error_domain) { Header *header = (Header *)typelib->data; guint n_entries = header->n_local_entries; @@ -390,7 +390,7 @@ g_typelib_get_dir_entry_by_error_domain (GITypelib *typelib, EnumBlob *blob; const char *enum_domain_string; - entry = g_typelib_get_dir_entry (typelib, i); + entry = gi_typelib_get_dir_entry (typelib, i); if (entry->blob_type != BLOB_TYPE_ENUM) continue; @@ -398,7 +398,7 @@ g_typelib_get_dir_entry_by_error_domain (GITypelib *typelib, if (!blob->error_domain) continue; - enum_domain_string = g_typelib_get_string (typelib, blob->error_domain); + enum_domain_string = gi_typelib_get_string (typelib, blob->error_domain); if (strcmp (domain_string, enum_domain_string) == 0) return entry; } @@ -406,12 +406,12 @@ g_typelib_get_dir_entry_by_error_domain (GITypelib *typelib, } /** - * g_typelib_check_sanity: + * gi_typelib_check_sanity: * * TODO */ void -g_typelib_check_sanity (void) +gi_typelib_check_sanity (void) { /* Check that struct layout is as we expect */ @@ -478,8 +478,8 @@ get_string (GITypelib *typelib, guint32 offset, GError **error) if (typelib->len < offset) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "Buffer is too short while looking up name"); return NULL; } @@ -510,8 +510,8 @@ validate_name (GITypelib *typelib, if (!memchr (name, '\0', MAX_NAME_LEN)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "The %s is too long: %s", msg, name); return FALSE; @@ -520,8 +520,8 @@ validate_name (GITypelib *typelib, if (strspn (name, G_CSET_a_2_z G_CSET_A_2_Z G_CSET_DIGITS "-_") < strlen (name)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "The %s contains invalid characters: '%s'", msg, name); return FALSE; @@ -541,18 +541,18 @@ validate_header_basic (const guint8 *memory, if (len < sizeof (Header)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "The specified typelib length %" G_GSIZE_FORMAT " is too short", len); return FALSE; } - if (strncmp (header->magic, G_IR_MAGIC, 16) != 0) + if (strncmp (header->magic, GI_IR_MAGIC, 16) != 0) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_HEADER, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_HEADER, "Invalid magic header"); return FALSE; @@ -561,8 +561,8 @@ validate_header_basic (const guint8 *memory, if (header->major_version != 4) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_HEADER, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_HEADER, "Typelib version mismatch; expected 4, found %d", header->major_version); return FALSE; @@ -572,8 +572,8 @@ validate_header_basic (const guint8 *memory, if (header->n_entries < header->n_local_entries) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_HEADER, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_HEADER, "Inconsistent entry counts"); return FALSE; } @@ -581,8 +581,8 @@ validate_header_basic (const guint8 *memory, if (header->size != len) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_HEADER, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_HEADER, "Typelib size %" G_GSIZE_FORMAT " does not match %" G_GSIZE_FORMAT, (gsize) header->size, len); return FALSE; @@ -591,7 +591,7 @@ validate_header_basic (const guint8 *memory, /* This is a sanity check for a specific typelib; it * prevents us from loading an incompatible typelib. * - * The hardcoded checks in g_typelib_check_sanity to + * The hardcoded checks in gi_typelib_check_sanity to * protect against inadvertent or buggy changes to the typelib format * itself. */ @@ -615,8 +615,8 @@ validate_header_basic (const guint8 *memory, header->union_blob_size != sizeof (UnionBlob)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_HEADER, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_HEADER, "Blob size mismatch"); return FALSE; } @@ -624,8 +624,8 @@ validate_header_basic (const guint8 *memory, if (!is_aligned (header->directory)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_HEADER, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_HEADER, "Misaligned directory"); return FALSE; } @@ -633,8 +633,8 @@ validate_header_basic (const guint8 *memory, if (!is_aligned (header->attributes)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_HEADER, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_HEADER, "Misaligned attributes"); return FALSE; } @@ -642,8 +642,8 @@ validate_header_basic (const guint8 *memory, if (header->attributes == 0 && header->n_attributes > 0) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_HEADER, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_HEADER, "Wrong number of attributes"); return FALSE; } @@ -730,8 +730,8 @@ validate_param_type_blob (GITypelib *typelib, if (!blob->pointer) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Pointer type exected for tag %d", blob->tag); return FALSE; } @@ -739,8 +739,8 @@ validate_param_type_blob (GITypelib *typelib, if (blob->n_types != n_params) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Parameter type number mismatch"); return FALSE; } @@ -771,8 +771,8 @@ validate_error_type_blob (GITypelib *typelib, if (!blob->pointer) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Pointer type exected for tag %d", blob->tag); return FALSE; } @@ -798,8 +798,8 @@ validate_type_blob (GITypelib *typelib, if (!GI_TYPE_TAG_IS_BASIC(simple->flags.tag)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Invalid non-basic tag %d in simple type", simple->flags.tag); return FALSE; } @@ -809,8 +809,8 @@ validate_type_blob (GITypelib *typelib, !simple->flags.pointer) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Pointer type exected for tag %d", simple->flags.tag); return FALSE; } @@ -850,8 +850,8 @@ validate_type_blob (GITypelib *typelib, break; default: g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Wrong tag in complex type"); return FALSE; } @@ -870,8 +870,8 @@ validate_arg_blob (GITypelib *typelib, if (typelib->len < offset + sizeof (ArgBlob)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "The buffer is too short"); return FALSE; } @@ -898,8 +898,8 @@ return_type_from_signature (GITypelib *typelib, if (typelib->len < offset + sizeof (SignatureBlob)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "The buffer is too short"); return NULL; } @@ -908,8 +908,8 @@ return_type_from_signature (GITypelib *typelib, if (blob->return_type.offset == 0) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "No return type found in signature"); return NULL; } @@ -928,8 +928,8 @@ validate_signature_blob (GITypelib *typelib, if (typelib->len < offset + sizeof (SignatureBlob)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "The buffer is too short"); return FALSE; } @@ -971,8 +971,8 @@ validate_function_blob (ValidateContext *ctx, if (typelib->len < offset + sizeof (FunctionBlob)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "The buffer is too short"); return FALSE; } @@ -982,8 +982,8 @@ validate_function_blob (ValidateContext *ctx, if (blob->blob_type != BLOB_TYPE_FUNCTION) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Wrong blob type %d, expected function", blob->blob_type); return FALSE; } @@ -1008,8 +1008,8 @@ validate_function_blob (ValidateContext *ctx, break; default: g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Constructor not allowed"); return FALSE; } @@ -1024,8 +1024,8 @@ validate_function_blob (ValidateContext *ctx, break; default: g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Setter, getter or wrapper not allowed"); return FALSE; } @@ -1036,8 +1036,8 @@ validate_function_blob (ValidateContext *ctx, if (!(blob->setter || blob->getter || blob->wraps_vfunc)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Must be setter, getter or wrapper"); return FALSE; } @@ -1065,10 +1065,10 @@ validate_function_blob (ValidateContext *ctx, container_type == BLOB_TYPE_INTERFACE)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "Invalid return type '%s' for constructor '%s'", - g_type_tag_to_string (iface_type->tag), + gi_type_tag_to_string (iface_type->tag), get_string_nofail (typelib, blob->symbol)); return FALSE; } @@ -1090,8 +1090,8 @@ validate_callback_blob (ValidateContext *ctx, if (typelib->len < offset + sizeof (CallbackBlob)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "The buffer is too short"); return FALSE; } @@ -1101,8 +1101,8 @@ validate_callback_blob (ValidateContext *ctx, if (blob->blob_type != BLOB_TYPE_CALLBACK) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Wrong blob type"); return FALSE; } @@ -1157,8 +1157,8 @@ validate_constant_blob (GITypelib *typelib, if (typelib->len < offset + sizeof (ConstantBlob)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "The buffer is too short"); return FALSE; } @@ -1168,8 +1168,8 @@ validate_constant_blob (GITypelib *typelib, if (blob->blob_type != BLOB_TYPE_CONSTANT) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Wrong blob type"); return FALSE; } @@ -1184,8 +1184,8 @@ validate_constant_blob (GITypelib *typelib, if (!is_aligned (blob->offset)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Misaligned constant value"); return FALSE; } @@ -1196,8 +1196,8 @@ validate_constant_blob (GITypelib *typelib, if (type->flags.tag == 0) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Constant value type void"); return FALSE; } @@ -1206,8 +1206,8 @@ validate_constant_blob (GITypelib *typelib, blob->size != value_size[type->flags.tag]) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Constant value size mismatch"); return FALSE; } @@ -1227,8 +1227,8 @@ validate_value_blob (GITypelib *typelib, if (typelib->len < offset + sizeof (ValueBlob)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "The buffer is too short"); return FALSE; } @@ -1253,8 +1253,8 @@ validate_field_blob (ValidateContext *ctx, if (typelib->len < offset + sizeof (FieldBlob)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "The buffer is too short"); return FALSE; } @@ -1287,8 +1287,8 @@ validate_property_blob (GITypelib *typelib, if (typelib->len < offset + sizeof (PropertyBlob)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "The buffer is too short"); return FALSE; } @@ -1318,8 +1318,8 @@ validate_signal_blob (GITypelib *typelib, if (typelib->len < offset + sizeof (SignalBlob)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "The buffer is too short"); return FALSE; } @@ -1334,8 +1334,8 @@ validate_signal_blob (GITypelib *typelib, (blob->run_cleanup != 0) != 1) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Invalid signal run flags"); return FALSE; } @@ -1362,8 +1362,8 @@ validate_signal_blob (GITypelib *typelib, if (blob->class_closure >= n_signals) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Invalid class closure index"); return FALSE; } @@ -1387,8 +1387,8 @@ validate_vfunc_blob (GITypelib *typelib, if (typelib->len < offset + sizeof (VFuncBlob)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "The buffer is too short"); return FALSE; } @@ -1420,8 +1420,8 @@ validate_vfunc_blob (GITypelib *typelib, if (blob->class_closure >= n_vfuncs) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Invalid class closure index"); return FALSE; } @@ -1447,8 +1447,8 @@ validate_struct_blob (ValidateContext *ctx, if (typelib->len < offset + sizeof (StructBlob)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "The buffer is too short"); return FALSE; } @@ -1458,8 +1458,8 @@ validate_struct_blob (ValidateContext *ctx, if (blob->blob_type != blob_type) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Wrong blob type"); return FALSE; } @@ -1482,8 +1482,8 @@ validate_struct_blob (ValidateContext *ctx, if (blob->gtype_name || blob->gtype_init) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Gtype data in struct"); return FALSE; } @@ -1494,8 +1494,8 @@ validate_struct_blob (ValidateContext *ctx, blob->n_methods * sizeof (FunctionBlob)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "The buffer is too short"); return FALSE; } @@ -1544,8 +1544,8 @@ validate_enum_blob (ValidateContext *ctx, if (typelib->len < offset + sizeof (EnumBlob)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "The buffer is too short"); return FALSE; } @@ -1555,8 +1555,8 @@ validate_enum_blob (ValidateContext *ctx, if (blob->blob_type != blob_type) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Wrong blob type"); return FALSE; } @@ -1574,8 +1574,8 @@ validate_enum_blob (ValidateContext *ctx, if (blob->gtype_name || blob->gtype_init) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Gtype data in unregistered enum"); return FALSE; } @@ -1589,8 +1589,8 @@ validate_enum_blob (ValidateContext *ctx, blob->n_methods * sizeof (FunctionBlob)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "The buffer is too short"); return FALSE; } @@ -1618,8 +1618,8 @@ validate_enum_blob (ValidateContext *ctx, /* FIXME should this be an error ? */ g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Duplicate enum value"); return FALSE; } @@ -1655,8 +1655,8 @@ validate_object_blob (ValidateContext *ctx, if (typelib->len < offset + sizeof (ObjectBlob)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "The buffer is too short"); return FALSE; } @@ -1666,8 +1666,8 @@ validate_object_blob (ValidateContext *ctx, if (blob->blob_type != BLOB_TYPE_OBJECT) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Wrong blob type"); return FALSE; } @@ -1684,8 +1684,8 @@ validate_object_blob (ValidateContext *ctx, if (blob->parent > header->n_entries) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Invalid parent index"); return FALSE; } @@ -1701,8 +1701,8 @@ validate_object_blob (ValidateContext *ctx, (entry->local || entry->blob_type != 0)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Parent not object"); return FALSE; } @@ -1718,8 +1718,8 @@ validate_object_blob (ValidateContext *ctx, if (entry->blob_type != BLOB_TYPE_STRUCT && entry->local) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Class struct invalid type or not local"); return FALSE; } @@ -1736,8 +1736,8 @@ validate_object_blob (ValidateContext *ctx, { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "The buffer is too short"); return FALSE; } @@ -1753,8 +1753,8 @@ validate_object_blob (ValidateContext *ctx, if (iface == 0 || iface > header->n_entries) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Invalid interface index"); return FALSE; } @@ -1767,8 +1767,8 @@ validate_object_blob (ValidateContext *ctx, (entry->local || entry->blob_type != 0)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Not an interface"); return FALSE; } @@ -1797,8 +1797,8 @@ validate_object_blob (ValidateContext *ctx, if (blob->n_field_callbacks != n_field_callbacks) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Incorrect number of field callbacks; expected " "%" G_GUINT16_FORMAT ", got %" G_GUINT16_FORMAT, blob->n_field_callbacks, n_field_callbacks); @@ -1856,8 +1856,8 @@ validate_interface_blob (ValidateContext *ctx, if (typelib->len < offset + sizeof (InterfaceBlob)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "The buffer is too short"); return FALSE; } @@ -1867,8 +1867,8 @@ validate_interface_blob (ValidateContext *ctx, if (blob->blob_type != BLOB_TYPE_INTERFACE) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Wrong blob type; expected interface, got %d", blob->blob_type); return FALSE; } @@ -1892,8 +1892,8 @@ validate_interface_blob (ValidateContext *ctx, { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "The buffer is too short"); return FALSE; } @@ -1909,20 +1909,20 @@ validate_interface_blob (ValidateContext *ctx, if (req == 0 || req > header->n_entries) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Invalid prerequisite index"); return FALSE; } - entry = g_typelib_get_dir_entry (typelib, req); + entry = gi_typelib_get_dir_entry (typelib, req); if (entry->blob_type != BLOB_TYPE_INTERFACE && entry->blob_type != BLOB_TYPE_OBJECT && (entry->local || entry->blob_type != 0)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_BLOB, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_BLOB, "Not an interface or object"); return FALSE; } @@ -1986,8 +1986,8 @@ validate_blob (ValidateContext *ctx, if (typelib->len < offset + sizeof (CommonBlob)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "The buffer is too short"); return FALSE; } @@ -2032,8 +2032,8 @@ validate_blob (ValidateContext *ctx, break; default: g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_ENTRY, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_ENTRY, "Invalid blob type"); return FALSE; } @@ -2053,15 +2053,15 @@ validate_directory (ValidateContext *ctx, if (typelib->len < header->directory + header->n_entries * sizeof (DirEntry)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "The buffer is too short"); return FALSE; } for (i = 0; i < header->n_entries; i++) { - entry = g_typelib_get_dir_entry (typelib, i + 1); + entry = gi_typelib_get_dir_entry (typelib, i + 1); if (!validate_name (typelib, "entry", typelib->data, entry->name, error)) return FALSE; @@ -2070,8 +2070,8 @@ validate_directory (ValidateContext *ctx, entry->blob_type > BLOB_TYPE_UNION) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_DIRECTORY, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_DIRECTORY, "Invalid entry type"); return FALSE; } @@ -2081,8 +2081,8 @@ validate_directory (ValidateContext *ctx, if (!entry->local) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_DIRECTORY, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_DIRECTORY, "Too few local directory entries"); return FALSE; } @@ -2090,8 +2090,8 @@ validate_directory (ValidateContext *ctx, if (!is_aligned (entry->offset)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_DIRECTORY, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_DIRECTORY, "Misaligned entry"); return FALSE; } @@ -2104,8 +2104,8 @@ validate_directory (ValidateContext *ctx, if (entry->local) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID_DIRECTORY, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID_DIRECTORY, "Too many local directory entries"); return FALSE; } @@ -2128,8 +2128,8 @@ validate_attributes (ValidateContext *ctx, if (header->size < header->attributes + header->n_attributes * sizeof (AttributeBlob)) { g_set_error (error, - G_TYPELIB_ERROR, - G_TYPELIB_ERROR_INVALID, + GI_TYPELIB_ERROR, + GI_TYPELIB_ERROR_INVALID, "The buffer is too short"); return FALSE; } @@ -2168,7 +2168,7 @@ prefix_with_context (GError **error, } /** - * g_typelib_validate: + * gi_typelib_validate: * @typelib: TODO * @error: TODO * @@ -2177,8 +2177,8 @@ prefix_with_context (GError **error, * Returns: TODO */ gboolean -g_typelib_validate (GITypelib *typelib, - GError **error) +gi_typelib_validate (GITypelib *typelib, + GError **error) { ValidateContext ctx; ctx.typelib = typelib; @@ -2206,25 +2206,25 @@ g_typelib_validate (GITypelib *typelib, } /** - * g_typelib_error_quark: + * gi_typelib_error_quark: * * TODO * * Returns: TODO */ GQuark -g_typelib_error_quark (void) +gi_typelib_error_quark (void) { static GQuark quark = 0; if (quark == 0) - quark = g_quark_from_static_string ("g-typelib-error-quark"); + quark = g_quark_from_static_string ("gi-typelib-error-quark"); return quark; } static GSList *library_paths; /** - * g_irepository_prepend_library_path: + * gi_repository_prepend_library_path: * @directory: (type filename): a single directory to scan for shared libraries * * Prepends @directory to the search path that is used to @@ -2243,7 +2243,7 @@ static GSList *library_paths; * Since: 1.36 */ void -g_irepository_prepend_library_path (const char *directory) +gi_repository_prepend_library_path (const char *directory) { library_paths = g_slist_prepend (library_paths, g_strdup (directory)); @@ -2298,7 +2298,7 @@ load_one_shared_library (const char *shlib) } static void -_g_typelib_do_dlopen (GITypelib *typelib) +_gi_typelib_do_dlopen (GITypelib *typelib) { Header *header; const char *shlib_str; @@ -2306,7 +2306,7 @@ _g_typelib_do_dlopen (GITypelib *typelib) header = (Header *) typelib->data; /* note that NULL shlib means to open the main app, which is allowed */ if (header->shared_library) - shlib_str = g_typelib_get_string (typelib, header->shared_library); + shlib_str = gi_typelib_get_string (typelib, header->shared_library); else shlib_str = NULL; @@ -2357,16 +2357,16 @@ _g_typelib_do_dlopen (GITypelib *typelib) } static inline void -_g_typelib_ensure_open (GITypelib *typelib) +_gi_typelib_ensure_open (GITypelib *typelib) { if (typelib->open_attempted) return; typelib->open_attempted = TRUE; - _g_typelib_do_dlopen (typelib); + _gi_typelib_do_dlopen (typelib); } /** - * g_typelib_new_from_memory: (skip) + * gi_typelib_new_from_memory: (skip) * @memory: address of memory chunk containing the typelib * @len: length of memory chunk containing the typelib * @error: a #GError @@ -2378,9 +2378,9 @@ _g_typelib_ensure_open (GITypelib *typelib) * Returns: the new #GITypelib */ GITypelib * -g_typelib_new_from_memory (guint8 *memory, - gsize len, - GError **error) +gi_typelib_new_from_memory (guint8 *memory, + gsize len, + GError **error) { GITypelib *meta; @@ -2397,7 +2397,7 @@ g_typelib_new_from_memory (guint8 *memory, } /** - * g_typelib_new_from_const_memory: (skip) + * gi_typelib_new_from_const_memory: (skip) * @memory: address of memory chunk containing the typelib * @len: length of memory chunk containing the typelib * @error: A #GError @@ -2407,9 +2407,9 @@ g_typelib_new_from_memory (guint8 *memory, * Returns: the new #GITypelib */ GITypelib * -g_typelib_new_from_const_memory (const guchar *memory, - gsize len, - GError **error) +gi_typelib_new_from_const_memory (const guchar *memory, + gsize len, + GError **error) { GITypelib *meta; @@ -2426,7 +2426,7 @@ g_typelib_new_from_const_memory (const guchar *memory, } /** - * g_typelib_new_from_mapped_file: (skip) + * gi_typelib_new_from_mapped_file: (skip) * @mfile: a #GMappedFile, that will be free'd when the repository is destroyed * @error: a #GError * @@ -2435,8 +2435,8 @@ g_typelib_new_from_const_memory (const guchar *memory, * Returns: the new #GITypelib */ GITypelib * -g_typelib_new_from_mapped_file (GMappedFile *mfile, - GError **error) +gi_typelib_new_from_mapped_file (GMappedFile *mfile, + GError **error) { GITypelib *meta; guint8 *data = (guint8 *) g_mapped_file_get_contents (mfile); @@ -2455,13 +2455,13 @@ g_typelib_new_from_mapped_file (GMappedFile *mfile, } /** - * g_typelib_free: + * gi_typelib_free: * @typelib: a #GITypelib * * Free a #GITypelib. */ void -g_typelib_free (GITypelib *typelib) +gi_typelib_free (GITypelib *typelib) { if (typelib->mfile) g_mapped_file_unref (typelib->mfile); @@ -2477,7 +2477,7 @@ g_typelib_free (GITypelib *typelib) } /** - * g_typelib_get_namespace: + * gi_typelib_get_namespace: * @typelib: TODO * * TODO @@ -2485,13 +2485,13 @@ g_typelib_free (GITypelib *typelib) * Returns: TODO */ const gchar * -g_typelib_get_namespace (GITypelib *typelib) +gi_typelib_get_namespace (GITypelib *typelib) { - return g_typelib_get_string (typelib, ((Header *) typelib->data)->namespace); + return gi_typelib_get_string (typelib, ((Header *) typelib->data)->namespace); } /** - * g_typelib_symbol: + * gi_typelib_symbol: * @typelib: the typelib * @symbol_name: name of symbol to be loaded * @symbol: returns a pointer to the symbol value @@ -2501,11 +2501,11 @@ g_typelib_get_namespace (GITypelib *typelib) * Returns: #TRUE on success */ gboolean -g_typelib_symbol (GITypelib *typelib, const char *symbol_name, gpointer *symbol) +gi_typelib_symbol (GITypelib *typelib, const char *symbol_name, gpointer *symbol) { GList *l; - _g_typelib_ensure_open (typelib); + _gi_typelib_ensure_open (typelib); /* * The reason for having multiple modules dates from gir-repository diff --git a/girepository/gitypelib.h b/girepository/gitypelib.h index 8c6c879b4..ee647ec5c 100644 --- a/girepository/gitypelib.h +++ b/girepository/gitypelib.h @@ -50,29 +50,29 @@ G_BEGIN_DECLS typedef struct _GITypelib GITypelib; GI_AVAILABLE_IN_ALL -GITypelib * g_typelib_new_from_memory (guint8 *memory, - gsize len, - GError **error); +GITypelib * gi_typelib_new_from_memory (guint8 *memory, + gsize len, + GError **error); GI_AVAILABLE_IN_ALL -GITypelib * g_typelib_new_from_const_memory (const guint8 *memory, - gsize len, - GError **error); +GITypelib * gi_typelib_new_from_const_memory (const guint8 *memory, + gsize len, + GError **error); GI_AVAILABLE_IN_ALL -GITypelib * g_typelib_new_from_mapped_file (GMappedFile *mfile, - GError **error); +GITypelib * gi_typelib_new_from_mapped_file (GMappedFile *mfile, + GError **error); GI_AVAILABLE_IN_ALL -void g_typelib_free (GITypelib *typelib); +void gi_typelib_free (GITypelib *typelib); GI_AVAILABLE_IN_ALL -gboolean g_typelib_symbol (GITypelib *typelib, - const gchar *symbol_name, - gpointer *symbol); +gboolean gi_typelib_symbol (GITypelib *typelib, + const gchar *symbol_name, + gpointer *symbol); GI_AVAILABLE_IN_ALL -const gchar * g_typelib_get_namespace (GITypelib *typelib); +const gchar * gi_typelib_get_namespace (GITypelib *typelib); G_END_DECLS diff --git a/girepository/giunioninfo.c b/girepository/giunioninfo.c index 8cd1cffa4..187b454a1 100644 --- a/girepository/giunioninfo.c +++ b/girepository/giunioninfo.c @@ -44,7 +44,7 @@ */ /** - * g_union_info_get_n_fields: + * gi_union_info_get_n_fields: * @info: a #GIUnionInfo * * Obtain the number of fields this union has. @@ -52,7 +52,7 @@ * Returns: number of fields */ gint -g_union_info_get_n_fields (GIUnionInfo *info) +gi_union_info_get_n_fields (GIUnionInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset]; @@ -61,29 +61,29 @@ g_union_info_get_n_fields (GIUnionInfo *info) } /** - * g_union_info_get_field: + * gi_union_info_get_field: * @info: a #GIUnionInfo * @n: a field index * * Obtain the type information for field with specified index. * - * Returns: (transfer full): the #GIFieldInfo, free it with g_base_info_unref() + * Returns: (transfer full): the #GIFieldInfo, free it with gi_base_info_unref() * when done. */ GIFieldInfo * -g_union_info_get_field (GIUnionInfo *info, - gint n) +gi_union_info_get_field (GIUnionInfo *info, + gint n) { GIRealInfo *rinfo = (GIRealInfo *)info; Header *header = (Header *)rinfo->typelib->data; - return (GIFieldInfo *) g_info_new (GI_INFO_TYPE_FIELD, (GIBaseInfo*)info, rinfo->typelib, - rinfo->offset + header->union_blob_size + - n * header->field_blob_size); + return (GIFieldInfo *) gi_info_new (GI_INFO_TYPE_FIELD, (GIBaseInfo*)info, rinfo->typelib, + rinfo->offset + header->union_blob_size + + n * header->field_blob_size); } /** - * g_union_info_get_n_methods: + * gi_union_info_get_n_methods: * @info: a #GIUnionInfo * * Obtain the number of methods this union has. @@ -91,7 +91,7 @@ g_union_info_get_field (GIUnionInfo *info, * Returns: number of methods */ gint -g_union_info_get_n_methods (GIUnionInfo *info) +gi_union_info_get_n_methods (GIUnionInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset]; @@ -100,18 +100,18 @@ g_union_info_get_n_methods (GIUnionInfo *info) } /** - * g_union_info_get_method: + * gi_union_info_get_method: * @info: a #GIUnionInfo * @n: a method index * * Obtain the type information for method with specified index. * - * Returns: (transfer full): the #GIFunctionInfo, free it with g_base_info_unref() + * Returns: (transfer full): the #GIFunctionInfo, free it with gi_base_info_unref() * when done. */ GIFunctionInfo * -g_union_info_get_method (GIUnionInfo *info, - gint n) +gi_union_info_get_method (GIUnionInfo *info, + gint n) { GIRealInfo *rinfo = (GIRealInfo *)info; UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset]; @@ -121,12 +121,12 @@ g_union_info_get_method (GIUnionInfo *info, offset = rinfo->offset + header->union_blob_size + blob->n_fields * header->field_blob_size + n * header->function_blob_size; - return (GIFunctionInfo *) g_info_new (GI_INFO_TYPE_FUNCTION, (GIBaseInfo*)info, - rinfo->typelib, offset); + return (GIFunctionInfo *) gi_info_new (GI_INFO_TYPE_FUNCTION, (GIBaseInfo*)info, + rinfo->typelib, offset); } /** - * g_union_info_is_discriminated: + * gi_union_info_is_discriminated: * @info: a #GIUnionInfo * * Return true if this union contains discriminator field. @@ -134,7 +134,7 @@ g_union_info_get_method (GIUnionInfo *info, * Returns: %TRUE if this is a discriminated union, %FALSE otherwise */ gboolean -g_union_info_is_discriminated (GIUnionInfo *info) +gi_union_info_is_discriminated (GIUnionInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset]; @@ -143,7 +143,7 @@ g_union_info_is_discriminated (GIUnionInfo *info) } /** - * g_union_info_get_discriminator_offset: + * gi_union_info_get_discriminator_offset: * @info: a #GIUnionInfo * * Returns offset of the discriminator field in the structure. @@ -151,7 +151,7 @@ g_union_info_is_discriminated (GIUnionInfo *info) * Returns: offset in bytes of the discriminator */ gint -g_union_info_get_discriminator_offset (GIUnionInfo *info) +gi_union_info_get_discriminator_offset (GIUnionInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset]; @@ -160,24 +160,24 @@ g_union_info_get_discriminator_offset (GIUnionInfo *info) } /** - * g_union_info_get_discriminator_type: + * gi_union_info_get_discriminator_type: * @info: a #GIUnionInfo * * Obtain the type information of the union discriminator. * - * Returns: (transfer full): the #GITypeInfo, free it with g_base_info_unref() + * Returns: (transfer full): the #GITypeInfo, free it with gi_base_info_unref() * when done. */ GITypeInfo * -g_union_info_get_discriminator_type (GIUnionInfo *info) +gi_union_info_get_discriminator_type (GIUnionInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; - return _g_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + 24); + return _gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + 24); } /** - * g_union_info_get_discriminator: + * gi_union_info_get_discriminator: * @info: a #GIUnionInfo * @n: a union field index * @@ -185,12 +185,12 @@ g_union_info_get_discriminator_type (GIUnionInfo *info) * union field is the active one if discriminator contains this * constant. * - * Returns: (transfer full): the #GIConstantInfo, free it with g_base_info_unref() + * Returns: (transfer full): the #GIConstantInfo, free it with gi_base_info_unref() * when done. */ GIConstantInfo * -g_union_info_get_discriminator (GIUnionInfo *info, - gint n) +gi_union_info_get_discriminator (GIUnionInfo *info, + gint n) { GIRealInfo *rinfo = (GIRealInfo *)info; UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset]; @@ -205,26 +205,26 @@ g_union_info_get_discriminator (GIUnionInfo *info, + blob->n_functions * header->function_blob_size + n * header->constant_blob_size; - return (GIConstantInfo *) g_info_new (GI_INFO_TYPE_CONSTANT, (GIBaseInfo*)info, - rinfo->typelib, offset); + return (GIConstantInfo *) gi_info_new (GI_INFO_TYPE_CONSTANT, (GIBaseInfo*)info, + rinfo->typelib, offset); } return NULL; } /** - * g_union_info_find_method: + * gi_union_info_find_method: * @info: a #GIUnionInfo * @name: a method name * * Obtain the type information for method named @name. * - * Returns: (transfer full): the #GIFunctionInfo, free it with g_base_info_unref() + * Returns: (transfer full): the #GIFunctionInfo, free it with gi_base_info_unref() * when done. */ GIFunctionInfo * -g_union_info_find_method (GIUnionInfo *info, - const gchar *name) +gi_union_info_find_method (GIUnionInfo *info, + const gchar *name) { gint offset; GIRealInfo *rinfo = (GIRealInfo *)info; @@ -234,11 +234,11 @@ g_union_info_find_method (GIUnionInfo *info, offset = rinfo->offset + header->union_blob_size + blob->n_fields * header->field_blob_size; - return _g_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_functions, name); + return _gi_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_functions, name); } /** - * g_union_info_get_size: + * gi_union_info_get_size: * @info: a #GIUnionInfo * * Obtain the total size of the union. @@ -246,7 +246,7 @@ g_union_info_find_method (GIUnionInfo *info, * Returns: size of the union in bytes */ gsize -g_union_info_get_size (GIUnionInfo *info) +gi_union_info_get_size (GIUnionInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset]; @@ -255,7 +255,7 @@ g_union_info_get_size (GIUnionInfo *info) } /** - * g_union_info_get_alignment: + * gi_union_info_get_alignment: * @info: a #GIUnionInfo * * Obtain the required alignment of the union. @@ -263,7 +263,7 @@ g_union_info_get_size (GIUnionInfo *info) * Returns: required alignment in bytes */ gsize -g_union_info_get_alignment (GIUnionInfo *info) +gi_union_info_get_alignment (GIUnionInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset]; @@ -272,7 +272,7 @@ g_union_info_get_alignment (GIUnionInfo *info) } /** - * g_union_info_get_copy_function: + * gi_union_info_get_copy_function: * @info: a union information blob * * Retrieves the name of the copy function for @info, if any is set. @@ -282,7 +282,7 @@ g_union_info_get_alignment (GIUnionInfo *info) * Since: 1.76 */ const char * -g_union_info_get_copy_function (GIUnionInfo *info) +gi_union_info_get_copy_function (GIUnionInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; UnionBlob *blob; @@ -293,13 +293,13 @@ g_union_info_get_copy_function (GIUnionInfo *info) blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset]; if (blob->copy_func) - return g_typelib_get_string (rinfo->typelib, blob->copy_func); + return gi_typelib_get_string (rinfo->typelib, blob->copy_func); return NULL; } /** - * g_union_info_get_free_function: + * gi_union_info_get_free_function: * @info: a union information blob * * Retrieves the name of the free function for @info, if any is set. @@ -309,7 +309,7 @@ g_union_info_get_copy_function (GIUnionInfo *info) * Since: 1.76 */ const char * -g_union_info_get_free_function (GIUnionInfo *info) +gi_union_info_get_free_function (GIUnionInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; UnionBlob *blob; @@ -320,7 +320,7 @@ g_union_info_get_free_function (GIUnionInfo *info) blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset]; if (blob->free_func) - return g_typelib_get_string (rinfo->typelib, blob->free_func); + return gi_typelib_get_string (rinfo->typelib, blob->free_func); return NULL; } diff --git a/girepository/giunioninfo.h b/girepository/giunioninfo.h index 1c5b40599..d45389b2b 100644 --- a/girepository/giunioninfo.h +++ b/girepository/giunioninfo.h @@ -39,49 +39,49 @@ G_BEGIN_DECLS * Checks if @info is a #GIUnionInfo. */ #define GI_IS_UNION_INFO(info) \ - (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_UNION) + (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_UNION) GI_AVAILABLE_IN_ALL -gint g_union_info_get_n_fields (GIUnionInfo *info); +gint gi_union_info_get_n_fields (GIUnionInfo *info); GI_AVAILABLE_IN_ALL -GIFieldInfo * g_union_info_get_field (GIUnionInfo *info, - gint n); +GIFieldInfo * gi_union_info_get_field (GIUnionInfo *info, + gint n); GI_AVAILABLE_IN_ALL -gint g_union_info_get_n_methods (GIUnionInfo *info); +gint gi_union_info_get_n_methods (GIUnionInfo *info); GI_AVAILABLE_IN_ALL -GIFunctionInfo * g_union_info_get_method (GIUnionInfo *info, - gint n); +GIFunctionInfo * gi_union_info_get_method (GIUnionInfo *info, + gint n); GI_AVAILABLE_IN_ALL -gboolean g_union_info_is_discriminated (GIUnionInfo *info); +gboolean gi_union_info_is_discriminated (GIUnionInfo *info); GI_AVAILABLE_IN_ALL -gint g_union_info_get_discriminator_offset (GIUnionInfo *info); +gint gi_union_info_get_discriminator_offset (GIUnionInfo *info); GI_AVAILABLE_IN_ALL -GITypeInfo * g_union_info_get_discriminator_type (GIUnionInfo *info); +GITypeInfo * gi_union_info_get_discriminator_type (GIUnionInfo *info); GI_AVAILABLE_IN_ALL -GIConstantInfo * g_union_info_get_discriminator (GIUnionInfo *info, - gint n); +GIConstantInfo * gi_union_info_get_discriminator (GIUnionInfo *info, + gint n); GI_AVAILABLE_IN_ALL -GIFunctionInfo * g_union_info_find_method (GIUnionInfo *info, +GIFunctionInfo * gi_union_info_find_method (GIUnionInfo *info, const gchar *name); GI_AVAILABLE_IN_ALL -gsize g_union_info_get_size (GIUnionInfo *info); +gsize gi_union_info_get_size (GIUnionInfo *info); GI_AVAILABLE_IN_ALL -gsize g_union_info_get_alignment (GIUnionInfo *info); +gsize gi_union_info_get_alignment (GIUnionInfo *info); GI_AVAILABLE_IN_ALL -const char * g_union_info_get_copy_function (GIUnionInfo *info); +const char * gi_union_info_get_copy_function (GIUnionInfo *info); GI_AVAILABLE_IN_ALL -const char * g_union_info_get_free_function (GIUnionInfo *info); +const char * gi_union_info_get_free_function (GIUnionInfo *info); G_END_DECLS diff --git a/girepository/givfuncinfo.c b/girepository/givfuncinfo.c index 891a843fc..604b029e1 100644 --- a/girepository/givfuncinfo.c +++ b/girepository/givfuncinfo.c @@ -45,10 +45,10 @@ */ GIVFuncInfo * -_g_base_info_find_vfunc (GIRealInfo *rinfo, - guint32 offset, - gint n_vfuncs, - const gchar *name) +_gi_base_info_find_vfunc (GIRealInfo *rinfo, + guint32 offset, + gint n_vfuncs, + const gchar *name) { /* FIXME hash */ Header *header = (Header *)rinfo->typelib->data; @@ -60,7 +60,7 @@ _g_base_info_find_vfunc (GIRealInfo *rinfo, const gchar *fname = (const gchar *)&rinfo->typelib->data[fblob->name]; if (strcmp (name, fname) == 0) - return (GIVFuncInfo *) g_info_new (GI_INFO_TYPE_VFUNC, (GIBaseInfo*) rinfo, + return (GIVFuncInfo *) gi_info_new (GI_INFO_TYPE_VFUNC, (GIBaseInfo*) rinfo, rinfo->typelib, offset); offset += header->vfunc_blob_size; @@ -70,7 +70,7 @@ _g_base_info_find_vfunc (GIRealInfo *rinfo, } /** - * g_vfunc_info_get_flags: + * gi_vfunc_info_get_flags: * @info: a #GIVFuncInfo * * Obtain the flags for this virtual function info. See #GIVFuncInfoFlags for @@ -79,7 +79,7 @@ _g_base_info_find_vfunc (GIRealInfo *rinfo, * Returns: the flags */ GIVFuncInfoFlags -g_vfunc_info_get_flags (GIVFuncInfo *info) +gi_vfunc_info_get_flags (GIVFuncInfo *info) { GIVFuncInfoFlags flags; GIRealInfo *rinfo = (GIRealInfo *)info; @@ -108,7 +108,7 @@ g_vfunc_info_get_flags (GIVFuncInfo *info) } /** - * g_vfunc_info_get_offset: + * gi_vfunc_info_get_offset: * @info: a #GIVFuncInfo * * Obtain the offset of the function pointer in the class struct. The value @@ -117,7 +117,7 @@ g_vfunc_info_get_flags (GIVFuncInfo *info) * Returns: the struct offset or 0xFFFF if it's unknown */ gint -g_vfunc_info_get_offset (GIVFuncInfo *info) +gi_vfunc_info_get_offset (GIVFuncInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; VFuncBlob *blob; @@ -131,7 +131,7 @@ g_vfunc_info_get_offset (GIVFuncInfo *info) } /** - * g_vfunc_info_get_signal: + * gi_vfunc_info_get_signal: * @info: a #GIVFuncInfo * * Obtain the signal for the virtual function if one is set. @@ -141,7 +141,7 @@ g_vfunc_info_get_offset (GIVFuncInfo *info) * Returns: (transfer full): the signal or %NULL if none set */ GISignalInfo * -g_vfunc_info_get_signal (GIVFuncInfo *info) +gi_vfunc_info_get_signal (GIVFuncInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; VFuncBlob *blob; @@ -152,13 +152,13 @@ g_vfunc_info_get_signal (GIVFuncInfo *info) blob = (VFuncBlob *)&rinfo->typelib->data[rinfo->offset]; if (blob->class_closure) - return g_interface_info_get_signal ((GIInterfaceInfo *)rinfo->container, blob->signal); + return gi_interface_info_get_signal ((GIInterfaceInfo *)rinfo->container, blob->signal); return NULL; } /** - * g_vfunc_info_get_invoker: + * gi_vfunc_info_get_invoker: * @info: a #GIVFuncInfo * * If this virtual function has an associated invoker method, this @@ -167,10 +167,10 @@ g_vfunc_info_get_signal (GIVFuncInfo *info) * Not all virtuals will have invokers. * * Returns: (transfer full): the #GIVFuncInfo or %NULL. Free it with - * g_base_info_unref() when done. + * gi_base_info_unref() when done. */ GIFunctionInfo * -g_vfunc_info_get_invoker (GIVFuncInfo *info) +gi_vfunc_info_get_invoker (GIVFuncInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; VFuncBlob *blob; @@ -187,17 +187,17 @@ g_vfunc_info_get_invoker (GIVFuncInfo *info) return NULL; container = rinfo->container; - parent_type = g_base_info_get_type (container); + parent_type = gi_base_info_get_type (container); if (parent_type == GI_INFO_TYPE_OBJECT) - return g_object_info_get_method ((GIObjectInfo*)container, blob->invoker); + return gi_object_info_get_method ((GIObjectInfo*)container, blob->invoker); else if (parent_type == GI_INFO_TYPE_INTERFACE) - return g_interface_info_get_method ((GIInterfaceInfo*)container, blob->invoker); + return gi_interface_info_get_method ((GIInterfaceInfo*)container, blob->invoker); else g_assert_not_reached (); } /** - * g_vfunc_info_get_address: + * gi_vfunc_info_get_address: * @info: a #GIVFuncInfo * @implementor_gtype: #GType implementing this virtual function * @error: return location for a #GError @@ -208,9 +208,9 @@ g_vfunc_info_get_invoker (GIVFuncInfo *info) * Returns: address to a function or %NULL if an error happened */ gpointer -g_vfunc_info_get_address (GIVFuncInfo *vfunc_info, - GType implementor_gtype, - GError **error) +gi_vfunc_info_get_address (GIVFuncInfo *vfunc_info, + GType implementor_gtype, + GError **error) { GIBaseInfo *container_info; GIInterfaceInfo *interface_info; @@ -221,28 +221,28 @@ g_vfunc_info_get_address (GIVFuncInfo *vfunc_info, gpointer implementor_class, implementor_vtable; gpointer func = NULL; - container_info = g_base_info_get_container (vfunc_info); - if (g_base_info_get_type (container_info) == GI_INFO_TYPE_OBJECT) + container_info = gi_base_info_get_container (vfunc_info); + if (gi_base_info_get_type (container_info) == GI_INFO_TYPE_OBJECT) { object_info = (GIObjectInfo*) container_info; interface_info = NULL; - struct_info = g_object_info_get_class_struct (object_info); + struct_info = gi_object_info_get_class_struct (object_info); } else { interface_info = (GIInterfaceInfo*) container_info; object_info = NULL; - struct_info = g_interface_info_get_iface_struct (interface_info); + struct_info = gi_interface_info_get_iface_struct (interface_info); } - length = g_struct_info_get_n_fields (struct_info); + length = gi_struct_info_get_n_fields (struct_info); for (i = 0; i < length; i++) { - field_info = g_struct_info_get_field (struct_info, i); + field_info = gi_struct_info_get_field (struct_info, i); - if (strcmp (g_base_info_get_name ( (GIBaseInfo*) field_info), - g_base_info_get_name ( (GIBaseInfo*) vfunc_info)) != 0) { - g_base_info_unref (field_info); + if (strcmp (gi_base_info_get_name ( (GIBaseInfo*) field_info), + gi_base_info_get_name ( (GIBaseInfo*) vfunc_info)) != 0) { + gi_base_info_unref (field_info); field_info = NULL; continue; } @@ -253,8 +253,8 @@ g_vfunc_info_get_address (GIVFuncInfo *vfunc_info, if (field_info == NULL) { g_set_error (error, - G_INVOKE_ERROR, - G_INVOKE_ERROR_SYMBOL_NOT_FOUND, + GI_INVOKE_ERROR, + GI_INVOKE_ERROR_SYMBOL_NOT_FOUND, "Couldn't find struct field for this vfunc"); goto out; } @@ -269,34 +269,34 @@ g_vfunc_info_get_address (GIVFuncInfo *vfunc_info, { GType interface_type; - interface_type = g_registered_type_info_get_g_type ((GIRegisteredTypeInfo*) interface_info); + interface_type = gi_registered_type_info_get_g_type ((GIRegisteredTypeInfo*) interface_info); implementor_vtable = g_type_interface_peek (implementor_class, interface_type); } - offset = g_field_info_get_offset (field_info); + offset = gi_field_info_get_offset (field_info); func = *(gpointer*) G_STRUCT_MEMBER_P (implementor_vtable, offset); g_type_class_unref (implementor_class); - g_base_info_unref (field_info); + gi_base_info_unref (field_info); if (func == NULL) { g_set_error (error, - G_INVOKE_ERROR, - G_INVOKE_ERROR_SYMBOL_NOT_FOUND, + GI_INVOKE_ERROR, + GI_INVOKE_ERROR_SYMBOL_NOT_FOUND, "Class %s doesn't implement %s", g_type_name (implementor_gtype), - g_base_info_get_name ( (GIBaseInfo*) vfunc_info)); + gi_base_info_get_name ( (GIBaseInfo*) vfunc_info)); goto out; } out: - g_base_info_unref ((GIBaseInfo*) struct_info); + gi_base_info_unref ((GIBaseInfo*) struct_info); return func; } /** - * g_vfunc_info_invoke: (skip) + * gi_vfunc_info_invoke: (skip) * @info: a #GIVFuncInfo describing the virtual function to invoke * @implementor: #GType of the type that implements this virtual function * @in_args: (array length=n_in_args): an array of #GIArguments, one for each in @@ -320,29 +320,29 @@ g_vfunc_info_get_address (GIVFuncInfo *vfunc_info, * error occurred. */ gboolean -g_vfunc_info_invoke (GIVFuncInfo *info, - GType implementor, - const GIArgument *in_args, - int n_in_args, - const GIArgument *out_args, - int n_out_args, - GIArgument *return_value, - GError **error) +gi_vfunc_info_invoke (GIVFuncInfo *info, + GType implementor, + const GIArgument *in_args, + int n_in_args, + const GIArgument *out_args, + int n_out_args, + GIArgument *return_value, + GError **error) { gpointer func; - func = g_vfunc_info_get_address (info, implementor, error); + func = gi_vfunc_info_get_address (info, implementor, error); if (*error != NULL) return FALSE; - return g_callable_info_invoke ((GICallableInfo*) info, - func, - in_args, - n_in_args, - out_args, - n_out_args, - return_value, - TRUE, - FALSE, - error); + return gi_callable_info_invoke ((GICallableInfo*) info, + func, + in_args, + n_in_args, + out_args, + n_out_args, + return_value, + TRUE, + FALSE, + error); } diff --git a/girepository/givfuncinfo.h b/girepository/givfuncinfo.h index a1ec37ce6..2fb67a78e 100644 --- a/girepository/givfuncinfo.h +++ b/girepository/givfuncinfo.h @@ -39,33 +39,33 @@ G_BEGIN_DECLS * Checks if @info is a #GIVfuncInfo. */ #define GI_IS_VFUNC_INFO(info) \ - (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_VFUNC) + (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_VFUNC) GI_AVAILABLE_IN_ALL -GIVFuncInfoFlags g_vfunc_info_get_flags (GIVFuncInfo *info); +GIVFuncInfoFlags gi_vfunc_info_get_flags (GIVFuncInfo *info); GI_AVAILABLE_IN_ALL -gint g_vfunc_info_get_offset (GIVFuncInfo *info); +gint gi_vfunc_info_get_offset (GIVFuncInfo *info); GI_AVAILABLE_IN_ALL -GISignalInfo * g_vfunc_info_get_signal (GIVFuncInfo *info); +GISignalInfo * gi_vfunc_info_get_signal (GIVFuncInfo *info); GI_AVAILABLE_IN_ALL -GIFunctionInfo * g_vfunc_info_get_invoker (GIVFuncInfo *info); +GIFunctionInfo * gi_vfunc_info_get_invoker (GIVFuncInfo *info); GI_AVAILABLE_IN_ALL -gpointer g_vfunc_info_get_address (GIVFuncInfo *info, - GType implementor_gtype, - GError **error); +gpointer gi_vfunc_info_get_address (GIVFuncInfo *info, + GType implementor_gtype, + GError **error); GI_AVAILABLE_IN_ALL -gboolean g_vfunc_info_invoke (GIVFuncInfo *info, - GType implementor, - const GIArgument *in_args, - int n_in_args, - const GIArgument *out_args, - int n_out_args, - GIArgument *return_value, - GError **error); +gboolean gi_vfunc_info_invoke (GIVFuncInfo *info, + GType implementor, + const GIArgument *in_args, + int n_in_args, + const GIArgument *out_args, + int n_out_args, + GIArgument *return_value, + GError **error); G_END_DECLS From 7b029e564dc95650caa1a0d5229244624d0e1d30 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 8 Nov 2023 15:06:21 +0000 Subject: [PATCH 4/5] girepository: Remove redundant GLib version checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that libgirepository is inside glib.git, it’s guaranteed access to all the latest APIs, so there’s no need for version checks. Signed-off-by: Philip Withnall Helps: #3155 --- girepository/gdump.c | 6 ------ girepository/giconstantinfo.c | 4 ---- 2 files changed, 10 deletions(-) diff --git a/girepository/gdump.c b/girepository/gdump.c index 126bc41c9..416d7c3f3 100644 --- a/girepository/gdump.c +++ b/girepository/gdump.c @@ -269,10 +269,8 @@ dump_signals (GType type, GOutputStream *out) escaped_printf (out, " when=\"last\""); else if (query.signal_flags & G_SIGNAL_RUN_CLEANUP) escaped_printf (out, " when=\"cleanup\""); -#if GLIB_CHECK_VERSION(2, 29, 15) else if (query.signal_flags & G_SIGNAL_MUST_COLLECT) escaped_printf (out, " when=\"must-collect\""); -#endif if (query.signal_flags & G_SIGNAL_NO_RECURSE) escaped_printf (out, " no-recurse=\"1\""); @@ -332,10 +330,8 @@ dump_object_type (GType type, const char *symbol, GOutputStream *out) if (G_TYPE_IS_ABSTRACT (type)) escaped_printf (out, " abstract=\"1\""); -#if GLIB_CHECK_VERSION (2, 70, 0) if (G_TYPE_IS_FINAL (type)) escaped_printf (out, " final=\"1\""); -#endif goutput_write (out, ">\n"); @@ -450,10 +446,8 @@ dump_fundamental_type (GType type, const char *symbol, GOutputStream *out) if (G_TYPE_IS_ABSTRACT (type)) escaped_printf (out, " abstract=\"1\""); -#if GLIB_CHECK_VERSION (2, 70, 0) if (G_TYPE_IS_FINAL (type)) escaped_printf (out, " final=\"1\""); -#endif if (G_TYPE_IS_INSTANTIATABLE (type)) escaped_printf (out, " instantiatable=\"1\""); diff --git a/girepository/giconstantinfo.c b/girepository/giconstantinfo.c index 62b0dccab..38a918e48 100644 --- a/girepository/giconstantinfo.c +++ b/girepository/giconstantinfo.c @@ -126,13 +126,9 @@ gi_constant_info_get_value (GIConstantInfo *info, { if (blob->type.flags.pointer) { -#if GLIB_CHECK_VERSION (2, 67, 5) gsize blob_size = blob->size; value->v_pointer = g_memdup2 (&rinfo->typelib->data[blob->offset], blob_size); -#else - value->v_pointer = g_memdup (&rinfo->typelib->data[blob->offset], blob->size); -#endif } else { From 2b544c3f66ab39a9e8f7eb0279fe4aef54df0a44 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 8 Nov 2023 15:23:31 +0000 Subject: [PATCH 5/5] girepository: Remove `_` prefix from private functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that libgirepository uses `GI_AVAILABLE_IN_*` macros, that’s what controls symbol visibility. The `_` prefixes are redundant, and out of keeping with the rest of GLib. Signed-off-by: Philip Withnall Helps: #3155 --- girepository/giarginfo.c | 4 +- girepository/gibaseinfo.c | 52 ++-- girepository/gicallableinfo.c | 8 +- girepository/giconstantinfo.c | 2 +- girepository/gifieldinfo.c | 2 +- girepository/gifunctioninfo.c | 8 +- girepository/giinterfaceinfo.c | 12 +- girepository/giobjectinfo.c | 16 +- girepository/gipropertyinfo.c | 6 +- girepository/girepository-private.h | 58 ++-- girepository/girepository.c | 24 +- girepository/girmodule-private.h | 22 +- girepository/girmodule.c | 76 ++--- girepository/girnode-private.h | 54 ++-- girepository/girnode.c | 444 ++++++++++++++-------------- girepository/giroffsets.c | 14 +- girepository/girparser-private.h | 26 +- girepository/girparser.c | 118 ++++---- girepository/gistructinfo.c | 2 +- girepository/gitypeinfo.c | 8 +- girepository/gitypelib-internal.h | 14 +- girepository/gitypelib.c | 10 +- girepository/giunioninfo.c | 4 +- girepository/givfuncinfo.c | 8 +- girepository/gthash-test.c | 26 +- girepository/gthash.c | 18 +- 26 files changed, 518 insertions(+), 518 deletions(-) diff --git a/girepository/giarginfo.c b/girepository/giarginfo.c index bb0bef115..aec94dc22 100644 --- a/girepository/giarginfo.c +++ b/girepository/giarginfo.c @@ -308,7 +308,7 @@ gi_arg_info_get_type (GIArgInfo *info) g_return_val_if_fail (info != NULL, NULL); g_return_val_if_fail (GI_IS_ARG_INFO (info), NULL); - return _gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + G_STRUCT_OFFSET (ArgBlob, arg_type)); + return gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + G_STRUCT_OFFSET (ArgBlob, arg_type)); } /** @@ -331,5 +331,5 @@ gi_arg_info_load_type (GIArgInfo *info, g_return_if_fail (info != NULL); g_return_if_fail (GI_IS_ARG_INFO (info)); - _gi_type_info_init (type, (GIBaseInfo*)info, rinfo->typelib, rinfo->offset + G_STRUCT_OFFSET (ArgBlob, arg_type)); + gi_type_info_init (type, (GIBaseInfo*)info, rinfo->typelib, rinfo->offset + G_STRUCT_OFFSET (ArgBlob, arg_type)); } diff --git a/girepository/gibaseinfo.c b/girepository/gibaseinfo.c index 8f29c2d14..27cb1d3aa 100644 --- a/girepository/gibaseinfo.c +++ b/girepository/gibaseinfo.c @@ -53,11 +53,11 @@ gi_base_info_gtype_get_type (void) /* info creation */ GIBaseInfo * -_gi_info_new_full (GIInfoType type, - GIRepository *repository, - GIBaseInfo *container, - GITypelib *typelib, - guint32 offset) +gi_info_new_full (GIInfoType type, + GIRepository *repository, + GIBaseInfo *container, + GITypelib *typelib, + guint32 offset) { GIRealInfo *info; @@ -65,7 +65,7 @@ _gi_info_new_full (GIInfoType type, info = g_slice_new (GIRealInfo); - _gi_info_init (info, type, repository, container, typelib, offset); + gi_info_init (info, type, repository, container, typelib, offset); info->ref_count = 1; if (container && ((GIRealInfo *) container)->ref_count != INVALID_REFCOUNT) @@ -93,16 +93,16 @@ gi_info_new (GIInfoType type, GITypelib *typelib, guint32 offset) { - return _gi_info_new_full (type, ((GIRealInfo*)container)->repository, container, typelib, offset); + return gi_info_new_full (type, ((GIRealInfo*)container)->repository, container, typelib, offset); } void -_gi_info_init (GIRealInfo *info, - GIInfoType type, - GIRepository *repository, - GIBaseInfo *container, - GITypelib *typelib, - guint32 offset) +gi_info_init (GIRealInfo *info, + GIInfoType type, + GIRepository *repository, + GIBaseInfo *container, + GITypelib *typelib, + guint32 offset) { memset (info, 0, sizeof (GIRealInfo)); @@ -121,15 +121,15 @@ _gi_info_init (GIRealInfo *info, } GIBaseInfo * -_gi_info_from_entry (GIRepository *repository, - GITypelib *typelib, - guint16 index) +gi_info_from_entry (GIRepository *repository, + GITypelib *typelib, + guint16 index) { GIBaseInfo *result; DirEntry *entry = gi_typelib_get_dir_entry (typelib, index); if (entry->local) - result = _gi_info_new_full (entry->blob_type, repository, NULL, typelib, entry->offset); + result = gi_info_new_full (entry->blob_type, repository, NULL, typelib, entry->offset); else { const gchar *namespace = gi_typelib_get_string (typelib, entry->offset); @@ -158,9 +158,9 @@ _gi_info_from_entry (GIRepository *repository, } GITypeInfo * -_gi_type_info_new (GIBaseInfo *container, - GITypelib *typelib, - guint32 offset) +gi_type_info_new (GIBaseInfo *container, + GITypelib *typelib, + guint32 offset) { SimpleTypeBlob *type = (SimpleTypeBlob *)&typelib->data[offset]; @@ -169,16 +169,16 @@ _gi_type_info_new (GIBaseInfo *container, } void -_gi_type_info_init (GIBaseInfo *info, - GIBaseInfo *container, - GITypelib *typelib, - guint32 offset) +gi_type_info_init (GIBaseInfo *info, + GIBaseInfo *container, + GITypelib *typelib, + guint32 offset) { GIRealInfo *rinfo = (GIRealInfo*)container; SimpleTypeBlob *type = (SimpleTypeBlob *)&typelib->data[offset]; - _gi_info_init ((GIRealInfo*)info, GI_INFO_TYPE_TYPE, rinfo->repository, container, typelib, - (type->flags.reserved == 0 && type->flags.reserved2 == 0) ? offset : type->offset); + gi_info_init ((GIRealInfo*)info, GI_INFO_TYPE_TYPE, rinfo->repository, container, typelib, + (type->flags.reserved == 0 && type->flags.reserved2 == 0) ? offset : type->offset); } /* GIBaseInfo functions */ diff --git a/girepository/gicallableinfo.c b/girepository/gicallableinfo.c index 336d44d6f..37997eef3 100644 --- a/girepository/gicallableinfo.c +++ b/girepository/gicallableinfo.c @@ -184,7 +184,7 @@ gi_callable_info_get_return_type (GICallableInfo *info) offset = signature_offset (info); - return _gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, offset); + return gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, offset); } @@ -211,7 +211,7 @@ gi_callable_info_load_return_type (GICallableInfo *info, offset = signature_offset (info); - _gi_type_info_init (type, (GIBaseInfo*)info, rinfo->typelib, offset); + gi_type_info_init (type, (GIBaseInfo*)info, rinfo->typelib, offset); } /** @@ -392,8 +392,8 @@ gi_callable_info_load_arg (GICallableInfo *info, offset = signature_offset (info); header = (Header *)rinfo->typelib->data; - _gi_info_init ((GIRealInfo*)arg, GI_INFO_TYPE_ARG, rinfo->repository, (GIBaseInfo*)info, rinfo->typelib, - offset + header->signature_blob_size + n * header->arg_blob_size); + gi_info_init ((GIRealInfo*)arg, GI_INFO_TYPE_ARG, rinfo->repository, (GIBaseInfo*)info, rinfo->typelib, + offset + header->signature_blob_size + n * header->arg_blob_size); } /** diff --git a/girepository/giconstantinfo.c b/girepository/giconstantinfo.c index 38a918e48..01223e236 100644 --- a/girepository/giconstantinfo.c +++ b/girepository/giconstantinfo.c @@ -62,7 +62,7 @@ gi_constant_info_get_type (GIConstantInfo *info) g_return_val_if_fail (info != NULL, NULL); g_return_val_if_fail (GI_IS_CONSTANT_INFO (info), NULL); - return _gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + 8); + return gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + 8); } #define DO_ALIGNED_COPY(dest_addr, src_addr, type) \ diff --git a/girepository/gifieldinfo.c b/girepository/gifieldinfo.c index c10f034ed..ec8f7af7a 100644 --- a/girepository/gifieldinfo.c +++ b/girepository/gifieldinfo.c @@ -156,7 +156,7 @@ gi_field_info_get_type (GIFieldInfo *info) type_info->type_is_embedded = TRUE; } else - return _gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + G_STRUCT_OFFSET (FieldBlob, type)); + return gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + G_STRUCT_OFFSET (FieldBlob, type)); return (GIBaseInfo*)type_info; } diff --git a/girepository/gifunctioninfo.c b/girepository/gifunctioninfo.c index 83c9ab5dc..6a7bedcdd 100644 --- a/girepository/gifunctioninfo.c +++ b/girepository/gifunctioninfo.c @@ -48,10 +48,10 @@ */ GIFunctionInfo * -_gi_base_info_find_method (GIBaseInfo *base, - guint32 offset, - gint n_methods, - const gchar *name) +gi_base_info_find_method (GIBaseInfo *base, + guint32 offset, + gint n_methods, + const gchar *name) { /* FIXME hash */ GIRealInfo *rinfo = (GIRealInfo*)base; diff --git a/girepository/giinterfaceinfo.c b/girepository/giinterfaceinfo.c index 40a2cac09..e2072f492 100644 --- a/girepository/giinterfaceinfo.c +++ b/girepository/giinterfaceinfo.c @@ -88,8 +88,8 @@ gi_interface_info_get_prerequisite (GIInterfaceInfo *info, blob = (InterfaceBlob *)&rinfo->typelib->data[rinfo->offset]; - return _gi_info_from_entry (rinfo->repository, - rinfo->typelib, blob->prerequisites[n]); + return gi_info_from_entry (rinfo->repository, + rinfo->typelib, blob->prerequisites[n]); } @@ -228,7 +228,7 @@ gi_interface_info_find_method (GIInterfaceInfo *info, + (blob->n_prerequisites + (blob->n_prerequisites % 2)) * 2 + blob->n_properties * header->property_blob_size; - return _gi_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_methods, name); + return gi_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_methods, name); } /** @@ -412,7 +412,7 @@ gi_interface_info_find_vfunc (GIInterfaceInfo *info, + blob->n_methods * header->function_blob_size + blob->n_signals * header->signal_blob_size; - return _gi_base_info_find_vfunc (rinfo, offset, blob->n_vfuncs, name); + return gi_base_info_find_vfunc (rinfo, offset, blob->n_vfuncs, name); } /** @@ -495,8 +495,8 @@ gi_interface_info_get_iface_struct (GIInterfaceInfo *info) blob = (InterfaceBlob *)&rinfo->typelib->data[rinfo->offset]; if (blob->gtype_struct) - return (GIStructInfo *) _gi_info_from_entry (rinfo->repository, - rinfo->typelib, blob->gtype_struct); + return (GIStructInfo *) gi_info_from_entry (rinfo->repository, + rinfo->typelib, blob->gtype_struct); else return NULL; } diff --git a/girepository/giobjectinfo.c b/girepository/giobjectinfo.c index ccd3b2fa6..4a8ef5300 100644 --- a/girepository/giobjectinfo.c +++ b/girepository/giobjectinfo.c @@ -103,8 +103,8 @@ gi_object_info_get_parent (GIObjectInfo *info) blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset]; if (blob->parent) - return (GIObjectInfo *) _gi_info_from_entry (rinfo->repository, - rinfo->typelib, blob->parent); + return (GIObjectInfo *) gi_info_from_entry (rinfo->repository, + rinfo->typelib, blob->parent); else return NULL; } @@ -269,8 +269,8 @@ gi_object_info_get_interface (GIObjectInfo *info, blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset]; - return (GIInterfaceInfo *) _gi_info_from_entry (rinfo->repository, - rinfo->typelib, blob->interfaces[n]); + return (GIInterfaceInfo *) gi_info_from_entry (rinfo->repository, + rinfo->typelib, blob->interfaces[n]); } /** @@ -467,7 +467,7 @@ gi_object_info_find_method (GIObjectInfo *info, + blob->n_field_callbacks * header->callback_blob_size + blob->n_properties * header->property_blob_size; - return _gi_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_methods, name); + return gi_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_methods, name); } /** @@ -718,7 +718,7 @@ gi_object_info_find_vfunc (GIObjectInfo *info, + blob->n_methods * header->function_blob_size + blob->n_signals * header->signal_blob_size; - return _gi_base_info_find_vfunc (rinfo, offset, blob->n_vfuncs, name); + return gi_base_info_find_vfunc (rinfo, offset, blob->n_vfuncs, name); } /** @@ -864,8 +864,8 @@ gi_object_info_get_class_struct (GIObjectInfo *info) blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset]; if (blob->gtype_struct) - return (GIStructInfo *) _gi_info_from_entry (rinfo->repository, - rinfo->typelib, blob->gtype_struct); + return (GIStructInfo *) gi_info_from_entry (rinfo->repository, + rinfo->typelib, blob->gtype_struct); else return NULL; } diff --git a/girepository/gipropertyinfo.c b/girepository/gipropertyinfo.c index b9b21b7c1..829d9089a 100644 --- a/girepository/gipropertyinfo.c +++ b/girepository/gipropertyinfo.c @@ -96,9 +96,9 @@ gi_property_info_get_type (GIPropertyInfo *info) g_return_val_if_fail (info != NULL, NULL); g_return_val_if_fail (GI_IS_PROPERTY_INFO (info), NULL); - return _gi_type_info_new ((GIBaseInfo*)info, - rinfo->typelib, - rinfo->offset + G_STRUCT_OFFSET (PropertyBlob, type)); + return gi_type_info_new ((GIBaseInfo*)info, + rinfo->typelib, + rinfo->offset + G_STRUCT_OFFSET (PropertyBlob, type)); } /** diff --git a/girepository/girepository-private.h b/girepository/girepository-private.h index 67232ce1b..18d784876 100644 --- a/girepository/girepository-private.h +++ b/girepository/girepository-private.h @@ -78,38 +78,38 @@ struct _GIUnresolvedInfo const gchar *namespace; }; -void _gi_info_init (GIRealInfo *info, - GIInfoType type, - GIRepository *repository, - GIBaseInfo *container, - GITypelib *typelib, - guint32 offset); +void gi_info_init (GIRealInfo *info, + GIInfoType type, + GIRepository *repository, + GIBaseInfo *container, + GITypelib *typelib, + guint32 offset); -GIBaseInfo * _gi_info_from_entry (GIRepository *repository, - GITypelib *typelib, - guint16 index); +GIBaseInfo * gi_info_from_entry (GIRepository *repository, + GITypelib *typelib, + guint16 index); -GIBaseInfo * _gi_info_new_full (GIInfoType type, - GIRepository *repository, - GIBaseInfo *container, - GITypelib *typelib, - guint32 offset); +GIBaseInfo * gi_info_new_full (GIInfoType type, + GIRepository *repository, + GIBaseInfo *container, + GITypelib *typelib, + guint32 offset); -GITypeInfo * _gi_type_info_new (GIBaseInfo *container, - GITypelib *typelib, - guint32 offset); +GITypeInfo * gi_type_info_new (GIBaseInfo *container, + GITypelib *typelib, + guint32 offset); -void _gi_type_info_init (GIBaseInfo *info, - GIBaseInfo *container, - GITypelib *typelib, - guint32 offset); +void gi_type_info_init (GIBaseInfo *info, + GIBaseInfo *container, + GITypelib *typelib, + guint32 offset); -GIFunctionInfo * _gi_base_info_find_method (GIBaseInfo *base, - guint32 offset, - gint n_methods, - const gchar *name); +GIFunctionInfo * gi_base_info_find_method (GIBaseInfo *base, + guint32 offset, + gint n_methods, + const gchar *name); -GIVFuncInfo * _gi_base_info_find_vfunc (GIRealInfo *rinfo, - guint32 offset, - gint n_vfuncs, - const gchar *name); +GIVFuncInfo * gi_base_info_find_vfunc (GIRealInfo *rinfo, + guint32 offset, + gint n_vfuncs, + const gchar *name); diff --git a/girepository/girepository.c b/girepository/girepository.c index 85af08cde..bf7127ed8 100644 --- a/girepository/girepository.c +++ b/girepository/girepository.c @@ -754,9 +754,9 @@ gi_repository_get_info (GIRepository *repository, entry = gi_typelib_get_dir_entry (typelib, index + 1); if (entry == NULL) return NULL; - return _gi_info_new_full (entry->blob_type, - repository, - NULL, typelib, entry->offset); + return gi_info_new_full (entry->blob_type, + repository, + NULL, typelib, entry->offset); } typedef struct { @@ -854,9 +854,9 @@ gi_repository_find_by_gtype (GIRepository *repository, if (entry != NULL) { - cached = _gi_info_new_full (entry->blob_type, - repository, - NULL, data.result_typelib, entry->offset); + cached = gi_info_new_full (entry->blob_type, + repository, + NULL, data.result_typelib, entry->offset); g_hash_table_insert (repository->priv->info_by_gtype, (gpointer) gtype, @@ -901,9 +901,9 @@ gi_repository_find_by_name (GIRepository *repository, entry = gi_typelib_get_dir_entry_by_name (typelib, name); if (entry == NULL) return NULL; - return _gi_info_new_full (entry->blob_type, - repository, - NULL, typelib, entry->offset); + return gi_info_new_full (entry->blob_type, + repository, + NULL, typelib, entry->offset); } typedef struct { @@ -971,9 +971,9 @@ gi_repository_find_by_error_domain (GIRepository *repository, if (data.result != NULL) { - cached = _gi_info_new_full (data.result->blob_type, - repository, - NULL, data.result_typelib, data.result->offset); + cached = gi_info_new_full (data.result->blob_type, + repository, + NULL, data.result_typelib, data.result->offset); g_hash_table_insert (repository->priv->info_by_error_domain, GUINT_TO_POINTER (domain), diff --git a/girepository/girmodule-private.h b/girepository/girmodule-private.h index 076043be8..ef386638d 100644 --- a/girepository/girmodule-private.h +++ b/girepository/girmodule-private.h @@ -66,20 +66,20 @@ struct _GIIrModule GHashTable *disguised_structures; }; -GIIrModule *_gi_ir_module_new (const gchar *name, - const gchar *nsversion, - const gchar *module_filename, - const gchar *c_prefix); -void _gi_ir_module_free (GIIrModule *module); +GIIrModule *gi_ir_module_new (const gchar *name, + const gchar *nsversion, + const gchar *module_filename, + const gchar *c_prefix); +void gi_ir_module_free (GIIrModule *module); -void _gi_ir_module_add_include_module (GIIrModule *module, - GIIrModule *include_module); +void gi_ir_module_add_include_module (GIIrModule *module, + GIIrModule *include_module); -GITypelib * _gi_ir_module_build_typelib (GIIrModule *module); +GITypelib * gi_ir_module_build_typelib (GIIrModule *module); -void _gi_ir_module_fatal (GIIrTypelibBuild *build, guint line, const char *msg, ...) G_GNUC_PRINTF (3, 4) G_GNUC_NORETURN; +void gi_ir_module_fatal (GIIrTypelibBuild *build, guint line, const char *msg, ...) G_GNUC_PRINTF (3, 4) G_GNUC_NORETURN; -void _gi_ir_node_init_stats (void); -void _gi_ir_node_dump_stats (void); +void gi_ir_node_init_stats (void); +void gi_ir_node_dump_stats (void); G_END_DECLS diff --git a/girepository/girmodule.c b/girepository/girmodule.c index 02b799091..309cc787c 100644 --- a/girepository/girmodule.c +++ b/girepository/girmodule.c @@ -38,10 +38,10 @@ #define NUM_SECTIONS 2 GIIrModule * -_gi_ir_module_new (const gchar *name, - const gchar *version, - const gchar *shared_library, - const gchar *c_prefix) +gi_ir_module_new (const gchar *name, + const gchar *version, + const gchar *shared_library, + const gchar *c_prefix) { GIIrModule *module; @@ -64,14 +64,14 @@ _gi_ir_module_new (const gchar *name, } void -_gi_ir_module_free (GIIrModule *module) +gi_ir_module_free (GIIrModule *module) { GList *e; g_free (module->name); for (e = module->entries; e; e = e->next) - _gi_ir_node_free ((GIIrNode *)e->data); + gi_ir_node_free ((GIIrNode *)e->data); g_list_free (module->entries); /* Don't free dependencies, we inherit that from the parser */ @@ -86,7 +86,7 @@ _gi_ir_module_free (GIIrModule *module) } /** - * _gi_ir_module_fatal: + * gi_ir_module_fatal: * @build: Current build * @line: Origin line number, or 0 if unknown * @msg: printf-format string @@ -95,10 +95,10 @@ _gi_ir_module_free (GIIrModule *module) * Report a fatal error, then exit. */ void -_gi_ir_module_fatal (GIIrTypelibBuild *build, - guint line, - const char *msg, - ...) +gi_ir_module_fatal (GIIrTypelibBuild *build, + guint line, + const char *msg, + ...) { GString *context; char *formatted; @@ -168,8 +168,8 @@ add_disguised_structure_foreach (gpointer key, } void -_gi_ir_module_add_include_module (GIIrModule *module, - GIIrModule *include_module) +gi_ir_module_add_include_module (GIIrModule *module, + GIIrModule *include_module) { module->include_modules = g_list_prepend (module->include_modules, include_module); @@ -206,8 +206,8 @@ write_attribute (gpointer key, gpointer value, gpointer datap) *(data->offset) += sizeof (AttributeBlob); blob->offset = data->node->offset; - blob->name = _gi_ir_write_string ((const char*) key, data->strings, data->databuf, data->offset2); - blob->value = _gi_ir_write_string ((const char*) value, data->strings, data->databuf, data->offset2); + blob->name = gi_ir_write_string ((const char*) key, data->strings, data->databuf, data->offset2); + blob->value = gi_ir_write_string ((const char*) value, data->strings, data->databuf, data->offset2); data->count++; } @@ -274,7 +274,7 @@ add_directory_index_section (guint8 *data, GIIrModule *module, guint32 *offset2) guint16 required_size; guint32 new_offset; - dirindex_builder = _gi_typelib_hash_builder_new (); + dirindex_builder = gi_typelib_hash_builder_new (); n_interfaces = ((Header *)data)->n_local_entries; @@ -283,37 +283,37 @@ add_directory_index_section (guint8 *data, GIIrModule *module, guint32 *offset2) const char *str; entry = (DirEntry *)&data[header->directory + (i * header->entry_blob_size)]; str = (const char *) (&data[entry->name]); - _gi_typelib_hash_builder_add_string (dirindex_builder, str, i); + gi_typelib_hash_builder_add_string (dirindex_builder, str, i); } - if (!_gi_typelib_hash_builder_prepare (dirindex_builder)) + if (!gi_typelib_hash_builder_prepare (dirindex_builder)) { /* This happens if CMPH couldn't create a perfect hash. So * we just punt and leave no directory index section. */ - _gi_typelib_hash_builder_destroy (dirindex_builder); + gi_typelib_hash_builder_destroy (dirindex_builder); return data; } alloc_section (data, GI_SECTION_DIRECTORY_INDEX, *offset2); - required_size = _gi_typelib_hash_builder_get_buffer_size (dirindex_builder); + required_size = gi_typelib_hash_builder_get_buffer_size (dirindex_builder); required_size = ALIGN_VALUE (required_size, 4); new_offset = *offset2 + required_size; data = g_realloc (data, new_offset); - _gi_typelib_hash_builder_pack (dirindex_builder, ((guint8*)data) + *offset2, required_size); + gi_typelib_hash_builder_pack (dirindex_builder, ((guint8*)data) + *offset2, required_size); *offset2 = new_offset; - _gi_typelib_hash_builder_destroy (dirindex_builder); + gi_typelib_hash_builder_destroy (dirindex_builder); return data; } GITypelib * -_gi_ir_module_build_typelib (GIIrModule *module) +gi_ir_module_build_typelib (GIIrModule *module) { GError *error = NULL; GITypelib *typelib; @@ -360,7 +360,7 @@ _gi_ir_module_build_typelib (GIIrModule *module) } restart: - _gi_ir_node_init_stats (); + gi_ir_node_init_stats (); strings = g_hash_table_new (g_str_hash, g_str_equal); types = g_hash_table_new (g_str_hash, g_str_equal); nodes_with_attributes = NULL; @@ -378,7 +378,7 @@ _gi_ir_module_build_typelib (GIIrModule *module) { GIIrNode *node = e->data; - size += _gi_ir_node_get_full_size (node); + size += gi_ir_node_get_full_size (node); /* Also reset the offset here */ node->offset = 0; @@ -414,17 +414,17 @@ _gi_ir_module_build_typelib (GIIrModule *module) * the size calculations above. */ if (dependencies != NULL) - header->dependencies = _gi_ir_write_string (dependencies, strings, data, &header_size); + header->dependencies = gi_ir_write_string (dependencies, strings, data, &header_size); else header->dependencies = 0; header->size = 0; /* filled in later */ - header->namespace = _gi_ir_write_string (module->name, strings, data, &header_size); - header->nsversion = _gi_ir_write_string (module->version, strings, data, &header_size); + header->namespace = gi_ir_write_string (module->name, strings, data, &header_size); + header->nsversion = gi_ir_write_string (module->version, strings, data, &header_size); header->shared_library = (module->shared_library? - _gi_ir_write_string (module->shared_library, strings, data, &header_size) + gi_ir_write_string (module->shared_library, strings, data, &header_size) : 0); if (module->c_prefix != NULL) - header->c_prefix = _gi_ir_write_string (module->c_prefix, strings, data, &header_size); + header->c_prefix = gi_ir_write_string (module->c_prefix, strings, data, &header_size); else header->c_prefix = 0; header->entry_blob_size = sizeof (DirEntry); @@ -507,18 +507,18 @@ _gi_ir_module_build_typelib (GIIrModule *module) entry->blob_type = 0; entry->local = FALSE; - entry->offset = _gi_ir_write_string (namespace, strings, data, &offset2); - entry->name = _gi_ir_write_string (node->name, strings, data, &offset2); + entry->offset = gi_ir_write_string (namespace, strings, data, &offset2); + entry->name = gi_ir_write_string (node->name, strings, data, &offset2); } else { old_offset = offset; - offset2 = offset + _gi_ir_node_get_size (node); + offset2 = offset + gi_ir_node_get_size (node); entry->blob_type = node->type; entry->local = TRUE; entry->offset = offset; - entry->name = _gi_ir_write_string (node->name, strings, data, &offset2); + entry->name = gi_ir_write_string (node->name, strings, data, &offset2); memset (&build, 0, sizeof (build)); build.module = module; @@ -527,13 +527,13 @@ _gi_ir_module_build_typelib (GIIrModule *module) build.nodes_with_attributes = nodes_with_attributes; build.n_attributes = header->n_attributes; build.data = data; - _gi_ir_node_build_typelib (node, NULL, &build, &offset, &offset2, NULL); + gi_ir_node_build_typelib (node, NULL, &build, &offset, &offset2, NULL); nodes_with_attributes = build.nodes_with_attributes; header->n_attributes = build.n_attributes; - if (offset2 > old_offset + _gi_ir_node_get_full_size (node)) - g_error ("left a hole of %d bytes\n", offset2 - old_offset - _gi_ir_node_get_full_size (node)); + if (offset2 > old_offset + gi_ir_node_get_full_size (node)) + g_error ("left a hole of %d bytes\n", offset2 - old_offset - gi_ir_node_get_full_size (node)); } entry++; @@ -544,7 +544,7 @@ _gi_ir_module_build_typelib (GIIrModule *module) g_message ("header: %d entries, %d attributes", header->n_entries, header->n_attributes); - _gi_ir_node_dump_stats (); + gi_ir_node_dump_stats (); /* Write attributes after the blobs */ offset = offset2; diff --git a/girepository/girnode-private.h b/girepository/girnode-private.h index 67d2691fd..61a3794f1 100644 --- a/girepository/girnode-private.h +++ b/girepository/girnode-private.h @@ -363,38 +363,38 @@ struct _GIIrNodeUnion }; -GIIrNode *_gi_ir_node_new (GIIrNodeTypeId type, - GIIrModule *module); -void _gi_ir_node_free (GIIrNode *node); -guint32 _gi_ir_node_get_size (GIIrNode *node); -guint32 _gi_ir_node_get_full_size (GIIrNode *node); -void _gi_ir_node_build_typelib (GIIrNode *node, - GIIrNode *parent, - GIIrTypelibBuild *build, - guint32 *offset, - guint32 *offset2, - guint16 *count2); -int _gi_ir_node_cmp (GIIrNode *node, - GIIrNode *other); -gboolean _gi_ir_node_can_have_member (GIIrNode *node); -void _gi_ir_node_add_member (GIIrNode *node, - GIIrNodeFunction *member); -guint32 _gi_ir_write_string (const gchar *str, - GHashTable *strings, - guchar *data, - guint32 *offset); +GIIrNode *gi_ir_node_new (GIIrNodeTypeId type, + GIIrModule *module); +void gi_ir_node_free (GIIrNode *node); +guint32 gi_ir_node_get_size (GIIrNode *node); +guint32 gi_ir_node_get_full_size (GIIrNode *node); +void gi_ir_node_build_typelib (GIIrNode *node, + GIIrNode *parent, + GIIrTypelibBuild *build, + guint32 *offset, + guint32 *offset2, + guint16 *count2); +int gi_ir_node_cmp (GIIrNode *node, + GIIrNode *other); +gboolean gi_ir_node_can_have_member (GIIrNode *node); +void gi_ir_node_add_member (GIIrNode *node, + GIIrNodeFunction *member); +guint32 gi_ir_write_string (const gchar *str, + GHashTable *strings, + guchar *data, + guint32 *offset); -const gchar * _gi_ir_node_param_direction_string (GIIrNodeParam * node); -const gchar * _gi_ir_node_type_to_string (GIIrNodeTypeId type); +const gchar * gi_ir_node_param_direction_string (GIIrNodeParam * node); +const gchar * gi_ir_node_type_to_string (GIIrNodeTypeId type); -GIIrNode *_gi_ir_find_node (GIIrTypelibBuild *build, - GIIrModule *module, - const char *name); +GIIrNode *gi_ir_find_node (GIIrTypelibBuild *build, + GIIrModule *module, + const char *name); /* In giroffsets.c */ -void _gi_ir_node_compute_offsets (GIIrTypelibBuild *build, - GIIrNode *node); +void gi_ir_node_compute_offsets (GIIrTypelibBuild *build, + GIIrNode *node); G_END_DECLS diff --git a/girepository/girnode.c b/girepository/girnode.c index 1c27d8720..004d670e5 100644 --- a/girepository/girnode.c +++ b/girepository/girnode.c @@ -45,7 +45,7 @@ static gulong types_count = 0; static gulong unique_types_count = 0; void -_gi_ir_node_init_stats (void) +gi_ir_node_init_stats (void) { string_count = 0; unique_string_count = 0; @@ -56,7 +56,7 @@ _gi_ir_node_init_stats (void) } void -_gi_ir_node_dump_stats (void) +gi_ir_node_dump_stats (void) { g_message ("%lu strings (%lu before sharing), %lu bytes (%lu before sharing)", unique_string_count, string_count, unique_string_size, string_size); @@ -75,7 +75,7 @@ do { \ const gchar * -_gi_ir_node_type_to_string (GIIrNodeTypeId type) +gi_ir_node_type_to_string (GIIrNodeTypeId type) { switch (type) { @@ -121,8 +121,8 @@ _gi_ir_node_type_to_string (GIIrNodeTypeId type) } GIIrNode * -_gi_ir_node_new (GIIrNodeTypeId type, - GIIrModule *module) +gi_ir_node_new (GIIrNodeTypeId type, + GIIrModule *module) { GIIrNode *node = NULL; @@ -206,7 +206,7 @@ _gi_ir_node_new (GIIrNodeTypeId type, } void -_gi_ir_node_free (GIIrNode *node) +gi_ir_node_free (GIIrNode *node) { GList *l; @@ -223,9 +223,9 @@ _gi_ir_node_free (GIIrNode *node) g_free (node->name); g_free (function->symbol); g_free (function->property); - _gi_ir_node_free ((GIIrNode *)function->result); + gi_ir_node_free ((GIIrNode *)function->result); for (l = function->parameters; l; l = l->next) - _gi_ir_node_free ((GIIrNode *)l->data); + gi_ir_node_free ((GIIrNode *)l->data); g_list_free (function->parameters); } break; @@ -235,8 +235,8 @@ _gi_ir_node_free (GIIrNode *node) GIIrNodeType *type = (GIIrNodeType *)node; g_free (node->name); - _gi_ir_node_free ((GIIrNode *)type->parameter_type1); - _gi_ir_node_free ((GIIrNode *)type->parameter_type2); + gi_ir_node_free ((GIIrNode *)type->parameter_type1); + gi_ir_node_free ((GIIrNode *)type->parameter_type2); g_free (type->giinterface); g_strfreev (type->errors); @@ -249,7 +249,7 @@ _gi_ir_node_free (GIIrNode *node) GIIrNodeParam *param = (GIIrNodeParam *)node; g_free (node->name); - _gi_ir_node_free ((GIIrNode *)param->type); + gi_ir_node_free ((GIIrNode *)param->type); } break; @@ -260,7 +260,7 @@ _gi_ir_node_free (GIIrNode *node) g_free (node->name); g_free (property->setter); g_free (property->getter); - _gi_ir_node_free ((GIIrNode *)property->type); + gi_ir_node_free ((GIIrNode *)property->type); } break; @@ -270,9 +270,9 @@ _gi_ir_node_free (GIIrNode *node) g_free (node->name); for (l = signal->parameters; l; l = l->next) - _gi_ir_node_free ((GIIrNode *)l->data); + gi_ir_node_free ((GIIrNode *)l->data); g_list_free (signal->parameters); - _gi_ir_node_free ((GIIrNode *)signal->result); + gi_ir_node_free ((GIIrNode *)signal->result); } break; @@ -283,9 +283,9 @@ _gi_ir_node_free (GIIrNode *node) g_free (node->name); g_free (vfunc->invoker); for (l = vfunc->parameters; l; l = l->next) - _gi_ir_node_free ((GIIrNode *)l->data); + gi_ir_node_free ((GIIrNode *)l->data); g_list_free (vfunc->parameters); - _gi_ir_node_free ((GIIrNode *)vfunc->result); + gi_ir_node_free ((GIIrNode *)vfunc->result); } break; @@ -294,8 +294,8 @@ _gi_ir_node_free (GIIrNode *node) GIIrNodeField *field = (GIIrNodeField *)node; g_free (node->name); - _gi_ir_node_free ((GIIrNode *)field->type); - _gi_ir_node_free ((GIIrNode *)field->callback); + gi_ir_node_free ((GIIrNode *)field->type); + gi_ir_node_free ((GIIrNode *)field->callback); } break; @@ -321,7 +321,7 @@ _gi_ir_node_free (GIIrNode *node) g_list_free (iface->interfaces); for (l = iface->members; l; l = l->next) - _gi_ir_node_free ((GIIrNode *)l->data); + gi_ir_node_free ((GIIrNode *)l->data); g_list_free (iface->members); } @@ -344,11 +344,11 @@ _gi_ir_node_free (GIIrNode *node) g_free (enum_->error_domain); for (l = enum_->values; l; l = l->next) - _gi_ir_node_free ((GIIrNode *)l->data); + gi_ir_node_free ((GIIrNode *)l->data); g_list_free (enum_->values); for (l = enum_->methods; l; l = l->next) - _gi_ir_node_free ((GIIrNode *)l->data); + gi_ir_node_free ((GIIrNode *)l->data); g_list_free (enum_->methods); } break; @@ -362,7 +362,7 @@ _gi_ir_node_free (GIIrNode *node) g_free (boxed->gtype_init); for (l = boxed->members; l; l = l->next) - _gi_ir_node_free ((GIIrNode *)l->data); + gi_ir_node_free ((GIIrNode *)l->data); g_list_free (boxed->members); } break; @@ -378,7 +378,7 @@ _gi_ir_node_free (GIIrNode *node) g_free (struct_->free_func); for (l = struct_->members; l; l = l->next) - _gi_ir_node_free ((GIIrNode *)l->data); + gi_ir_node_free ((GIIrNode *)l->data); g_list_free (struct_->members); } break; @@ -389,7 +389,7 @@ _gi_ir_node_free (GIIrNode *node) g_free (node->name); g_free (constant->value); - _gi_ir_node_free ((GIIrNode *)constant->type); + gi_ir_node_free ((GIIrNode *)constant->type); } break; @@ -412,11 +412,11 @@ _gi_ir_node_free (GIIrNode *node) g_free (union_->copy_func); g_free (union_->free_func); - _gi_ir_node_free ((GIIrNode *)union_->discriminator_type); + gi_ir_node_free ((GIIrNode *)union_->discriminator_type); for (l = union_->members; l; l = l->next) - _gi_ir_node_free ((GIIrNode *)l->data); + gi_ir_node_free ((GIIrNode *)l->data); for (l = union_->discriminators; l; l = l->next) - _gi_ir_node_free ((GIIrNode *)l->data); + gi_ir_node_free ((GIIrNode *)l->data); } break; @@ -432,7 +432,7 @@ _gi_ir_node_free (GIIrNode *node) /* returns the fixed size of the blob */ guint32 -_gi_ir_node_get_size (GIIrNode *node) +gi_ir_node_get_size (GIIrNode *node) { GList *l; gint size, n; @@ -464,7 +464,7 @@ _gi_ir_node_get_size (GIIrNode *node) size = sizeof (ObjectBlob) + 2 * (n + (n % 2)); for (l = iface->members; l; l = l->next) - size += _gi_ir_node_get_size ((GIIrNode *)l->data); + size += gi_ir_node_get_size ((GIIrNode *)l->data); } break; @@ -476,7 +476,7 @@ _gi_ir_node_get_size (GIIrNode *node) size = sizeof (InterfaceBlob) + 2 * (n + (n % 2)); for (l = iface->members; l; l = l->next) - size += _gi_ir_node_get_size ((GIIrNode *)l->data); + size += gi_ir_node_get_size ((GIIrNode *)l->data); } break; @@ -487,9 +487,9 @@ _gi_ir_node_get_size (GIIrNode *node) size = sizeof (EnumBlob); for (l = enum_->values; l; l = l->next) - size += _gi_ir_node_get_size ((GIIrNode *)l->data); + size += gi_ir_node_get_size ((GIIrNode *)l->data); for (l = enum_->methods; l; l = l->next) - size += _gi_ir_node_get_size ((GIIrNode *)l->data); + size += gi_ir_node_get_size ((GIIrNode *)l->data); } break; @@ -503,7 +503,7 @@ _gi_ir_node_get_size (GIIrNode *node) size = sizeof (StructBlob); for (l = struct_->members; l; l = l->next) - size += _gi_ir_node_get_size ((GIIrNode *)l->data); + size += gi_ir_node_get_size ((GIIrNode *)l->data); } break; @@ -513,7 +513,7 @@ _gi_ir_node_get_size (GIIrNode *node) size = sizeof (StructBlob); for (l = boxed->members; l; l = l->next) - size += _gi_ir_node_get_size ((GIIrNode *)l->data); + size += gi_ir_node_get_size ((GIIrNode *)l->data); } break; @@ -535,7 +535,7 @@ _gi_ir_node_get_size (GIIrNode *node) size = sizeof (FieldBlob); if (field->callback) - size += _gi_ir_node_get_size ((GIIrNode *)field->callback); + size += gi_ir_node_get_size ((GIIrNode *)field->callback); } break; @@ -553,20 +553,20 @@ _gi_ir_node_get_size (GIIrNode *node) size = sizeof (UnionBlob); for (l = union_->members; l; l = l->next) - size += _gi_ir_node_get_size ((GIIrNode *)l->data); + size += gi_ir_node_get_size ((GIIrNode *)l->data); for (l = union_->discriminators; l; l = l->next) - size += _gi_ir_node_get_size ((GIIrNode *)l->data); + size += gi_ir_node_get_size ((GIIrNode *)l->data); } break; default: g_error ("Unhandled node type '%s'\n", - _gi_ir_node_type_to_string (node->type)); + gi_ir_node_type_to_string (node->type)); size = 0; } g_debug ("node %p type '%s' size %d", node, - _gi_ir_node_type_to_string (node->type), size); + gi_ir_node_type_to_string (node->type), size); return size; } @@ -585,8 +585,8 @@ add_attribute_size (gpointer key, gpointer value, gpointer data) /* returns the full size of the blob including variable-size parts (including attributes) */ static guint32 -_gi_ir_node_get_full_size_internal (GIIrNode *parent, - GIIrNode *node) +gi_ir_node_get_full_size_internal (GIIrNode *parent, + GIIrNode *node) { GList *l; gint size, n; @@ -595,7 +595,7 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, g_error ("Caught NULL node, parent=%s", parent->name); g_debug ("node %p type '%s'", node, - _gi_ir_node_type_to_string (node->type)); + gi_ir_node_type_to_string (node->type)); switch (node->type) { @@ -606,9 +606,9 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, size += ALIGN_VALUE (strlen (node->name) + 1, 4); for (l = function->parameters; l; l = l->next) { - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); } - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)function->result); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)function->result); } break; @@ -619,8 +619,8 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, size += ALIGN_VALUE (strlen (node->name) + 1, 4); size += ALIGN_VALUE (strlen (function->symbol) + 1, 4); for (l = function->parameters; l; l = l->next) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)function->result); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)function->result); } break; @@ -632,7 +632,7 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, size = sizeof (ArgBlob) - sizeof (SimpleTypeBlob); if (node->name) size += ALIGN_VALUE (strlen (node->name) + 1, 4); - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)param->type); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)param->type); } break; @@ -650,7 +650,7 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, case GI_TYPE_TAG_ARRAY: size = sizeof (ArrayTypeBlob); if (type->parameter_type1) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)type->parameter_type1); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)type->parameter_type1); break; case GI_TYPE_TAG_INTERFACE: size += sizeof (InterfaceTypeBlob); @@ -659,14 +659,14 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, case GI_TYPE_TAG_GSLIST: size += sizeof (ParamTypeBlob); if (type->parameter_type1) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)type->parameter_type1); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)type->parameter_type1); break; case GI_TYPE_TAG_GHASH: size += sizeof (ParamTypeBlob) * 2; if (type->parameter_type1) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)type->parameter_type1); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)type->parameter_type1); if (type->parameter_type2) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)type->parameter_type2); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)type->parameter_type2); break; case GI_TYPE_TAG_ERROR: size += sizeof (ErrorTypeBlob); @@ -704,7 +704,7 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, size += 2 * (n + (n % 2)); for (l = iface->members; l; l = l->next) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); } break; @@ -720,7 +720,7 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, size += 2 * (n + (n % 2)); for (l = iface->members; l; l = l->next) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); } break; @@ -740,9 +740,9 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, size += ALIGN_VALUE (strlen (enum_->error_domain) + 1, 4); for (l = enum_->values; l; l = l->next) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); for (l = enum_->methods; l; l = l->next) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); } break; @@ -768,7 +768,7 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, if (struct_->free_func) size += ALIGN_VALUE (strlen (struct_->free_func) + 1, 4); for (l = struct_->members; l; l = l->next) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); } break; @@ -784,7 +784,7 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, size += ALIGN_VALUE (strlen (boxed->gtype_init) + 1, 4); } for (l = boxed->members; l; l = l->next) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); } break; @@ -794,7 +794,7 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, size = sizeof (PropertyBlob); size += ALIGN_VALUE (strlen (node->name) + 1, 4); - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)prop->type); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)prop->type); } break; @@ -805,8 +805,8 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, size = sizeof (SignalBlob); size += ALIGN_VALUE (strlen (node->name) + 1, 4); for (l = signal->parameters; l; l = l->next) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)signal->result); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)signal->result); } break; @@ -817,8 +817,8 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, size = sizeof (VFuncBlob); size += ALIGN_VALUE (strlen (node->name) + 1, 4); for (l = vfunc->parameters; l; l = l->next) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)vfunc->result); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)vfunc->result); } break; @@ -829,9 +829,9 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, size = sizeof (FieldBlob); size += ALIGN_VALUE (strlen (node->name) + 1, 4); if (field->callback) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)field->callback); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)field->callback); else - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)field->type); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)field->type); } break; @@ -843,7 +843,7 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, size += ALIGN_VALUE (strlen (node->name) + 1, 4); /* FIXME non-string values */ size += ALIGN_VALUE (strlen (constant->value) + 1, 4); - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)constant->type); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)constant->type); } break; @@ -872,9 +872,9 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, if (union_->free_func) size += ALIGN_VALUE (strlen (union_->free_func) + 1, 4); for (l = union_->members; l; l = l->next) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); for (l = union_->discriminators; l; l = l->next) - size += _gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); + size += gi_ir_node_get_full_size_internal (node, (GIIrNode *)l->data); } break; @@ -887,7 +887,7 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, node->name ? "'" : "", node->name ? node->name : "", node->name ? "' " : "", - node, _gi_ir_node_type_to_string (node->type), size); + node, gi_ir_node_type_to_string (node->type), size); g_hash_table_foreach (node->attributes, add_attribute_size, &size); @@ -895,14 +895,14 @@ _gi_ir_node_get_full_size_internal (GIIrNode *parent, } guint32 -_gi_ir_node_get_full_size (GIIrNode *node) +gi_ir_node_get_full_size (GIIrNode *node) { - return _gi_ir_node_get_full_size_internal (NULL, node); + return gi_ir_node_get_full_size_internal (NULL, node); } int -_gi_ir_node_cmp (GIIrNode *node, - GIIrNode *other) +gi_ir_node_cmp (GIIrNode *node, + GIIrNode *other) { if (node->type < other->type) return -1; @@ -913,7 +913,7 @@ _gi_ir_node_cmp (GIIrNode *node, } gboolean -_gi_ir_node_can_have_member (GIIrNode *node) +gi_ir_node_can_have_member (GIIrNode *node) { switch (node->type) { @@ -949,8 +949,8 @@ _gi_ir_node_can_have_member (GIIrNode *node) } void -_gi_ir_node_add_member (GIIrNode *node, - GIIrNodeFunction *member) +gi_ir_node_add_member (GIIrNode *node, + GIIrNodeFunction *member) { g_return_if_fail (node != NULL); g_return_if_fail (member != NULL); @@ -963,7 +963,7 @@ _gi_ir_node_add_member (GIIrNode *node, GIIrNodeInterface *iface = (GIIrNodeInterface *)node; iface->members = g_list_insert_sorted (iface->members, member, - (GCompareFunc) _gi_ir_node_cmp); + (GCompareFunc) gi_ir_node_cmp); break; } case GI_IR_NODE_BOXED: @@ -971,7 +971,7 @@ _gi_ir_node_add_member (GIIrNode *node, GIIrNodeBoxed *boxed = (GIIrNodeBoxed *)node; boxed->members = g_list_insert_sorted (boxed->members, member, - (GCompareFunc) _gi_ir_node_cmp); + (GCompareFunc) gi_ir_node_cmp); break; } case GI_IR_NODE_STRUCT: @@ -979,7 +979,7 @@ _gi_ir_node_add_member (GIIrNode *node, GIIrNodeStruct *struct_ = (GIIrNodeStruct *)node; struct_->members = g_list_insert_sorted (struct_->members, member, - (GCompareFunc) _gi_ir_node_cmp); + (GCompareFunc) gi_ir_node_cmp); break; } case GI_IR_NODE_UNION: @@ -987,7 +987,7 @@ _gi_ir_node_add_member (GIIrNode *node, GIIrNodeUnion *union_ = (GIIrNodeUnion *)node; union_->members = g_list_insert_sorted (union_->members, member, - (GCompareFunc) _gi_ir_node_cmp); + (GCompareFunc) gi_ir_node_cmp); break; } default: @@ -998,7 +998,7 @@ _gi_ir_node_add_member (GIIrNode *node, } const gchar * -_gi_ir_node_param_direction_string (GIIrNodeParam * node) +gi_ir_node_param_direction_string (GIIrNodeParam * node) { if (node->out) { @@ -1087,7 +1087,7 @@ find_entry_node (GIIrTypelibBuild *build, if (n_names > 1) { - GIIrNode *node = _gi_ir_node_new (GI_IR_NODE_XREF, module); + GIIrNode *node = gi_ir_node_new (GI_IR_NODE_XREF, module); ((GIIrNodeXRef *)node)->namespace = g_strdup (names[0]); node->name = g_strdup (names[1]); @@ -1105,7 +1105,7 @@ find_entry_node (GIIrTypelibBuild *build, } - _gi_ir_module_fatal (build, -1, "type reference '%s' not found", name); + gi_ir_module_fatal (build, -1, "type reference '%s' not found", name); out: g_strfreev (names); @@ -1149,9 +1149,9 @@ find_namespace (GIIrModule *module, } GIIrNode * -_gi_ir_find_node (GIIrTypelibBuild *build, - GIIrModule *src_module, - const char *name) +gi_ir_find_node (GIIrTypelibBuild *build, + GIIrModule *src_module, + const char *name) { GList *l; GIIrNode *return_node = NULL; @@ -1340,14 +1340,14 @@ serialize_type (GIIrTypelibBuild *build, } static void -_gi_ir_node_build_members (GList **members, - GIIrNodeTypeId type, - guint16 *count, - GIIrNode *parent, - GIIrTypelibBuild *build, - guint32 *offset, - guint32 *offset2, - guint16 *count2) +gi_ir_node_build_members (GList **members, + GIIrNodeTypeId type, + guint16 *count, + GIIrNode *parent, + GIIrTypelibBuild *build, + guint32 *offset, + guint32 *offset2, + guint16 *count2) { GList *l = *members; @@ -1359,7 +1359,7 @@ _gi_ir_node_build_members (GList **members, if (member->type == type) { (*count)++; - _gi_ir_node_build_typelib (member, parent, build, offset, offset2, count2); + gi_ir_node_build_typelib (member, parent, build, offset, offset2, count2); *members = g_list_delete_link (*members, l); } l = next; @@ -1367,8 +1367,8 @@ _gi_ir_node_build_members (GList **members, } static void -_gi_ir_node_check_unhandled_members (GList **members, - GIIrNodeTypeId container_type) +gi_ir_node_check_unhandled_members (GList **members, + GIIrNodeTypeId container_type) { #if 0 if (*members) @@ -1379,9 +1379,9 @@ _gi_ir_node_check_unhandled_members (GList **members, { GIIrNode *member = (GIIrNode *)l->data; g_printerr ("Unhandled '%s' member '%s' type '%s'\n", - _gi_ir_node_type_to_string (container_type), + gi_ir_node_type_to_string (container_type), member->name, - _gi_ir_node_type_to_string (member->type)); + gi_ir_node_type_to_string (member->type)); } g_list_free (*members); @@ -1396,12 +1396,12 @@ _gi_ir_node_check_unhandled_members (GList **members, } void -_gi_ir_node_build_typelib (GIIrNode *node, - GIIrNode *parent, - GIIrTypelibBuild *build, - guint32 *offset, - guint32 *offset2, - guint16 *count2) +gi_ir_node_build_typelib (GIIrNode *node, + GIIrNode *parent, + GIIrTypelibBuild *build, + guint32 *offset, + guint32 *offset2, + guint16 *count2) { gboolean appended_stack; GHashTable *strings = build->strings; @@ -1416,7 +1416,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, g_debug ("build_typelib: %s%s(%s)", node->name ? node->name : "", node->name ? " " : "", - _gi_ir_node_type_to_string (node->type)); + gi_ir_node_type_to_string (node->type)); if (build->stack) appended_stack = node != (GIIrNode*)build->stack->data; @@ -1425,7 +1425,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, if (appended_stack) build->stack = g_list_prepend (build->stack, node); - _gi_ir_node_compute_offsets (build, node); + gi_ir_node_compute_offsets (build, node); /* We should only be building each node once. If we do a typelib expansion, we also * reset the offset in girmodule.c. @@ -1501,8 +1501,8 @@ _gi_ir_node_build_typelib (GIIrNode *node, pos = *offset2 + G_STRUCT_OFFSET (ArrayTypeBlob, type); *offset2 += sizeof (ArrayTypeBlob); - _gi_ir_node_build_typelib ((GIIrNode *)type->parameter_type1, - node, build, &pos, offset2, NULL); + gi_ir_node_build_typelib ((GIIrNode *)type->parameter_type1, + node, build, &pos, offset2, NULL); } break; @@ -1535,8 +1535,8 @@ _gi_ir_node_build_typelib (GIIrNode *node, pos = *offset2 + G_STRUCT_OFFSET (ParamTypeBlob, type); *offset2 += sizeof (ParamTypeBlob) + sizeof (SimpleTypeBlob); - _gi_ir_node_build_typelib ((GIIrNode *)type->parameter_type1, - node, build, &pos, offset2, NULL); + gi_ir_node_build_typelib ((GIIrNode *)type->parameter_type1, + node, build, &pos, offset2, NULL); } break; @@ -1554,10 +1554,10 @@ _gi_ir_node_build_typelib (GIIrNode *node, pos = *offset2 + G_STRUCT_OFFSET (ParamTypeBlob, type); *offset2 += sizeof (ParamTypeBlob) + sizeof (SimpleTypeBlob)*2; - _gi_ir_node_build_typelib ((GIIrNode *)type->parameter_type1, - node, build, &pos, offset2, NULL); - _gi_ir_node_build_typelib ((GIIrNode *)type->parameter_type2, - node, build, &pos, offset2, NULL); + gi_ir_node_build_typelib ((GIIrNode *)type->parameter_type1, + node, build, &pos, offset2, NULL); + gi_ir_node_build_typelib ((GIIrNode *)type->parameter_type2, + node, build, &pos, offset2, NULL); } break; @@ -1591,7 +1591,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob = (FieldBlob *)&data[*offset]; - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); + blob->name = gi_ir_write_string (node->name, strings, data, offset2); blob->readable = field->readable; blob->writable = field->writable; blob->reserved = 0; @@ -1606,8 +1606,8 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->has_embedded_type = TRUE; blob->type.offset = GI_INFO_TYPE_CALLBACK; *offset += sizeof (FieldBlob); - _gi_ir_node_build_typelib ((GIIrNode *)field->callback, - node, build, offset, offset2, NULL); + gi_ir_node_build_typelib ((GIIrNode *)field->callback, + node, build, offset, offset2, NULL); /* Fields with callbacks are bigger than normal, update count2 * as an extra hint which represents the number of fields which are * callbacks. This allows us to gain constant time performance in the @@ -1621,8 +1621,8 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->has_embedded_type = FALSE; /* We handle the size member specially below, so subtract it */ *offset += sizeof (FieldBlob) - sizeof (SimpleTypeBlob); - _gi_ir_node_build_typelib ((GIIrNode *)field->type, - node, build, offset, offset2, NULL); + gi_ir_node_build_typelib ((GIIrNode *)field->type, + node, build, offset, offset2, NULL); } } break; @@ -1634,7 +1634,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, /* We handle the size member specially below, so subtract it */ *offset += sizeof (PropertyBlob) - sizeof (SimpleTypeBlob); - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); + blob->name = gi_ir_write_string (node->name, strings, data, offset2); blob->deprecated = prop->deprecated; blob->readable = prop->readable; blob->writable = prop->writable; @@ -1674,8 +1674,8 @@ _gi_ir_node_build_typelib (GIIrNode *node, else blob->getter = ACCESSOR_SENTINEL; - _gi_ir_node_build_typelib ((GIIrNode *)prop->type, - node, build, offset, offset2, NULL); + gi_ir_node_build_typelib ((GIIrNode *)prop->type, + node, build, offset, offset2, NULL); } break; @@ -1702,8 +1702,8 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->wraps_vfunc = function->wraps_vfunc; blob->throws = function->throws; /* Deprecated. Also stored in SignatureBlob. */ blob->index = 0; - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); - blob->symbol = _gi_ir_write_string (function->symbol, strings, data, offset2); + blob->name = gi_ir_write_string (node->name, strings, data, offset2); + blob->symbol = gi_ir_write_string (function->symbol, strings, data, offset2); blob->signature = signature; if (function->is_setter || function->is_getter) @@ -1731,8 +1731,8 @@ _gi_ir_node_build_typelib (GIIrNode *node, g_debug ("building function '%s'", function->symbol); - _gi_ir_node_build_typelib ((GIIrNode *)function->result->type, - node, build, &signature, offset2, NULL); + gi_ir_node_build_typelib ((GIIrNode *)function->result->type, + node, build, &signature, offset2, NULL); blob2->may_return_null = function->result->nullable; blob2->caller_owns_return_value = function->result->transfer; @@ -1749,7 +1749,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, { GIIrNode *param = (GIIrNode *)l->data; - _gi_ir_node_build_typelib (param, node, build, &signature, offset2, NULL); + gi_ir_node_build_typelib (param, node, build, &signature, offset2, NULL); } } @@ -1772,11 +1772,11 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->blob_type = BLOB_TYPE_CALLBACK; blob->deprecated = function->deprecated; blob->reserved = 0; - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); + blob->name = gi_ir_write_string (node->name, strings, data, offset2); blob->signature = signature; - _gi_ir_node_build_typelib ((GIIrNode *)function->result->type, - node, build, &signature, offset2, NULL); + gi_ir_node_build_typelib ((GIIrNode *)function->result->type, + node, build, &signature, offset2, NULL); blob2->may_return_null = function->result->nullable; blob2->caller_owns_return_value = function->result->transfer; @@ -1791,7 +1791,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, { GIIrNode *param = (GIIrNode *)l->data; - _gi_ir_node_build_typelib (param, node, build, &signature, offset2, NULL); + gi_ir_node_build_typelib (param, node, build, &signature, offset2, NULL); } } break; @@ -1822,7 +1822,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->true_stops_emit = 0; /* FIXME */ blob->reserved = 0; blob->class_closure = 0; /* FIXME */ - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); + blob->name = gi_ir_write_string (node->name, strings, data, offset2); blob->signature = signature; /* signal->result is special since it doesn't appear in the serialized format but @@ -1833,8 +1833,8 @@ _gi_ir_node_build_typelib (GIIrNode *node, g_assert (((GIIrNode *) signal->result)->offset == 0); ((GIIrNode *) signal->result)->offset = signature; - _gi_ir_node_build_typelib ((GIIrNode *)signal->result->type, - node, build, &signature, offset2, NULL); + gi_ir_node_build_typelib ((GIIrNode *)signal->result->type, + node, build, &signature, offset2, NULL); blob2->may_return_null = signal->result->nullable; blob2->caller_owns_return_value = signal->result->transfer; @@ -1849,7 +1849,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, { GIIrNode *param = (GIIrNode *)l->data; - _gi_ir_node_build_typelib (param, node, build, &signature, offset2, NULL); + gi_ir_node_build_typelib (param, node, build, &signature, offset2, NULL); } } break; @@ -1868,7 +1868,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, *offset += sizeof (VFuncBlob); *offset2 += sizeof (SignatureBlob) + n * sizeof (ArgBlob); - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); + blob->name = gi_ir_write_string (node->name, strings, data, offset2); blob->must_chain_up = 0; /* FIXME */ blob->must_be_implemented = 0; /* FIXME */ blob->must_not_be_implemented = 0; /* FIXME */ @@ -1892,8 +1892,8 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->reserved2 = 0; blob->signature = signature; - _gi_ir_node_build_typelib ((GIIrNode *)vfunc->result->type, - node, build, &signature, offset2, NULL); + gi_ir_node_build_typelib ((GIIrNode *)vfunc->result->type, + node, build, &signature, offset2, NULL); blob2->may_return_null = vfunc->result->nullable; blob2->caller_owns_return_value = vfunc->result->transfer; @@ -1909,7 +1909,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, { GIIrNode *param = (GIIrNode *)l->data; - _gi_ir_node_build_typelib (param, node, build, &signature, offset2, NULL); + gi_ir_node_build_typelib (param, node, build, &signature, offset2, NULL); } } break; @@ -1924,7 +1924,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, */ *offset += sizeof (ArgBlob) - sizeof (SimpleTypeBlob); - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); + blob->name = gi_ir_write_string (node->name, strings, data, offset2); blob->in = param->in; blob->out = param->out; blob->caller_allocates = param->caller_allocates; @@ -1939,7 +1939,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->closure = param->closure; blob->destroy = param->destroy; - _gi_ir_node_build_typelib ((GIIrNode *)param->type, node, build, offset, offset2, NULL); + gi_ir_node_build_typelib ((GIIrNode *)param->type, node, build, offset, offset2, NULL); } break; @@ -1954,15 +1954,15 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->deprecated = struct_->deprecated; blob->is_gtype_struct = struct_->is_gtype_struct; blob->reserved = 0; - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); + blob->name = gi_ir_write_string (node->name, strings, data, offset2); blob->alignment = struct_->alignment; blob->size = struct_->size; if (struct_->gtype_name) { blob->unregistered = FALSE; - blob->gtype_name = _gi_ir_write_string (struct_->gtype_name, strings, data, offset2); - blob->gtype_init = _gi_ir_write_string (struct_->gtype_init, strings, data, offset2); + blob->gtype_name = gi_ir_write_string (struct_->gtype_name, strings, data, offset2); + blob->gtype_init = gi_ir_write_string (struct_->gtype_init, strings, data, offset2); } else { @@ -1972,9 +1972,9 @@ _gi_ir_node_build_typelib (GIIrNode *node, } if (struct_->copy_func) - blob->copy_func = _gi_ir_write_string (struct_->copy_func, strings, data, offset2); + blob->copy_func = gi_ir_write_string (struct_->copy_func, strings, data, offset2); if (struct_->free_func) - blob->free_func = _gi_ir_write_string (struct_->free_func, strings, data, offset2); + blob->free_func = gi_ir_write_string (struct_->free_func, strings, data, offset2); blob->n_fields = 0; blob->n_methods = 0; @@ -1983,13 +1983,13 @@ _gi_ir_node_build_typelib (GIIrNode *node, members = g_list_copy (struct_->members); - _gi_ir_node_build_members (&members, GI_IR_NODE_FIELD, &blob->n_fields, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_FIELD, &blob->n_fields, + node, build, offset, offset2, NULL); - _gi_ir_node_build_members (&members, GI_IR_NODE_FUNCTION, &blob->n_methods, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_FUNCTION, &blob->n_methods, + node, build, offset, offset2, NULL); - _gi_ir_node_check_unhandled_members (&members, node->type); + gi_ir_node_check_unhandled_members (&members, node->type); g_assert (members == NULL); } @@ -2005,9 +2005,9 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->deprecated = boxed->deprecated; blob->unregistered = FALSE; blob->reserved = 0; - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); - blob->gtype_name = _gi_ir_write_string (boxed->gtype_name, strings, data, offset2); - blob->gtype_init = _gi_ir_write_string (boxed->gtype_init, strings, data, offset2); + blob->name = gi_ir_write_string (node->name, strings, data, offset2); + blob->gtype_name = gi_ir_write_string (boxed->gtype_name, strings, data, offset2); + blob->gtype_init = gi_ir_write_string (boxed->gtype_init, strings, data, offset2); blob->alignment = boxed->alignment; blob->size = boxed->size; @@ -2018,13 +2018,13 @@ _gi_ir_node_build_typelib (GIIrNode *node, members = g_list_copy (boxed->members); - _gi_ir_node_build_members (&members, GI_IR_NODE_FIELD, &blob->n_fields, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_FIELD, &blob->n_fields, + node, build, offset, offset2, NULL); - _gi_ir_node_build_members (&members, GI_IR_NODE_FUNCTION, &blob->n_methods, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_FUNCTION, &blob->n_methods, + node, build, offset, offset2, NULL); - _gi_ir_node_check_unhandled_members (&members, node->type); + gi_ir_node_check_unhandled_members (&members, node->type); g_assert (members == NULL); } @@ -2039,14 +2039,14 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->blob_type = BLOB_TYPE_UNION; blob->deprecated = union_->deprecated; blob->reserved = 0; - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); + blob->name = gi_ir_write_string (node->name, strings, data, offset2); blob->alignment = union_->alignment; blob->size = union_->size; if (union_->gtype_name) { blob->unregistered = FALSE; - blob->gtype_name = _gi_ir_write_string (union_->gtype_name, strings, data, offset2); - blob->gtype_init = _gi_ir_write_string (union_->gtype_init, strings, data, offset2); + blob->gtype_name = gi_ir_write_string (union_->gtype_name, strings, data, offset2); + blob->gtype_init = gi_ir_write_string (union_->gtype_init, strings, data, offset2); } else { @@ -2061,9 +2061,9 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->discriminator_offset = union_->discriminator_offset; if (union_->copy_func) - blob->copy_func = _gi_ir_write_string (union_->copy_func, strings, data, offset2); + blob->copy_func = gi_ir_write_string (union_->copy_func, strings, data, offset2); if (union_->free_func) - blob->free_func = _gi_ir_write_string (union_->free_func, strings, data, offset2); + blob->free_func = gi_ir_write_string (union_->free_func, strings, data, offset2); /* We don't support Union discriminators right now. */ /* @@ -2071,8 +2071,8 @@ _gi_ir_node_build_typelib (GIIrNode *node, { *offset += 28; blob->discriminated = TRUE; - _gi_ir_node_build_typelib ((GIIrNode *)union_->discriminator_type, - build, offset, offset2, NULL); + gi_ir_node_build_typelib ((GIIrNode *)union_->discriminator_type, + build, offset, offset2, NULL); } else { @@ -2083,13 +2083,13 @@ _gi_ir_node_build_typelib (GIIrNode *node, members = g_list_copy (union_->members); - _gi_ir_node_build_members (&members, GI_IR_NODE_FIELD, &blob->n_fields, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_FIELD, &blob->n_fields, + node, build, offset, offset2, NULL); - _gi_ir_node_build_members (&members, GI_IR_NODE_FUNCTION, &blob->n_functions, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_FUNCTION, &blob->n_functions, + node, build, offset, offset2, NULL); - _gi_ir_node_check_unhandled_members (&members, node->type); + gi_ir_node_check_unhandled_members (&members, node->type); g_assert (members == NULL); @@ -2099,7 +2099,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, { GIIrNode *member = (GIIrNode *)l->data; - _gi_ir_node_build_typelib (member, node, build, offset, offset2, NULL); + gi_ir_node_build_typelib (member, node, build, offset, offset2, NULL); } } } @@ -2121,12 +2121,12 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->deprecated = enum_->deprecated; blob->reserved = 0; blob->storage_type = enum_->storage_type; - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); + blob->name = gi_ir_write_string (node->name, strings, data, offset2); if (enum_->gtype_name) { blob->unregistered = FALSE; - blob->gtype_name = _gi_ir_write_string (enum_->gtype_name, strings, data, offset2); - blob->gtype_init = _gi_ir_write_string (enum_->gtype_init, strings, data, offset2); + blob->gtype_name = gi_ir_write_string (enum_->gtype_name, strings, data, offset2); + blob->gtype_init = gi_ir_write_string (enum_->gtype_init, strings, data, offset2); } else { @@ -2135,7 +2135,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->gtype_init = 0; } if (enum_->error_domain) - blob->error_domain = _gi_ir_write_string (enum_->error_domain, strings, data, offset2); + blob->error_domain = gi_ir_write_string (enum_->error_domain, strings, data, offset2); else blob->error_domain = 0; @@ -2147,7 +2147,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, GIIrNode *value = (GIIrNode *)l->data; blob->n_values++; - _gi_ir_node_build_typelib (value, node, build, offset, offset2, NULL); + gi_ir_node_build_typelib (value, node, build, offset, offset2, NULL); } for (l = enum_->methods; l; l = l->next) @@ -2155,7 +2155,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, GIIrNode *method = (GIIrNode *)l->data; blob->n_methods++; - _gi_ir_node_build_typelib (method, node, build, offset, offset2, NULL); + gi_ir_node_build_typelib (method, node, build, offset, offset2, NULL); } } break; @@ -2172,17 +2172,17 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->final_ = object->final_; blob->deprecated = object->deprecated; blob->reserved = 0; - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); - blob->gtype_name = _gi_ir_write_string (object->gtype_name, strings, data, offset2); - blob->gtype_init = _gi_ir_write_string (object->gtype_init, strings, data, offset2); + blob->name = gi_ir_write_string (node->name, strings, data, offset2); + blob->gtype_name = gi_ir_write_string (object->gtype_name, strings, data, offset2); + blob->gtype_init = gi_ir_write_string (object->gtype_init, strings, data, offset2); if (object->ref_func) - blob->ref_func = _gi_ir_write_string (object->ref_func, strings, data, offset2); + blob->ref_func = gi_ir_write_string (object->ref_func, strings, data, offset2); if (object->unref_func) - blob->unref_func = _gi_ir_write_string (object->unref_func, strings, data, offset2); + blob->unref_func = gi_ir_write_string (object->unref_func, strings, data, offset2); if (object->set_value_func) - blob->set_value_func = _gi_ir_write_string (object->set_value_func, strings, data, offset2); + blob->set_value_func = gi_ir_write_string (object->set_value_func, strings, data, offset2); if (object->get_value_func) - blob->get_value_func = _gi_ir_write_string (object->get_value_func, strings, data, offset2); + blob->get_value_func = gi_ir_write_string (object->get_value_func, strings, data, offset2); if (object->parent) blob->parent = find_entry (build, object->parent); else @@ -2212,30 +2212,30 @@ _gi_ir_node_build_typelib (GIIrNode *node, members = g_list_copy (object->members); *offset = ALIGN_VALUE (*offset, 4); - _gi_ir_node_build_members (&members, GI_IR_NODE_FIELD, &blob->n_fields, - node, build, offset, offset2, &blob->n_field_callbacks); + gi_ir_node_build_members (&members, GI_IR_NODE_FIELD, &blob->n_fields, + node, build, offset, offset2, &blob->n_field_callbacks); *offset = ALIGN_VALUE (*offset, 4); - _gi_ir_node_build_members (&members, GI_IR_NODE_PROPERTY, &blob->n_properties, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_PROPERTY, &blob->n_properties, + node, build, offset, offset2, NULL); *offset = ALIGN_VALUE (*offset, 4); - _gi_ir_node_build_members (&members, GI_IR_NODE_FUNCTION, &blob->n_methods, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_FUNCTION, &blob->n_methods, + node, build, offset, offset2, NULL); *offset = ALIGN_VALUE (*offset, 4); - _gi_ir_node_build_members (&members, GI_IR_NODE_SIGNAL, &blob->n_signals, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_SIGNAL, &blob->n_signals, + node, build, offset, offset2, NULL); *offset = ALIGN_VALUE (*offset, 4); - _gi_ir_node_build_members (&members, GI_IR_NODE_VFUNC, &blob->n_vfuncs, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_VFUNC, &blob->n_vfuncs, + node, build, offset, offset2, NULL); *offset = ALIGN_VALUE (*offset, 4); - _gi_ir_node_build_members (&members, GI_IR_NODE_CONSTANT, &blob->n_constants, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_CONSTANT, &blob->n_constants, + node, build, offset, offset2, NULL); - _gi_ir_node_check_unhandled_members (&members, node->type); + gi_ir_node_check_unhandled_members (&members, node->type); g_assert (members == NULL); } @@ -2250,9 +2250,9 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->blob_type = BLOB_TYPE_INTERFACE; blob->deprecated = iface->deprecated; blob->reserved = 0; - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); - blob->gtype_name = _gi_ir_write_string (iface->gtype_name, strings, data, offset2); - blob->gtype_init = _gi_ir_write_string (iface->gtype_init, strings, data, offset2); + blob->name = gi_ir_write_string (node->name, strings, data, offset2); + blob->gtype_name = gi_ir_write_string (iface->gtype_name, strings, data, offset2); + blob->gtype_init = gi_ir_write_string (iface->gtype_init, strings, data, offset2); if (iface->glib_type_struct) blob->gtype_struct = find_entry (build, iface->glib_type_struct); else @@ -2275,26 +2275,26 @@ _gi_ir_node_build_typelib (GIIrNode *node, members = g_list_copy (iface->members); *offset = ALIGN_VALUE (*offset, 4); - _gi_ir_node_build_members (&members, GI_IR_NODE_PROPERTY, &blob->n_properties, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_PROPERTY, &blob->n_properties, + node, build, offset, offset2, NULL); *offset = ALIGN_VALUE (*offset, 4); - _gi_ir_node_build_members (&members, GI_IR_NODE_FUNCTION, &blob->n_methods, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_FUNCTION, &blob->n_methods, + node, build, offset, offset2, NULL); *offset = ALIGN_VALUE (*offset, 4); - _gi_ir_node_build_members (&members, GI_IR_NODE_SIGNAL, &blob->n_signals, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_SIGNAL, &blob->n_signals, + node, build, offset, offset2, NULL); *offset = ALIGN_VALUE (*offset, 4); - _gi_ir_node_build_members (&members, GI_IR_NODE_VFUNC, &blob->n_vfuncs, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_VFUNC, &blob->n_vfuncs, + node, build, offset, offset2, NULL); *offset = ALIGN_VALUE (*offset, 4); - _gi_ir_node_build_members (&members, GI_IR_NODE_CONSTANT, &blob->n_constants, - node, build, offset, offset2, NULL); + gi_ir_node_build_members (&members, GI_IR_NODE_CONSTANT, &blob->n_constants, + node, build, offset, offset2, NULL); - _gi_ir_node_check_unhandled_members (&members, node->type); + gi_ir_node_check_unhandled_members (&members, node->type); g_assert (members == NULL); } @@ -2310,7 +2310,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->deprecated = value->deprecated; blob->reserved = 0; blob->unsigned_value = value->value >= 0 ? 1 : 0; - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); + blob->name = gi_ir_write_string (node->name, strings, data, offset2); blob->value = (gint32)value->value; } break; @@ -2327,7 +2327,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, blob->blob_type = BLOB_TYPE_CONSTANT; blob->deprecated = constant->deprecated; blob->reserved = 0; - blob->name = _gi_ir_write_string (node->name, strings, data, offset2); + blob->name = gi_ir_write_string (node->name, strings, data, offset2); blob->offset = *offset2; switch (constant->type->tag) @@ -2386,7 +2386,7 @@ _gi_ir_node_build_typelib (GIIrNode *node, } *offset2 += ALIGN_VALUE (blob->size, 4); - _gi_ir_node_build_typelib ((GIIrNode *)constant->type, node, build, &pos, offset2, NULL); + gi_ir_node_build_typelib ((GIIrNode *)constant->type, node, build, &pos, offset2, NULL); } break; default: @@ -2397,12 +2397,12 @@ _gi_ir_node_build_typelib (GIIrNode *node, node->name ? "'" : "", node->name ? node->name : "", node->name ? "' " : "", - node, _gi_ir_node_type_to_string (node->type), + node, gi_ir_node_type_to_string (node->type), old_offset, *offset, old_offset2, *offset2); - if (*offset2 - old_offset2 + *offset - old_offset > _gi_ir_node_get_full_size (node)) + if (*offset2 - old_offset2 + *offset - old_offset > gi_ir_node_get_full_size (node)) g_error ("exceeding space reservation; offset: %d (prev %d) offset2: %d (prev %d) nodesize: %d", - *offset, old_offset, *offset2, old_offset2, _gi_ir_node_get_full_size (node)); + *offset, old_offset, *offset2, old_offset2, gi_ir_node_get_full_size (node)); if (appended_stack) build->stack = g_list_delete_link (build->stack, build->stack); @@ -2413,10 +2413,10 @@ _gi_ir_node_build_typelib (GIIrNode *node, * typelib is not large enough to hold the string, reallocate it. */ guint32 -_gi_ir_write_string (const gchar *str, - GHashTable *strings, - guchar *data, - guint32 *offset) +gi_ir_write_string (const gchar *str, + GHashTable *strings, + guchar *data, + guint32 *offset) { gpointer value; guint32 start; diff --git a/girepository/giroffsets.c b/girepository/giroffsets.c index 2fa2a1e18..1e7271538 100644 --- a/girepository/giroffsets.c +++ b/girepository/giroffsets.c @@ -194,16 +194,16 @@ get_interface_size_alignment (GIIrTypelibBuild *build, { GIIrNode *iface; - iface = _gi_ir_find_node (build, ((GIIrNode*)type)->module, type->giinterface); + iface = gi_ir_find_node (build, ((GIIrNode*)type)->module, type->giinterface); if (!iface) { - _gi_ir_module_fatal (build, 0, "Can't resolve type '%s' for %s", type->giinterface, who); + gi_ir_module_fatal (build, 0, "Can't resolve type '%s' for %s", type->giinterface, who); *size = -1; *alignment = -1; return FALSE; } - _gi_ir_node_compute_offsets (build, iface); + gi_ir_node_compute_offsets (build, iface); switch (iface->type) { @@ -252,7 +252,7 @@ get_interface_size_alignment (GIIrTypelibBuild *build, { g_warning ("%s has is not a pointer and is of type %s", who, - _gi_ir_node_type_to_string (iface->type)); + gi_ir_node_type_to_string (iface->type)); *size = -1; *alignment = -1; break; @@ -502,7 +502,7 @@ check_needs_computation (GIIrTypelibBuild *build, } /* - * _gi_ir_node_compute_offsets: + * gi_ir_node_compute_offsets: * @build: Current typelib build * @node: a #GIIrNode * @@ -511,8 +511,8 @@ check_needs_computation (GIIrTypelibBuild *build, * alignment for the type. */ void -_gi_ir_node_compute_offsets (GIIrTypelibBuild *build, - GIIrNode *node) +gi_ir_node_compute_offsets (GIIrTypelibBuild *build, + GIIrNode *node) { gboolean appended_stack; diff --git a/girepository/girparser-private.h b/girepository/girparser-private.h index 6683ce6b1..a2dcb6a85 100644 --- a/girepository/girparser-private.h +++ b/girepository/girparser-private.h @@ -31,19 +31,19 @@ G_BEGIN_DECLS typedef struct _GIIrParser GIIrParser; -GIIrParser *_gi_ir_parser_new (void); -void _gi_ir_parser_free (GIIrParser *parser); -void _gi_ir_parser_set_includes (GIIrParser *parser, - const gchar *const *includes); +GIIrParser *gi_ir_parser_new (void); +void gi_ir_parser_free (GIIrParser *parser); +void gi_ir_parser_set_includes (GIIrParser *parser, + const gchar *const *includes); -GIIrModule *_gi_ir_parser_parse_string (GIIrParser *parser, - const gchar *namespace, - const gchar *filename, - const gchar *buffer, - gssize length, - GError **error); -GIIrModule *_gi_ir_parser_parse_file (GIIrParser *parser, - const gchar *filename, - GError **error); +GIIrModule *gi_ir_parser_parse_string (GIIrParser *parser, + const gchar *namespace, + const gchar *filename, + const gchar *buffer, + gssize length, + GError **error); +GIIrModule *gi_ir_parser_parse_file (GIIrParser *parser, + const gchar *filename, + GError **error); G_END_DECLS diff --git a/girepository/girparser.c b/girepository/girparser.c index fd360f189..60160514d 100644 --- a/girepository/girparser.c +++ b/girepository/girparser.c @@ -183,7 +183,7 @@ static const gchar *find_attribute (const gchar *name, GIIrParser * -_gi_ir_parser_new (void) +gi_ir_parser_new (void) { GIIrParser *parser = g_slice_new0 (GIIrParser); const char *gi_gir_path = g_getenv ("GI_GIR_PATH"); @@ -195,7 +195,7 @@ _gi_ir_parser_new (void) } void -_gi_ir_parser_free (GIIrParser *parser) +gi_ir_parser_free (GIIrParser *parser) { GList *l; @@ -203,14 +203,14 @@ _gi_ir_parser_free (GIIrParser *parser) g_strfreev (parser->gi_gir_path); for (l = parser->parsed_modules; l; l = l->next) - _gi_ir_module_free (l->data); + gi_ir_module_free (l->data); g_slice_free (GIIrParser, parser); } void -_gi_ir_parser_set_includes (GIIrParser *parser, - const gchar *const *includes) +gi_ir_parser_set_includes (GIIrParser *parser, + const gchar *const *includes) { g_strfreev (parser->includes); @@ -541,7 +541,7 @@ parse_type_internal (GIIrModule *module, GIIrNodeType *type; char *temporary_type = NULL; - type = (GIIrNodeType *)_gi_ir_node_new (GI_IR_NODE_TYPE, module); + type = (GIIrNodeType *)gi_ir_node_new (GI_IR_NODE_TYPE, module); type->unparsed = g_strdup (str); @@ -670,7 +670,7 @@ parse_type_internal (GIIrModule *module, return type; /* error: */ - _gi_ir_node_free ((GIIrNode *)type); + gi_ir_node_free ((GIIrNode *)type); g_free (temporary_type); return NULL; } @@ -835,8 +835,8 @@ start_glib_boxed (GMarkupParseContext *context, return FALSE; } - boxed = (GIIrNodeBoxed *) _gi_ir_node_new (GI_IR_NODE_BOXED, - ctx->current_module); + boxed = (GIIrNodeBoxed *) gi_ir_node_new (GI_IR_NODE_BOXED, + ctx->current_module); ((GIIrNode *)boxed)->name = g_strdup (name); boxed->gtype_name = g_strdup (typename); @@ -933,8 +933,8 @@ start_function (GMarkupParseContext *context, if (shadows) name = shadows; - function = (GIIrNodeFunction *) _gi_ir_node_new (GI_IR_NODE_FUNCTION, - ctx->current_module); + function = (GIIrNodeFunction *) gi_ir_node_new (GI_IR_NODE_FUNCTION, + ctx->current_module); ((GIIrNode *)function)->name = g_strdup (name); function->symbol = g_strdup (symbol); @@ -1237,8 +1237,8 @@ start_parameter (GMarkupParseContext *context, if (name == NULL) name = "unknown"; - param = (GIIrNodeParam *)_gi_ir_node_new (GI_IR_NODE_PARAM, - ctx->current_module); + param = (GIIrNodeParam *)gi_ir_node_new (GI_IR_NODE_PARAM, + ctx->current_module); ctx->current_typed = (GIIrNode*) param; ctx->current_typed->name = g_strdup (name); @@ -1408,8 +1408,8 @@ start_field (GMarkupParseContext *context, return FALSE; } - field = (GIIrNodeField *)_gi_ir_node_new (GI_IR_NODE_FIELD, - ctx->current_module); + field = (GIIrNodeField *)gi_ir_node_new (GI_IR_NODE_FIELD, + ctx->current_module); if (introspectable) { ctx->current_typed = (GIIrNode*) field; @@ -1475,8 +1475,8 @@ start_field (GMarkupParseContext *context, { GIIrNodeConstant *constant; - constant = (GIIrNodeConstant *) _gi_ir_node_new (GI_IR_NODE_CONSTANT, - ctx->current_module); + constant = (GIIrNodeConstant *) gi_ir_node_new (GI_IR_NODE_CONSTANT, + ctx->current_module); ((GIIrNode *)constant)->name = g_strdup (name); constant->value = g_strdup (branch); constant->type = union_->discriminator_type; @@ -1551,11 +1551,11 @@ start_enum (GMarkupParseContext *context, } if (strcmp (element_name, "enumeration") == 0) - enum_ = (GIIrNodeEnum *) _gi_ir_node_new (GI_IR_NODE_ENUM, - ctx->current_module); + enum_ = (GIIrNodeEnum *) gi_ir_node_new (GI_IR_NODE_ENUM, + ctx->current_module); else - enum_ = (GIIrNodeEnum *) _gi_ir_node_new (GI_IR_NODE_FLAGS, - ctx->current_module); + enum_ = (GIIrNodeEnum *) gi_ir_node_new (GI_IR_NODE_FLAGS, + ctx->current_module); ((GIIrNode *)enum_)->name = g_strdup (name); enum_->gtype_name = g_strdup (typename); enum_->gtype_init = g_strdup (typeinit); @@ -1624,8 +1624,8 @@ start_property (GMarkupParseContext *context, return FALSE; } - property = (GIIrNodeProperty *) _gi_ir_node_new (GI_IR_NODE_PROPERTY, - ctx->current_module); + property = (GIIrNodeProperty *) gi_ir_node_new (GI_IR_NODE_PROPERTY, + ctx->current_module); ctx->current_typed = (GIIrNode*) property; ((GIIrNode *)property)->name = g_strdup (name); @@ -1712,8 +1712,8 @@ start_member (GMarkupParseContext *context, return FALSE; } - value_ = (GIIrNodeValue *) _gi_ir_node_new (GI_IR_NODE_VALUE, - ctx->current_module); + value_ = (GIIrNodeValue *) gi_ir_node_new (GI_IR_NODE_VALUE, + ctx->current_module); ((GIIrNode *)value_)->name = g_strdup (name); @@ -1790,8 +1790,8 @@ start_constant (GMarkupParseContext *context, return FALSE; } - constant = (GIIrNodeConstant *) _gi_ir_node_new (GI_IR_NODE_CONSTANT, - ctx->current_module); + constant = (GIIrNodeConstant *) gi_ir_node_new (GI_IR_NODE_CONSTANT, + ctx->current_module); ((GIIrNode *)constant)->name = g_strdup (name); constant->value = g_strdup (value); @@ -1864,8 +1864,8 @@ start_interface (GMarkupParseContext *context, return FALSE; } - iface = (GIIrNodeInterface *) _gi_ir_node_new (GI_IR_NODE_INTERFACE, - ctx->current_module); + iface = (GIIrNodeInterface *) gi_ir_node_new (GI_IR_NODE_INTERFACE, + ctx->current_module); ((GIIrNode *)iface)->name = g_strdup (name); iface->gtype_name = g_strdup (typename); iface->gtype_init = g_strdup (typeinit); @@ -1942,8 +1942,8 @@ start_class (GMarkupParseContext *context, return FALSE; } - iface = (GIIrNodeInterface *) _gi_ir_node_new (GI_IR_NODE_OBJECT, - ctx->current_module); + iface = (GIIrNodeInterface *) gi_ir_node_new (GI_IR_NODE_OBJECT, + ctx->current_module); ((GIIrNode *)iface)->name = g_strdup (name); iface->gtype_name = g_strdup (typename); iface->gtype_init = g_strdup (typeinit); @@ -2080,8 +2080,8 @@ start_type (GMarkupParseContext *context, const char *len; const char *size; - typenode = (GIIrNodeType *)_gi_ir_node_new (GI_IR_NODE_TYPE, - ctx->current_module); + typenode = (GIIrNodeType *)gi_ir_node_new (GI_IR_NODE_TYPE, + ctx->current_module); typenode->tag = GI_TYPE_TAG_ARRAY; typenode->is_pointer = TRUE; @@ -2359,8 +2359,8 @@ start_return_value (GMarkupParseContext *context, ctx->state == STATE_FUNCTION)) return FALSE; - param = (GIIrNodeParam *)_gi_ir_node_new (GI_IR_NODE_PARAM, - ctx->current_module); + param = (GIIrNodeParam *)gi_ir_node_new (GI_IR_NODE_PARAM, + ctx->current_module); param->in = FALSE; param->out = FALSE; param->retval = TRUE; @@ -2480,8 +2480,8 @@ start_glib_signal (GMarkupParseContext *context, MISSING_ATTRIBUTE (context, error, element_name, "name"); return FALSE; } - signal = (GIIrNodeSignal *)_gi_ir_node_new (GI_IR_NODE_SIGNAL, - ctx->current_module); + signal = (GIIrNodeSignal *)gi_ir_node_new (GI_IR_NODE_SIGNAL, + ctx->current_module); ((GIIrNode *)signal)->name = g_strdup (name); @@ -2564,8 +2564,8 @@ start_vfunc (GMarkupParseContext *context, return FALSE; } - vfunc = (GIIrNodeVFunc *)_gi_ir_node_new (GI_IR_NODE_VFUNC, - ctx->current_module); + vfunc = (GIIrNodeVFunc *)gi_ir_node_new (GI_IR_NODE_VFUNC, + ctx->current_module); ((GIIrNode *)vfunc)->name = g_strdup (name); @@ -2674,8 +2674,8 @@ start_struct (GMarkupParseContext *context, return FALSE; } - struct_ = (GIIrNodeStruct *) _gi_ir_node_new (GI_IR_NODE_STRUCT, - ctx->current_module); + struct_ = (GIIrNodeStruct *) gi_ir_node_new (GI_IR_NODE_STRUCT, + ctx->current_module); ((GIIrNode *)struct_)->name = g_strdup (name ? name : ""); if (deprecated) @@ -2748,8 +2748,8 @@ start_union (GMarkupParseContext *context, return FALSE; } - union_ = (GIIrNodeUnion *) _gi_ir_node_new (GI_IR_NODE_UNION, - ctx->current_module); + union_ = (GIIrNodeUnion *) gi_ir_node_new (GI_IR_NODE_UNION, + ctx->current_module); ((GIIrNode *)union_)->name = g_strdup (name ? name : ""); union_->gtype_name = g_strdup (typename); @@ -2859,7 +2859,7 @@ parse_include (GMarkupParseContext *context, return FALSE; } - module = _gi_ir_parser_parse_string (ctx->parser, name, girpath, buffer, length, &error); + module = gi_ir_parser_parse_string (ctx->parser, name, girpath, buffer, length, &error); g_free (buffer); if (error != NULL) { @@ -3106,7 +3106,7 @@ start_element_handler (GMarkupParseContext *context, " name element '%s' doesn't match file name '%s'", name, ctx->namespace); - ctx->current_module = _gi_ir_module_new (name, version, shared_library, cprefix); + ctx->current_module = gi_ir_module_new (name, version, shared_library, cprefix); ctx->current_module->aliases = ctx->aliases; ctx->aliases = NULL; @@ -3116,7 +3116,7 @@ start_element_handler (GMarkupParseContext *context, ctx->pointer_structures = NULL; for (l = ctx->include_modules; l; l = l->next) - _gi_ir_module_add_include_module (ctx->current_module, l->data); + gi_ir_module_add_include_module (ctx->current_module, l->data); g_list_free (ctx->include_modules); ctx->include_modules = NULL; @@ -3663,7 +3663,7 @@ cleanup (GMarkupParseContext *context, GList *m; for (m = ctx->modules; m; m = m->next) - _gi_ir_module_free (m->data); + gi_ir_module_free (m->data); g_list_free (ctx->modules); ctx->modules = NULL; @@ -3671,7 +3671,7 @@ cleanup (GMarkupParseContext *context, } /** - * _gi_ir_parser_parse_string: + * gi_ir_parser_parse_string: * @parser: a #GIIrParser * @namespace: the namespace of the string * @filename: (allow-none): Path to parsed file, or %NULL @@ -3685,12 +3685,12 @@ cleanup (GMarkupParseContext *context, * Returns: (transfer none): a new #GirModule */ GIIrModule * -_gi_ir_parser_parse_string (GIIrParser *parser, - const gchar *namespace, - const gchar *filename, - const gchar *buffer, - gssize length, - GError **error) +gi_ir_parser_parse_string (GIIrParser *parser, + const gchar *namespace, + const gchar *filename, + const gchar *buffer, + gssize length, + GError **error) { ParseContext ctx = { 0 }; GMarkupParseContext *context; @@ -3755,7 +3755,7 @@ _gi_ir_parser_parse_string (GIIrParser *parser, } /** - * _gi_ir_parser_parse_file: + * gi_ir_parser_parse_file: * @parser: a #GIIrParser * @filename: filename to parse * @error: return location for a #GError, or %NULL @@ -3767,9 +3767,9 @@ _gi_ir_parser_parse_string (GIIrParser *parser, * are owned by the #GIIrParser and will be freed along with the parser. */ GIIrModule * -_gi_ir_parser_parse_file (GIIrParser *parser, - const gchar *filename, - GError **error) +gi_ir_parser_parse_file (GIIrParser *parser, + const gchar *filename, + GError **error) { gchar *buffer; gsize length; @@ -3803,7 +3803,7 @@ _gi_ir_parser_parse_file (GIIrParser *parser, return NULL; } - module = _gi_ir_parser_parse_string (parser, namespace, filename, buffer, length, error); + module = gi_ir_parser_parse_string (parser, namespace, filename, buffer, length, error); g_free (namespace); diff --git a/girepository/gistructinfo.c b/girepository/gistructinfo.c index a43ec01d1..8be89544a 100644 --- a/girepository/gistructinfo.c +++ b/girepository/gistructinfo.c @@ -212,7 +212,7 @@ gi_struct_info_find_method (GIStructInfo *info, StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset]; offset = gi_struct_get_field_offset (info, blob->n_fields); - return _gi_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_methods, name); + return gi_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_methods, name); } /** diff --git a/girepository/gitypeinfo.c b/girepository/gitypeinfo.c index 429615c9a..a7be761bf 100644 --- a/girepository/gitypeinfo.c +++ b/girepository/gitypeinfo.c @@ -146,9 +146,9 @@ gi_type_info_get_param_type (GITypeInfo *info, case GI_TYPE_TAG_GLIST: case GI_TYPE_TAG_GSLIST: case GI_TYPE_TAG_GHASH: - return _gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, - rinfo->offset + sizeof (ParamTypeBlob) - + sizeof (SimpleTypeBlob) * n); + return gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, + rinfo->offset + sizeof (ParamTypeBlob) + + sizeof (SimpleTypeBlob) * n); break; default: break; @@ -207,7 +207,7 @@ gi_type_info_get_interface (GITypeInfo *info) InterfaceTypeBlob *blob = (InterfaceTypeBlob *)&rinfo->typelib->data[rinfo->offset]; if (blob->tag == GI_TYPE_TAG_INTERFACE) - return _gi_info_from_entry (rinfo->repository, rinfo->typelib, blob->interface); + return gi_info_from_entry (rinfo->repository, rinfo->typelib, blob->interface); } } diff --git a/girepository/gitypelib-internal.h b/girepository/gitypelib-internal.h index 3e9016c83..b02f05044 100644 --- a/girepository/gitypelib-internal.h +++ b/girepository/gitypelib-internal.h @@ -1332,19 +1332,19 @@ AttributeBlob *_attribute_blob_find_first (GIBaseInfo *info, */ typedef struct _GITypelibHashBuilder GITypelibHashBuilder; -GITypelibHashBuilder * _gi_typelib_hash_builder_new (void); +GITypelibHashBuilder * gi_typelib_hash_builder_new (void); -void _gi_typelib_hash_builder_add_string (GITypelibHashBuilder *builder, const char *str, guint16 value); +void gi_typelib_hash_builder_add_string (GITypelibHashBuilder *builder, const char *str, guint16 value); -gboolean _gi_typelib_hash_builder_prepare (GITypelibHashBuilder *builder); +gboolean gi_typelib_hash_builder_prepare (GITypelibHashBuilder *builder); -guint32 _gi_typelib_hash_builder_get_buffer_size (GITypelibHashBuilder *builder); +guint32 gi_typelib_hash_builder_get_buffer_size (GITypelibHashBuilder *builder); -void _gi_typelib_hash_builder_pack (GITypelibHashBuilder *builder, guint8* mem, guint32 size); +void gi_typelib_hash_builder_pack (GITypelibHashBuilder *builder, guint8* mem, guint32 size); -void _gi_typelib_hash_builder_destroy (GITypelibHashBuilder *builder); +void gi_typelib_hash_builder_destroy (GITypelibHashBuilder *builder); -guint16 _gi_typelib_hash_search (guint8* memory, const char *str, guint n_entries); +guint16 gi_typelib_hash_search (guint8* memory, const char *str, guint n_entries); G_END_DECLS diff --git a/girepository/gitypelib.c b/girepository/gitypelib.c index 4ddad0801..f5dee7909 100644 --- a/girepository/gitypelib.c +++ b/girepository/gitypelib.c @@ -209,7 +209,7 @@ gi_typelib_get_dir_entry_by_name (GITypelib *typelib, guint8 *hash = (guint8*) &typelib->data[dirindex->offset]; guint16 index; - index = _gi_typelib_hash_search (hash, name, n_entries); + index = gi_typelib_hash_search (hash, name, n_entries); entry = gi_typelib_get_dir_entry (typelib, index + 1); entry_name = gi_typelib_get_string (typelib, entry->name); if (strcmp (name, entry_name) == 0) @@ -2298,7 +2298,7 @@ load_one_shared_library (const char *shlib) } static void -_gi_typelib_do_dlopen (GITypelib *typelib) +gi_typelib_do_dlopen (GITypelib *typelib) { Header *header; const char *shlib_str; @@ -2357,12 +2357,12 @@ _gi_typelib_do_dlopen (GITypelib *typelib) } static inline void -_gi_typelib_ensure_open (GITypelib *typelib) +gi_typelib_ensure_open (GITypelib *typelib) { if (typelib->open_attempted) return; typelib->open_attempted = TRUE; - _gi_typelib_do_dlopen (typelib); + gi_typelib_do_dlopen (typelib); } /** @@ -2505,7 +2505,7 @@ gi_typelib_symbol (GITypelib *typelib, const char *symbol_name, gpointer *symbol { GList *l; - _gi_typelib_ensure_open (typelib); + gi_typelib_ensure_open (typelib); /* * The reason for having multiple modules dates from gir-repository diff --git a/girepository/giunioninfo.c b/girepository/giunioninfo.c index 187b454a1..41966db35 100644 --- a/girepository/giunioninfo.c +++ b/girepository/giunioninfo.c @@ -173,7 +173,7 @@ gi_union_info_get_discriminator_type (GIUnionInfo *info) { GIRealInfo *rinfo = (GIRealInfo *)info; - return _gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + 24); + return gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + 24); } /** @@ -234,7 +234,7 @@ gi_union_info_find_method (GIUnionInfo *info, offset = rinfo->offset + header->union_blob_size + blob->n_fields * header->field_blob_size; - return _gi_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_functions, name); + return gi_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_functions, name); } /** diff --git a/girepository/givfuncinfo.c b/girepository/givfuncinfo.c index 604b029e1..2dfe73f04 100644 --- a/girepository/givfuncinfo.c +++ b/girepository/givfuncinfo.c @@ -45,10 +45,10 @@ */ GIVFuncInfo * -_gi_base_info_find_vfunc (GIRealInfo *rinfo, - guint32 offset, - gint n_vfuncs, - const gchar *name) +gi_base_info_find_vfunc (GIRealInfo *rinfo, + guint32 offset, + gint n_vfuncs, + const gchar *name) { /* FIXME hash */ Header *header = (Header *)rinfo->typelib->data; diff --git a/girepository/gthash-test.c b/girepository/gthash-test.c index 9ae3f5d7e..ac55db91d 100644 --- a/girepository/gthash-test.c +++ b/girepository/gthash-test.c @@ -31,28 +31,28 @@ test_build_retrieve (void) guint32 bufsize; guint8* buf; - builder = _gi_typelib_hash_builder_new (); + builder = gi_typelib_hash_builder_new (); - _gi_typelib_hash_builder_add_string (builder, "Action", 0); - _gi_typelib_hash_builder_add_string (builder, "ZLibDecompressor", 42); - _gi_typelib_hash_builder_add_string (builder, "VolumeMonitor", 9); - _gi_typelib_hash_builder_add_string (builder, "FileMonitorFlags", 31); + gi_typelib_hash_builder_add_string (builder, "Action", 0); + gi_typelib_hash_builder_add_string (builder, "ZLibDecompressor", 42); + gi_typelib_hash_builder_add_string (builder, "VolumeMonitor", 9); + gi_typelib_hash_builder_add_string (builder, "FileMonitorFlags", 31); - if (!_gi_typelib_hash_builder_prepare (builder)) + if (!gi_typelib_hash_builder_prepare (builder)) g_assert_not_reached (); - bufsize = _gi_typelib_hash_builder_get_buffer_size (builder); + bufsize = gi_typelib_hash_builder_get_buffer_size (builder); buf = g_malloc (bufsize); - _gi_typelib_hash_builder_pack (builder, buf, bufsize); + gi_typelib_hash_builder_pack (builder, buf, bufsize); - _gi_typelib_hash_builder_destroy (builder); + gi_typelib_hash_builder_destroy (builder); - g_assert (_gi_typelib_hash_search (buf, "Action", 4) == 0); - g_assert (_gi_typelib_hash_search (buf, "ZLibDecompressor", 4) == 42); - g_assert (_gi_typelib_hash_search (buf, "VolumeMonitor", 4) == 9); - g_assert (_gi_typelib_hash_search (buf, "FileMonitorFlags", 4) == 31); + g_assert (gi_typelib_hash_search (buf, "Action", 4) == 0); + g_assert (gi_typelib_hash_search (buf, "ZLibDecompressor", 4) == 42); + g_assert (gi_typelib_hash_search (buf, "VolumeMonitor", 4) == 9); + g_assert (gi_typelib_hash_search (buf, "FileMonitorFlags", 4) == 31); } int diff --git a/girepository/gthash.c b/girepository/gthash.c index 8a0ee305d..023a92f82 100644 --- a/girepository/gthash.c +++ b/girepository/gthash.c @@ -64,7 +64,7 @@ struct _GITypelibHashBuilder { }; GITypelibHashBuilder * -_gi_typelib_hash_builder_new (void) +gi_typelib_hash_builder_new (void) { GITypelibHashBuilder *builder = g_slice_new0 (GITypelibHashBuilder); builder->c = NULL; @@ -73,16 +73,16 @@ _gi_typelib_hash_builder_new (void) } void -_gi_typelib_hash_builder_add_string (GITypelibHashBuilder *builder, - const char *str, - guint16 value) +gi_typelib_hash_builder_add_string (GITypelibHashBuilder *builder, + const char *str, + guint16 value) { g_return_if_fail (builder->c == NULL); g_hash_table_insert (builder->strings, g_strdup (str), GUINT_TO_POINTER ((guint) value)); } gboolean -_gi_typelib_hash_builder_prepare (GITypelibHashBuilder *builder) +gi_typelib_hash_builder_prepare (GITypelibHashBuilder *builder) { char **strs; GHashTableIter hashiter; @@ -137,7 +137,7 @@ _gi_typelib_hash_builder_prepare (GITypelibHashBuilder *builder) } guint32 -_gi_typelib_hash_builder_get_buffer_size (GITypelibHashBuilder *builder) +gi_typelib_hash_builder_get_buffer_size (GITypelibHashBuilder *builder) { g_return_val_if_fail (builder != NULL, 0); g_return_val_if_fail (builder->prepared, 0); @@ -147,7 +147,7 @@ _gi_typelib_hash_builder_get_buffer_size (GITypelibHashBuilder *builder) } void -_gi_typelib_hash_builder_pack (GITypelibHashBuilder *builder, guint8* mem, guint32 len) +gi_typelib_hash_builder_pack (GITypelibHashBuilder *builder, guint8* mem, guint32 len) { guint16 *table; GHashTableIter hashiter; @@ -185,7 +185,7 @@ _gi_typelib_hash_builder_pack (GITypelibHashBuilder *builder, guint8* mem, guint } void -_gi_typelib_hash_builder_destroy (GITypelibHashBuilder *builder) +gi_typelib_hash_builder_destroy (GITypelibHashBuilder *builder) { if (builder->c) { @@ -197,7 +197,7 @@ _gi_typelib_hash_builder_destroy (GITypelibHashBuilder *builder) } guint16 -_gi_typelib_hash_search (guint8* memory, const char *str, guint n_entries) +gi_typelib_hash_search (guint8* memory, const char *str, guint n_entries) { guint32 *mph; guint16 *table;