Merge branch '3155-cleanups-renames' into 'main'

girepository: Rename symbols to the GI namespace

See merge request GNOME/glib!3704
This commit is contained in:
Emmanuele Bassi 2023-11-08 17:56:43 +00:00
commit 4144341e7a
53 changed files with 2982 additions and 3011 deletions

View File

@ -269,10 +269,8 @@ dump_signals (GType type, GOutputStream *out)
escaped_printf (out, " when=\"last\""); escaped_printf (out, " when=\"last\"");
else if (query.signal_flags & G_SIGNAL_RUN_CLEANUP) else if (query.signal_flags & G_SIGNAL_RUN_CLEANUP)
escaped_printf (out, " when=\"cleanup\""); escaped_printf (out, " when=\"cleanup\"");
#if GLIB_CHECK_VERSION(2, 29, 15)
else if (query.signal_flags & G_SIGNAL_MUST_COLLECT) else if (query.signal_flags & G_SIGNAL_MUST_COLLECT)
escaped_printf (out, " when=\"must-collect\""); escaped_printf (out, " when=\"must-collect\"");
#endif
if (query.signal_flags & G_SIGNAL_NO_RECURSE) if (query.signal_flags & G_SIGNAL_NO_RECURSE)
escaped_printf (out, " no-recurse=\"1\""); 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)) if (G_TYPE_IS_ABSTRACT (type))
escaped_printf (out, " abstract=\"1\""); escaped_printf (out, " abstract=\"1\"");
#if GLIB_CHECK_VERSION (2, 70, 0)
if (G_TYPE_IS_FINAL (type)) if (G_TYPE_IS_FINAL (type))
escaped_printf (out, " final=\"1\""); escaped_printf (out, " final=\"1\"");
#endif
goutput_write (out, ">\n"); goutput_write (out, ">\n");
@ -450,10 +446,8 @@ dump_fundamental_type (GType type, const char *symbol, GOutputStream *out)
if (G_TYPE_IS_ABSTRACT (type)) if (G_TYPE_IS_ABSTRACT (type))
escaped_printf (out, " abstract=\"1\""); escaped_printf (out, " abstract=\"1\"");
#if GLIB_CHECK_VERSION (2, 70, 0)
if (G_TYPE_IS_FINAL (type)) if (G_TYPE_IS_FINAL (type))
escaped_printf (out, " final=\"1\""); escaped_printf (out, " final=\"1\"");
#endif
if (G_TYPE_IS_INSTANTIATABLE (type)) if (G_TYPE_IS_INSTANTIATABLE (type))
escaped_printf (out, " instantiatable=\"1\""); escaped_printf (out, " instantiatable=\"1\"");
@ -526,7 +520,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 * @arg: Comma-separated pair of input and output filenames
* @error: a %GError * @error: a %GError
* *
@ -549,7 +543,7 @@ static gboolean
dump_irepository (const char *arg, GError **error) dump_irepository (const char *arg, GError **error)
#else #else
gboolean gboolean
g_irepository_dump (const char *arg, GError **error) gi_repository_dump (const char *arg, GError **error)
#endif #endif
{ {
GHashTable *output_types; GHashTable *output_types;

View File

@ -44,7 +44,7 @@
*/ */
/** /**
* g_arg_info_get_direction: * gi_arg_info_get_direction:
* @info: a #GIArgInfo * @info: a #GIArgInfo
* *
* Obtain the direction of the argument. Check #GIDirection for possible * Obtain the direction of the argument. Check #GIDirection for possible
@ -53,7 +53,7 @@
* Returns: the direction * Returns: the direction
*/ */
GIDirection GIDirection
g_arg_info_get_direction (GIArgInfo *info) gi_arg_info_get_direction (GIArgInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ArgBlob *blob; 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 * @info: a #GIArgInfo
* *
* Obtain if the argument is a return value. It can either be a * 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 * Returns: %TRUE if it is a return value
*/ */
gboolean gboolean
g_arg_info_is_return_value (GIArgInfo *info) gi_arg_info_is_return_value (GIArgInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ArgBlob *blob; 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 * @info: a #GIArgInfo
* *
* Obtain if the argument is a pointer to a struct or object that will * 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 * Returns: %TRUE if caller is required to have allocated the argument
*/ */
gboolean gboolean
g_arg_info_is_caller_allocates (GIArgInfo *info) gi_arg_info_is_caller_allocates (GIArgInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ArgBlob *blob; 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 * @info: a #GIArgInfo
* *
* Obtain if the argument is optional. For 'out' arguments this means * 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 * Returns: %TRUE if it is an optional argument
*/ */
gboolean gboolean
g_arg_info_is_optional (GIArgInfo *info) gi_arg_info_is_optional (GIArgInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ArgBlob *blob; 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 * @info: a #GIArgInfo
* *
* Obtain if the type of the argument includes the possibility of %NULL. * 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' * For 'in' values this means that %NULL is a valid value. For 'out'
* values, this means that %NULL may be returned. * 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 * Returns: %TRUE if the value may be %NULL
*/ */
gboolean gboolean
g_arg_info_may_be_null (GIArgInfo *info) gi_arg_info_may_be_null (GIArgInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ArgBlob *blob; 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 * @info: a #GIArgInfo
* *
* Obtain if an argument is only useful in C. * Obtain if an argument is only useful in C.
@ -178,7 +178,7 @@ g_arg_info_may_be_null (GIArgInfo *info)
* Since: 1.30 * Since: 1.30
*/ */
gboolean gboolean
g_arg_info_is_skip (GIArgInfo *info) gi_arg_info_is_skip (GIArgInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ArgBlob *blob; 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 * @info: a #GIArgInfo
* *
* Obtain the ownership transfer for this argument. * Obtain the ownership transfer for this argument.
@ -201,7 +201,7 @@ g_arg_info_is_skip (GIArgInfo *info)
* Returns: the transfer * Returns: the transfer
*/ */
GITransfer GITransfer
g_arg_info_get_ownership_transfer (GIArgInfo *info) gi_arg_info_get_ownership_transfer (GIArgInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ArgBlob *blob; 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 * @info: a #GIArgInfo
* *
* Obtain the scope type for this argument. The scope type explains * 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 * Returns: the scope type
*/ */
GIScopeType GIScopeType
g_arg_info_get_scope (GIArgInfo *info) gi_arg_info_get_scope (GIArgInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ArgBlob *blob; 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 * @info: a #GIArgInfo
* *
* Obtain the index of the user data argument. This is only valid * 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 * Returns: index of the user data argument or -1 if there is none
*/ */
gint gint
g_arg_info_get_closure (GIArgInfo *info) gi_arg_info_get_closure (GIArgInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ArgBlob *blob; 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 * @info: a #GIArgInfo
* *
* Obtains the index of the #GDestroyNotify argument. This is only valid * 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 * Returns: index of the #GDestroyNotify argument or -1 if there is none
*/ */
gint gint
g_arg_info_get_destroy (GIArgInfo *info) gi_arg_info_get_destroy (GIArgInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ArgBlob *blob; 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 * @info: a #GIArgInfo
* *
* Obtain the type information for @info. * Obtain the type information for @info.
* *
* Returns: (transfer full): the #GITypeInfo holding the type * 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. * when done.
*/ */
GITypeInfo * GITypeInfo *
g_arg_info_get_type (GIArgInfo *info) gi_arg_info_get_type (GIArgInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
g_return_val_if_fail (info != NULL, NULL); g_return_val_if_fail (info != NULL, NULL);
g_return_val_if_fail (GI_IS_ARG_INFO (info), 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 * @info: a #GIArgInfo
* @type: (out caller-allocates): Initialized with information about type of @info * @type: (out caller-allocates): Initialized with information about type of @info
* *
* Obtain information about a the type of given argument @info; this * 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. * allocation.
* *
* The initialized @type must not be referenced after @info is deallocated. * The initialized @type must not be referenced after @info is deallocated.
*/ */
void void
g_arg_info_load_type (GIArgInfo *info, gi_arg_info_load_type (GIArgInfo *info,
GITypeInfo *type) GITypeInfo *type)
{ {
GIRealInfo *rinfo = (GIRealInfo*) info; GIRealInfo *rinfo = (GIRealInfo*) info;
g_return_if_fail (info != NULL); g_return_if_fail (info != NULL);
g_return_if_fail (GI_IS_ARG_INFO (info)); 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));
} }

View File

@ -39,43 +39,43 @@ G_BEGIN_DECLS
* Checks if @info is a GIArgInfo. * Checks if @info is a GIArgInfo.
*/ */
#define GI_IS_ARG_INFO(info) \ #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 GI_AVAILABLE_IN_ALL
GIDirection g_arg_info_get_direction (GIArgInfo *info); GIDirection gi_arg_info_get_direction (GIArgInfo *info);
GI_AVAILABLE_IN_ALL 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 GI_AVAILABLE_IN_ALL
gboolean g_arg_info_is_optional (GIArgInfo *info); gboolean gi_arg_info_is_optional (GIArgInfo *info);
GI_AVAILABLE_IN_ALL 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 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 GI_AVAILABLE_IN_ALL
gboolean g_arg_info_is_skip (GIArgInfo *info); gboolean gi_arg_info_is_skip (GIArgInfo *info);
GI_AVAILABLE_IN_ALL 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 GI_AVAILABLE_IN_ALL
GIScopeType g_arg_info_get_scope (GIArgInfo *info); GIScopeType gi_arg_info_get_scope (GIArgInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint g_arg_info_get_closure (GIArgInfo *info); gint gi_arg_info_get_closure (GIArgInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint g_arg_info_get_destroy (GIArgInfo *info); gint gi_arg_info_get_destroy (GIArgInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GITypeInfo * g_arg_info_get_type (GIArgInfo *info); GITypeInfo * gi_arg_info_get_type (GIArgInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
void g_arg_info_load_type (GIArgInfo *info, void gi_arg_info_load_type (GIArgInfo *info,
GITypeInfo *type); GITypeInfo *type);
G_END_DECLS G_END_DECLS

View File

@ -38,26 +38,26 @@
/* GBoxed registration of BaseInfo. */ /* GBoxed registration of BaseInfo. */
GType GType
g_base_info_gtype_get_type (void) gi_base_info_gtype_get_type (void)
{ {
static GType our_type = 0; static GType our_type = 0;
if (our_type == 0) if (our_type == 0)
our_type = our_type =
g_boxed_type_register_static ("GIBaseInfo", g_boxed_type_register_static ("GIBaseInfo",
(GBoxedCopyFunc) g_base_info_ref, (GBoxedCopyFunc) gi_base_info_ref,
(GBoxedFreeFunc) g_base_info_unref); (GBoxedFreeFunc) gi_base_info_unref);
return our_type; return our_type;
} }
/* info creation */ /* info creation */
GIBaseInfo * GIBaseInfo *
_g_info_new_full (GIInfoType type, gi_info_new_full (GIInfoType type,
GIRepository *repository, GIRepository *repository,
GIBaseInfo *container, GIBaseInfo *container,
GITypelib *typelib, GITypelib *typelib,
guint32 offset) guint32 offset)
{ {
GIRealInfo *info; GIRealInfo *info;
@ -65,11 +65,11 @@ _g_info_new_full (GIInfoType type,
info = g_slice_new (GIRealInfo); 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; info->ref_count = 1;
if (container && ((GIRealInfo *) container)->ref_count != INVALID_REFCOUNT) 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); g_object_ref (info->repository);
@ -77,7 +77,7 @@ _g_info_new_full (GIInfoType type,
} }
/** /**
* g_info_new: * gi_info_new:
* @type: TODO * @type: TODO
* @container: TODO * @container: TODO
* @typelib: TODO * @typelib: TODO
@ -88,21 +88,21 @@ _g_info_new_full (GIInfoType type,
* Returns: TODO * Returns: TODO
*/ */
GIBaseInfo * GIBaseInfo *
g_info_new (GIInfoType type, gi_info_new (GIInfoType type,
GIBaseInfo *container, GIBaseInfo *container,
GITypelib *typelib, GITypelib *typelib,
guint32 offset) 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 void
_g_info_init (GIRealInfo *info, gi_info_init (GIRealInfo *info,
GIInfoType type, GIInfoType type,
GIRepository *repository, GIRepository *repository,
GIBaseInfo *container, GIBaseInfo *container,
GITypelib *typelib, GITypelib *typelib,
guint32 offset) guint32 offset)
{ {
memset (info, 0, sizeof (GIRealInfo)); memset (info, 0, sizeof (GIRealInfo));
@ -116,26 +116,26 @@ _g_info_init (GIRealInfo *info,
if (container) if (container)
info->container = container; info->container = container;
g_assert (G_IS_IREPOSITORY (repository)); g_assert (GI_IS_REPOSITORY (repository));
info->repository = repository; info->repository = repository;
} }
GIBaseInfo * GIBaseInfo *
_g_info_from_entry (GIRepository *repository, gi_info_from_entry (GIRepository *repository,
GITypelib *typelib, GITypelib *typelib,
guint16 index) guint16 index)
{ {
GIBaseInfo *result; GIBaseInfo *result;
DirEntry *entry = g_typelib_get_dir_entry (typelib, index); DirEntry *entry = gi_typelib_get_dir_entry (typelib, index);
if (entry->local) 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 else
{ {
const gchar *namespace = g_typelib_get_string (typelib, entry->offset); const gchar *namespace = gi_typelib_get_string (typelib, entry->offset);
const gchar *name = g_typelib_get_string (typelib, entry->name); 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) if (result == NULL)
{ {
GIUnresolvedInfo *unresolved; GIUnresolvedInfo *unresolved;
@ -158,26 +158,26 @@ _g_info_from_entry (GIRepository *repository,
} }
GITypeInfo * GITypeInfo *
_g_type_info_new (GIBaseInfo *container, gi_type_info_new (GIBaseInfo *container,
GITypelib *typelib, GITypelib *typelib,
guint32 offset) guint32 offset)
{ {
SimpleTypeBlob *type = (SimpleTypeBlob *)&typelib->data[offset]; SimpleTypeBlob *type = (SimpleTypeBlob *)&typelib->data[offset];
return (GITypeInfo *) g_info_new (GI_INFO_TYPE_TYPE, container, typelib, return (GITypeInfo *) gi_info_new (GI_INFO_TYPE_TYPE, container, typelib,
(type->flags.reserved == 0 && type->flags.reserved2 == 0) ? offset : type->offset); (type->flags.reserved == 0 && type->flags.reserved2 == 0) ? offset : type->offset);
} }
void void
_g_type_info_init (GIBaseInfo *info, gi_type_info_init (GIBaseInfo *info,
GIBaseInfo *container, GIBaseInfo *container,
GITypelib *typelib, GITypelib *typelib,
guint32 offset) guint32 offset)
{ {
GIRealInfo *rinfo = (GIRealInfo*)container; GIRealInfo *rinfo = (GIRealInfo*)container;
SimpleTypeBlob *type = (SimpleTypeBlob *)&typelib->data[offset]; SimpleTypeBlob *type = (SimpleTypeBlob *)&typelib->data[offset];
_g_info_init ((GIRealInfo*)info, GI_INFO_TYPE_TYPE, rinfo->repository, container, typelib, gi_info_init ((GIRealInfo*)info, GI_INFO_TYPE_TYPE, rinfo->repository, container, typelib,
(type->flags.reserved == 0 && type->flags.reserved2 == 0) ? offset : type->offset); (type->flags.reserved == 0 && type->flags.reserved2 == 0) ? offset : type->offset);
} }
@ -199,20 +199,20 @@ _g_type_info_init (GIBaseInfo *info,
* ]| * ]|
* *
* Most #GIRepository APIs returning a #GIBaseInfo is actually * 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. * be called when done accessing the data.
* *
* #GIBaseInfo structuress are normally accessed by calling either * #GIBaseInfo structuress are normally accessed by calling either
* g_irepository_find_by_name(), g_irepository_find_by_gtype() or * gi_repository_find_by_name(), gi_repository_find_by_gtype() or
* g_irepository_get_info(). * gi_repository_get_info().
* *
* |[<!-- language="C" --> * |[<!-- language="C" -->
* GIBaseInfo *button_info = * GIBaseInfo *button_info =
* g_irepository_find_by_name (NULL, "Gtk", "Button"); * gi_repository_find_by_name (NULL, "Gtk", "Button");
* *
* // ... use button_info ... * // ... use button_info ...
* *
* g_base_info_unref (button_info); * gi_base_info_unref (button_info);
* ]| * ]|
* *
* ## Hierarchy * ## Hierarchy
@ -230,7 +230,7 @@ _g_type_info_init (GIBaseInfo *info,
*/ */
/** /**
* g_base_info_ref: (skip) * gi_base_info_ref: (skip)
* @info: a #GIBaseInfo * @info: a #GIBaseInfo
* *
* Increases the reference count of @info. * Increases the reference count of @info.
@ -238,7 +238,7 @@ _g_type_info_init (GIBaseInfo *info,
* Returns: the same @info. * Returns: the same @info.
*/ */
GIBaseInfo * GIBaseInfo *
g_base_info_ref (GIBaseInfo *info) gi_base_info_ref (GIBaseInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo*)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 * @info: a #GIBaseInfo
* *
* Decreases the reference count of @info. When its reference count * Decreases the reference count of @info. When its reference count
* drops to 0, the info is freed. * drops to 0, the info is freed.
*/ */
void void
g_base_info_unref (GIBaseInfo *info) gi_base_info_unref (GIBaseInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo*)info; GIRealInfo *rinfo = (GIRealInfo*)info;
@ -266,7 +266,7 @@ g_base_info_unref (GIBaseInfo *info)
return; return;
if (rinfo->container && ((GIRealInfo *) rinfo->container)->ref_count != INVALID_REFCOUNT) 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) if (rinfo->repository)
g_object_unref (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 * @info: a #GIBaseInfo
* *
* Obtain the info type of the GIBaseInfo. * Obtain the info type of the GIBaseInfo.
@ -286,14 +286,14 @@ g_base_info_unref (GIBaseInfo *info)
* Returns: the info type of @info * Returns: the info type of @info
*/ */
GIInfoType GIInfoType
g_base_info_get_type (GIBaseInfo *info) gi_base_info_get_type (GIBaseInfo *info)
{ {
return ((GIRealInfo*)info)->type; return ((GIRealInfo*)info)->type;
} }
/** /**
* g_base_info_get_name: * gi_base_info_get_name:
* @info: a #GIBaseInfo * @info: a #GIBaseInfo
* *
* Obtain the name of the @info. What the name represents depends on * 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. * Returns: the name of @info or %NULL if it lacks a name.
*/ */
const gchar * const gchar *
g_base_info_get_name (GIBaseInfo *info) gi_base_info_get_name (GIBaseInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo*)info; GIRealInfo *rinfo = (GIRealInfo*)info;
g_assert (rinfo->ref_count > 0); 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]; 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; break;
@ -331,7 +331,7 @@ g_base_info_get_name (GIBaseInfo *info)
{ {
ValueBlob *blob = (ValueBlob *)&rinfo->typelib->data[rinfo->offset]; 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; break;
@ -339,7 +339,7 @@ g_base_info_get_name (GIBaseInfo *info)
{ {
SignalBlob *blob = (SignalBlob *)&rinfo->typelib->data[rinfo->offset]; 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; break;
@ -347,7 +347,7 @@ g_base_info_get_name (GIBaseInfo *info)
{ {
PropertyBlob *blob = (PropertyBlob *)&rinfo->typelib->data[rinfo->offset]; 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; break;
@ -355,7 +355,7 @@ g_base_info_get_name (GIBaseInfo *info)
{ {
VFuncBlob *blob = (VFuncBlob *)&rinfo->typelib->data[rinfo->offset]; 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; break;
@ -363,7 +363,7 @@ g_base_info_get_name (GIBaseInfo *info)
{ {
FieldBlob *blob = (FieldBlob *)&rinfo->typelib->data[rinfo->offset]; 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; break;
@ -371,7 +371,7 @@ g_base_info_get_name (GIBaseInfo *info)
{ {
ArgBlob *blob = (ArgBlob *)&rinfo->typelib->data[rinfo->offset]; 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; break;
case GI_INFO_TYPE_UNRESOLVED: 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 * @info: a #GIBaseInfo
* *
* Obtain the namespace of @info. * Obtain the namespace of @info.
@ -400,7 +400,7 @@ g_base_info_get_name (GIBaseInfo *info)
* Returns: the namespace * Returns: the namespace
*/ */
const gchar * const gchar *
g_base_info_get_namespace (GIBaseInfo *info) gi_base_info_get_namespace (GIBaseInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo*) info; GIRealInfo *rinfo = (GIRealInfo*) info;
Header *header = (Header *)rinfo->typelib->data; Header *header = (Header *)rinfo->typelib->data;
@ -414,11 +414,11 @@ g_base_info_get_namespace (GIBaseInfo *info)
return unresolved->namespace; 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 * @info: a #GIBaseInfo
* *
* Obtain whether the @info is represents a metadata which is * 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 * Returns: %TRUE if deprecated
*/ */
gboolean gboolean
g_base_info_is_deprecated (GIBaseInfo *info) gi_base_info_is_deprecated (GIBaseInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo*) info; GIRealInfo *rinfo = (GIRealInfo*) info;
switch (rinfo->type) 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 * @info: a #GIBaseInfo
* @name: a freeform string naming an attribute * @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 * Returns: The value of the attribute, or %NULL if no such attribute exists
*/ */
const gchar * const gchar *
g_base_info_get_attribute (GIBaseInfo *info, gi_base_info_get_attribute (GIBaseInfo *info,
const gchar *name) const gchar *name)
{ {
GIAttributeIter iter = { 0, }; GIAttributeIter iter = { 0, };
gchar *curname, *curvalue; 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) if (strcmp (name, curname) == 0)
return (const gchar*) curvalue; 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 * @info: a #GIBaseInfo
* @iterator: (inout): a #GIAttributeIter structure, must be initialized; see below * @iterator: (inout): a #GIAttributeIter structure, must be initialized; see below
* @name: (out) (transfer none): Returned name, must not be freed * @name: (out) (transfer none): Returned name, must not be freed
@ -585,7 +585,7 @@ _attribute_blob_find_first (GIBaseInfo *info,
* GIAttributeIter iter = { 0, }; * GIAttributeIter iter = { 0, };
* char *name; * char *name;
* char *value; * 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); * 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 * Returns: %TRUE if there are more attributes
*/ */
gboolean gboolean
g_base_info_iterate_attributes (GIBaseInfo *info, gi_base_info_iterate_attributes (GIBaseInfo *info,
GIAttributeIter *iterator, GIAttributeIter *iterator,
gchar **name, gchar **name,
gchar **value) gchar **value)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
Header *header = (Header *)rinfo->typelib->data; 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) if (next == NULL || next->offset != rinfo->offset || next >= after)
return FALSE; return FALSE;
*name = (gchar*) g_typelib_get_string (rinfo->typelib, next->name); *name = (gchar*) gi_typelib_get_string (rinfo->typelib, next->name);
*value = (gchar*) g_typelib_get_string (rinfo->typelib, next->value); *value = (gchar*) gi_typelib_get_string (rinfo->typelib, next->value);
iterator->data = next + 1; iterator->data = next + 1;
return TRUE; return TRUE;
} }
/** /**
* g_base_info_get_container: * gi_base_info_get_container:
* @info: a #GIBaseInfo * @info: a #GIBaseInfo
* *
* Obtain the container of the @info. The container is the parent * 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 * Returns: (transfer none): the container
*/ */
GIBaseInfo * GIBaseInfo *
g_base_info_get_container (GIBaseInfo *info) gi_base_info_get_container (GIBaseInfo *info)
{ {
return ((GIRealInfo*)info)->container; return ((GIRealInfo*)info)->container;
} }
/** /**
* g_base_info_get_typelib: * gi_base_info_get_typelib:
* @info: a #GIBaseInfo * @info: a #GIBaseInfo
* *
* Obtain the typelib this @info belongs to * Obtain the typelib this @info belongs to
@ -647,13 +647,13 @@ g_base_info_get_container (GIBaseInfo *info)
* Returns: (transfer none): the typelib. * Returns: (transfer none): the typelib.
*/ */
GITypelib * GITypelib *
g_base_info_get_typelib (GIBaseInfo *info) gi_base_info_get_typelib (GIBaseInfo *info)
{ {
return ((GIRealInfo*)info)->typelib; return ((GIRealInfo*)info)->typelib;
} }
/** /**
* g_base_info_equal: * gi_base_info_equal:
* @info1: a #GIBaseInfo * @info1: a #GIBaseInfo
* @info2: 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. * Returns: %TRUE if and only if @info1 equals @info2.
*/ */
gboolean gboolean
g_base_info_equal (GIBaseInfo *info1, GIBaseInfo *info2) gi_base_info_equal (GIBaseInfo *info1, GIBaseInfo *info2)
{ {
/* Compare the TypeLib pointers, which are mmapped. */ /* Compare the TypeLib pointers, which are mmapped. */
GIRealInfo *rinfo1 = (GIRealInfo*)info1; GIRealInfo *rinfo1 = (GIRealInfo*)info1;

View File

@ -48,54 +48,54 @@ typedef struct {
gpointer data4; gpointer data4;
} GIAttributeIter; } 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 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 GI_AVAILABLE_IN_ALL
GIBaseInfo * g_base_info_ref (GIBaseInfo *info); GIBaseInfo * gi_base_info_ref (GIBaseInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
void g_base_info_unref (GIBaseInfo *info); void gi_base_info_unref (GIBaseInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIInfoType g_base_info_get_type (GIBaseInfo *info); GIInfoType gi_base_info_get_type (GIBaseInfo *info);
GI_AVAILABLE_IN_ALL 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 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 GI_AVAILABLE_IN_ALL
gboolean g_base_info_is_deprecated (GIBaseInfo *info); gboolean gi_base_info_is_deprecated (GIBaseInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
const gchar * g_base_info_get_attribute (GIBaseInfo *info, const gchar * gi_base_info_get_attribute (GIBaseInfo *info,
const gchar *name); const gchar *name);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gboolean g_base_info_iterate_attributes (GIBaseInfo *info, gboolean gi_base_info_iterate_attributes (GIBaseInfo *info,
GIAttributeIter *iterator, GIAttributeIter *iterator,
char **name, char **name,
char **value); char **value);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIBaseInfo * g_base_info_get_container (GIBaseInfo *info); GIBaseInfo * gi_base_info_get_container (GIBaseInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GITypelib * g_base_info_get_typelib (GIBaseInfo *info); GITypelib * gi_base_info_get_typelib (GIBaseInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gboolean g_base_info_equal (GIBaseInfo *info1, gboolean gi_base_info_equal (GIBaseInfo *info1,
GIBaseInfo *info2); GIBaseInfo *info2);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIBaseInfo * g_info_new (GIInfoType type, GIBaseInfo * gi_info_new (GIInfoType type,
GIBaseInfo *container, GIBaseInfo *container,
GITypelib *typelib, GITypelib *typelib,
guint32 offset); guint32 offset);
G_END_DECLS G_END_DECLS

View File

@ -82,7 +82,7 @@ signature_offset (GICallableInfo *info)
} }
/** /**
* g_callable_info_can_throw_gerror: * gi_callable_info_can_throw_gerror:
* @info: a #GICallableInfo * @info: a #GICallableInfo
* *
* TODO * TODO
@ -91,7 +91,7 @@ signature_offset (GICallableInfo *info)
* Returns: %TRUE if this #GICallableInfo can throw a #GError * Returns: %TRUE if this #GICallableInfo can throw a #GError
*/ */
gboolean gboolean
g_callable_info_can_throw_gerror (GICallableInfo *info) gi_callable_info_can_throw_gerror (GICallableInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo*)info; GIRealInfo *rinfo = (GIRealInfo*)info;
SignatureBlob *signature; 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 * @info: a #GICallableInfo
* *
* Determines if the callable info is a method. For #GIVFuncInfo<!-- -->s, * Determines if the callable info is a method. For #GIVFuncInfo<!-- -->s,
@ -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 * this is always true. Otherwise, this looks at the %GI_FUNCTION_IS_METHOD
* flag on the #GIFunctionInfo. * 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 * 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" * is one more C argument than is exposed by introspection: the "self"
* or "this" object. * or "this" object.
@ -144,7 +144,7 @@ g_callable_info_can_throw_gerror (GICallableInfo *info)
* Since: 1.34 * Since: 1.34
*/ */
gboolean gboolean
g_callable_info_is_method (GICallableInfo *info) gi_callable_info_is_method (GICallableInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo*)info; GIRealInfo *rinfo = (GIRealInfo*)info;
switch (rinfo->type) { 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 * @info: a #GICallableInfo
* *
* Obtain the return type of a callable item as a #GITypeInfo. * Obtain the return type of a callable item as a #GITypeInfo.
* *
* Returns: (transfer full): the #GITypeInfo. Free the struct by calling * Returns: (transfer full): the #GITypeInfo. Free the struct by calling
* g_base_info_unref() when done. * gi_base_info_unref() when done.
*/ */
GITypeInfo * GITypeInfo *
g_callable_info_get_return_type (GICallableInfo *info) gi_callable_info_get_return_type (GICallableInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
guint32 offset; guint32 offset;
@ -184,24 +184,24 @@ g_callable_info_get_return_type (GICallableInfo *info)
offset = signature_offset (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 * @info: a #GICallableInfo
* @type: (out caller-allocates): Initialized with return type of @info * @type: (out caller-allocates): Initialized with return type of @info
* *
* Obtain information about a return value of callable; this * 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. * allocation.
* *
* The initialized @type must not be referenced after @info is deallocated. * The initialized @type must not be referenced after @info is deallocated.
*/ */
void void
g_callable_info_load_return_type (GICallableInfo *info, gi_callable_info_load_return_type (GICallableInfo *info,
GITypeInfo *type) GITypeInfo *type)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
guint32 offset; guint32 offset;
@ -211,11 +211,11 @@ g_callable_info_load_return_type (GICallableInfo *info,
offset = signature_offset (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 * @info: a #GICallableInfo
* *
* See if a callable could return %NULL. * 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 * Returns: %TRUE if callable could return %NULL
*/ */
gboolean gboolean
g_callable_info_may_return_null (GICallableInfo *info) gi_callable_info_may_return_null (GICallableInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
SignatureBlob *blob; 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 * @info: a #GICallableInfo
* *
* See if a callable's return value is only useful in C. * 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. * Returns: %TRUE if return value is only useful in C.
*/ */
gboolean gboolean
g_callable_info_skip_return (GICallableInfo *info) gi_callable_info_skip_return (GICallableInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
SignatureBlob *blob; 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 * @info: a #GICallableInfo
* *
* See whether the caller owns the return value of this callable. * 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 * Returns: the transfer mode for the return value of the callable
*/ */
GITransfer GITransfer
g_callable_info_get_caller_owns (GICallableInfo *info) gi_callable_info_get_caller_owns (GICallableInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo*) info; GIRealInfo *rinfo = (GIRealInfo*) info;
SignatureBlob *blob; 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 * @info: a #GICallableInfo
* *
* Obtains the ownership transfer for the instance argument. * 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 * Returns: the transfer mode of the instance argument
*/ */
GITransfer GITransfer
g_callable_info_get_instance_ownership_transfer (GICallableInfo *info) gi_callable_info_get_instance_ownership_transfer (GICallableInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo*) info; GIRealInfo *rinfo = (GIRealInfo*) info;
SignatureBlob *blob; 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 * @info: a #GICallableInfo
* *
* Obtain the number of arguments (both IN and OUT) for this callable. * 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. * Returns: The number of arguments this callable expects.
*/ */
gint gint
g_callable_info_get_n_args (GICallableInfo *info) gi_callable_info_get_n_args (GICallableInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
gint offset; 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 * @info: a #GICallableInfo
* @n: the argument index to fetch * @n: the argument index to fetch
* *
* Obtain information about a particular argument of this callable. * Obtain information about a particular argument of this callable.
* *
* Returns: (transfer full): the #GIArgInfo. Free it with * Returns: (transfer full): the #GIArgInfo. Free it with
* g_base_info_unref() when done. * gi_base_info_unref() when done.
*/ */
GIArgInfo * GIArgInfo *
g_callable_info_get_arg (GICallableInfo *info, gi_callable_info_get_arg (GICallableInfo *info,
gint n) gint n)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
Header *header; Header *header;
@ -361,26 +361,26 @@ g_callable_info_get_arg (GICallableInfo *info,
offset = signature_offset (info); offset = signature_offset (info);
header = (Header *)rinfo->typelib->data; header = (Header *)rinfo->typelib->data;
return (GIArgInfo *) g_info_new (GI_INFO_TYPE_ARG, (GIBaseInfo*)info, rinfo->typelib, return (GIArgInfo *) gi_info_new (GI_INFO_TYPE_ARG, (GIBaseInfo*)info, rinfo->typelib,
offset + header->signature_blob_size + n * header->arg_blob_size); offset + header->signature_blob_size + n * header->arg_blob_size);
} }
/** /**
* g_callable_info_load_arg: * gi_callable_info_load_arg:
* @info: a #GICallableInfo * @info: a #GICallableInfo
* @n: the argument index to fetch * @n: the argument index to fetch
* @arg: (out caller-allocates): Initialize with argument number @n * @arg: (out caller-allocates): Initialize with argument number @n
* *
* Obtain information about a particular argument of this callable; this * 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. * allocation.
* *
* The initialized @arg must not be referenced after @info is deallocated. * The initialized @arg must not be referenced after @info is deallocated.
*/ */
void void
g_callable_info_load_arg (GICallableInfo *info, gi_callable_info_load_arg (GICallableInfo *info,
gint n, gint n,
GIArgInfo *arg) GIArgInfo *arg)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
Header *header; Header *header;
@ -392,12 +392,12 @@ g_callable_info_load_arg (GICallableInfo *info,
offset = signature_offset (info); offset = signature_offset (info);
header = (Header *)rinfo->typelib->data; header = (Header *)rinfo->typelib->data;
_g_info_init ((GIRealInfo*)arg, GI_INFO_TYPE_ARG, rinfo->repository, (GIBaseInfo*)info, rinfo->typelib, 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); 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 * @info: a #GICallableInfo
* @name: a freeform string naming an attribute * @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 * Returns: The value of the attribute, or %NULL if no such attribute exists
*/ */
const gchar * const gchar *
g_callable_info_get_return_attribute (GICallableInfo *info, gi_callable_info_get_return_attribute (GICallableInfo *info,
const gchar *name) const gchar *name)
{ {
GIAttributeIter iter = { 0, }; GIAttributeIter iter = { 0, };
gchar *curname, *curvalue; 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) if (g_strcmp0 (name, curname) == 0)
return (const gchar*) curvalue; 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 * @info: a #GICallableInfo
* @iterator: (inout): a #GIAttributeIter structure, must be initialized; see below * @iterator: (inout): a #GIAttributeIter structure, must be initialized; see below
* @name: (out) (transfer none): Returned name, must not be freed * @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 * Both the @name and @value should be treated as constants
* and must not be freed. * 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. * similar API.
* *
* Returns: %TRUE if there are more attributes * Returns: %TRUE if there are more attributes
*/ */
gboolean gboolean
g_callable_info_iterate_return_attributes (GICallableInfo *info, gi_callable_info_iterate_return_attributes (GICallableInfo *info,
GIAttributeIter *iterator, GIAttributeIter *iterator,
char **name, char **name,
char **value) char **value)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
Header *header = (Header *)rinfo->typelib->data; 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) if (next == NULL || next->offset != blob_offset || next >= after)
return FALSE; return FALSE;
*name = (gchar*) g_typelib_get_string (rinfo->typelib, next->name); *name = (gchar*) gi_typelib_get_string (rinfo->typelib, next->name);
*value = (gchar*) g_typelib_get_string (rinfo->typelib, next->value); *value = (gchar*) gi_typelib_get_string (rinfo->typelib, next->value);
iterator->data = next + 1; iterator->data = next + 1;
return TRUE; return TRUE;
@ -567,14 +567,14 @@ gi_type_info_extract_ffi_return_value (GITypeInfo *return_info,
GIFFIReturnValue *ffi_value, GIFFIReturnValue *ffi_value,
GIArgument *arg) 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; GIInfoType interface_type = GI_INFO_TYPE_INVALID;
if (return_tag == GI_TYPE_TAG_INTERFACE) if (return_tag == GI_TYPE_TAG_INTERFACE)
{ {
GIBaseInfo *interface_info = g_type_info_get_interface (return_info); GIBaseInfo *interface_info = gi_type_info_get_interface (return_info);
interface_type = g_base_info_get_type (interface_info); interface_type = gi_base_info_get_type (interface_info);
g_base_info_unref (interface_info); gi_base_info_unref (interface_info);
} }
gi_type_tag_extract_ffi_return_value (return_tag, interface_type, 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 * @info: TODO
* @function: TODO * @function: TODO
* @in_args: (array length=n_in_args): TODO * @in_args: (array length=n_in_args): TODO
@ -597,16 +597,16 @@ gi_type_info_extract_ffi_return_value (GITypeInfo *return_info,
* TODO * TODO
*/ */
gboolean gboolean
g_callable_info_invoke (GIFunctionInfo *info, gi_callable_info_invoke (GIFunctionInfo *info,
gpointer function, gpointer function,
const GIArgument *in_args, const GIArgument *in_args,
int n_in_args, int n_in_args,
const GIArgument *out_args, const GIArgument *out_args,
int n_out_args, int n_out_args,
GIArgument *return_value, GIArgument *return_value,
gboolean is_method, gboolean is_method,
gboolean throws, gboolean throws,
GError **error) GError **error)
{ {
ffi_cif cif; ffi_cif cif;
ffi_type *rtype; ffi_type *rtype;
@ -623,21 +623,21 @@ g_callable_info_invoke (GIFunctionInfo *info,
GIFFIReturnValue ffi_return_value; GIFFIReturnValue ffi_return_value;
gpointer return_value_p; /* Will point inside the union return_value */ gpointer return_value_p; /* Will point inside the union return_value */
rinfo = g_callable_info_get_return_type ((GICallableInfo *)info); rinfo = gi_callable_info_get_return_type ((GICallableInfo *)info);
rtype = g_type_info_get_ffi_type (rinfo); rtype = gi_type_info_get_ffi_type (rinfo);
rtag = g_type_info_get_tag(rinfo); rtag = gi_type_info_get_tag(rinfo);
in_pos = 0; in_pos = 0;
out_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 (is_method)
{ {
if (n_in_args == 0) if (n_in_args == 0)
{ {
g_set_error (error, g_set_error (error,
G_INVOKE_ERROR, GI_INVOKE_ERROR,
G_INVOKE_ERROR_ARGUMENT_MISMATCH, GI_INVOKE_ERROR_ARGUMENT_MISMATCH,
"Too few \"in\" arguments (handling this)"); "Too few \"in\" arguments (handling this)");
goto out; goto out;
} }
@ -662,20 +662,20 @@ g_callable_info_invoke (GIFunctionInfo *info,
for (i = 0; i < n_args; i++) for (i = 0; i < n_args; i++)
{ {
int offset = (is_method ? 1 : 0); int offset = (is_method ? 1 : 0);
ainfo = g_callable_info_get_arg ((GICallableInfo *)info, i); ainfo = gi_callable_info_get_arg ((GICallableInfo *)info, i);
switch (g_arg_info_get_direction (ainfo)) switch (gi_arg_info_get_direction (ainfo))
{ {
case GI_DIRECTION_IN: case GI_DIRECTION_IN:
tinfo = g_arg_info_get_type (ainfo); tinfo = gi_arg_info_get_type (ainfo);
atypes[i+offset] = g_type_info_get_ffi_type (tinfo); atypes[i+offset] = gi_type_info_get_ffi_type (tinfo);
g_base_info_unref ((GIBaseInfo *)ainfo); gi_base_info_unref ((GIBaseInfo *)ainfo);
g_base_info_unref ((GIBaseInfo *)tinfo); gi_base_info_unref ((GIBaseInfo *)tinfo);
if (in_pos >= n_in_args) if (in_pos >= n_in_args)
{ {
g_set_error (error, g_set_error (error,
G_INVOKE_ERROR, GI_INVOKE_ERROR,
G_INVOKE_ERROR_ARGUMENT_MISMATCH, GI_INVOKE_ERROR_ARGUMENT_MISMATCH,
"Too few \"in\" arguments (handling in)"); "Too few \"in\" arguments (handling in)");
goto out; goto out;
} }
@ -686,13 +686,13 @@ g_callable_info_invoke (GIFunctionInfo *info,
break; break;
case GI_DIRECTION_OUT: case GI_DIRECTION_OUT:
atypes[i+offset] = &ffi_type_pointer; atypes[i+offset] = &ffi_type_pointer;
g_base_info_unref ((GIBaseInfo *)ainfo); gi_base_info_unref ((GIBaseInfo *)ainfo);
if (out_pos >= n_out_args) if (out_pos >= n_out_args)
{ {
g_set_error (error, g_set_error (error,
G_INVOKE_ERROR, GI_INVOKE_ERROR,
G_INVOKE_ERROR_ARGUMENT_MISMATCH, GI_INVOKE_ERROR_ARGUMENT_MISMATCH,
"Too few \"out\" arguments (handling out)"); "Too few \"out\" arguments (handling out)");
goto out; goto out;
} }
@ -702,13 +702,13 @@ g_callable_info_invoke (GIFunctionInfo *info,
break; break;
case GI_DIRECTION_INOUT: case GI_DIRECTION_INOUT:
atypes[i+offset] = &ffi_type_pointer; atypes[i+offset] = &ffi_type_pointer;
g_base_info_unref ((GIBaseInfo *)ainfo); gi_base_info_unref ((GIBaseInfo *)ainfo);
if (in_pos >= n_in_args) if (in_pos >= n_in_args)
{ {
g_set_error (error, g_set_error (error,
G_INVOKE_ERROR, GI_INVOKE_ERROR,
G_INVOKE_ERROR_ARGUMENT_MISMATCH, GI_INVOKE_ERROR_ARGUMENT_MISMATCH,
"Too few \"in\" arguments (handling inout)"); "Too few \"in\" arguments (handling inout)");
goto out; goto out;
} }
@ -716,8 +716,8 @@ g_callable_info_invoke (GIFunctionInfo *info,
if (out_pos >= n_out_args) if (out_pos >= n_out_args)
{ {
g_set_error (error, g_set_error (error,
G_INVOKE_ERROR, GI_INVOKE_ERROR,
G_INVOKE_ERROR_ARGUMENT_MISMATCH, GI_INVOKE_ERROR_ARGUMENT_MISMATCH,
"Too few \"out\" arguments (handling inout)"); "Too few \"out\" arguments (handling inout)");
goto out; goto out;
} }
@ -727,7 +727,7 @@ g_callable_info_invoke (GIFunctionInfo *info,
out_pos++; out_pos++;
break; break;
default: default:
g_base_info_unref ((GIBaseInfo *)ainfo); gi_base_info_unref ((GIBaseInfo *)ainfo);
g_assert_not_reached (); g_assert_not_reached ();
} }
} }
@ -741,16 +741,16 @@ g_callable_info_invoke (GIFunctionInfo *info,
if (in_pos < n_in_args) if (in_pos < n_in_args)
{ {
g_set_error (error, g_set_error (error,
G_INVOKE_ERROR, GI_INVOKE_ERROR,
G_INVOKE_ERROR_ARGUMENT_MISMATCH, GI_INVOKE_ERROR_ARGUMENT_MISMATCH,
"Too many \"in\" arguments (at end)"); "Too many \"in\" arguments (at end)");
goto out; goto out;
} }
if (out_pos < n_out_args) if (out_pos < n_out_args)
{ {
g_set_error (error, g_set_error (error,
G_INVOKE_ERROR, GI_INVOKE_ERROR,
G_INVOKE_ERROR_ARGUMENT_MISMATCH, GI_INVOKE_ERROR_ARGUMENT_MISMATCH,
"Too many \"out\" arguments (at end)"); "Too many \"out\" arguments (at end)");
goto out; goto out;
} }
@ -788,6 +788,6 @@ g_callable_info_invoke (GIFunctionInfo *info,
success = TRUE; success = TRUE;
} }
out: out:
g_base_info_unref ((GIBaseInfo *)rinfo); gi_base_info_unref ((GIBaseInfo *)rinfo);
return success; return success;
} }

View File

@ -39,69 +39,69 @@ G_BEGIN_DECLS
* Checks if @info is a #GICallableInfo or derived from it. * Checks if @info is a #GICallableInfo or derived from it.
*/ */
#define GI_IS_CALLABLE_INFO(info) \ #define GI_IS_CALLABLE_INFO(info) \
((g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_FUNCTION) || \ ((gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_FUNCTION) || \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_CALLBACK) || \ (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_CALLBACK) || \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_SIGNAL) || \ (gi_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_VFUNC))
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gboolean g_callable_info_is_method (GICallableInfo *info); gboolean gi_callable_info_is_method (GICallableInfo *info);
GI_AVAILABLE_IN_ALL 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 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 GI_AVAILABLE_IN_ALL
void g_callable_info_load_return_type (GICallableInfo *info, void gi_callable_info_load_return_type (GICallableInfo *info,
GITypeInfo *type); GITypeInfo *type);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
const gchar * g_callable_info_get_return_attribute (GICallableInfo *info, const gchar * gi_callable_info_get_return_attribute (GICallableInfo *info,
const gchar *name); const gchar *name);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gboolean g_callable_info_iterate_return_attributes (GICallableInfo *info, gboolean gi_callable_info_iterate_return_attributes (GICallableInfo *info,
GIAttributeIter *iterator, GIAttributeIter *iterator,
char **name, char **name,
char **value); char **value);
GI_AVAILABLE_IN_ALL 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 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 GI_AVAILABLE_IN_ALL
gboolean g_callable_info_skip_return (GICallableInfo *info); gboolean gi_callable_info_skip_return (GICallableInfo *info);
GI_AVAILABLE_IN_ALL 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 GI_AVAILABLE_IN_ALL
GIArgInfo * g_callable_info_get_arg (GICallableInfo *info, GIArgInfo * gi_callable_info_get_arg (GICallableInfo *info,
gint n); gint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
void g_callable_info_load_arg (GICallableInfo *info, void gi_callable_info_load_arg (GICallableInfo *info,
gint n, gint n,
GIArgInfo *arg); GIArgInfo *arg);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gboolean g_callable_info_invoke (GICallableInfo *info, gboolean gi_callable_info_invoke (GICallableInfo *info,
gpointer function, gpointer function,
const GIArgument *in_args, const GIArgument *in_args,
int n_in_args, int n_in_args,
const GIArgument *out_args, const GIArgument *out_args,
int n_out_args, int n_out_args,
GIArgument *return_value, GIArgument *return_value,
gboolean is_method, gboolean is_method,
gboolean throws, gboolean throws,
GError **error); GError **error);
GI_AVAILABLE_IN_ALL 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 G_END_DECLS

View File

@ -40,46 +40,46 @@
* GIConstantInfo represents a constant. * GIConstantInfo represents a constant.
* *
* A constant has a type associated which can be obtained by calling * 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 * gi_constant_info_get_type() and a value, which can be obtained by
* calling g_constant_info_get_value(). * calling gi_constant_info_get_value().
*/ */
/** /**
* g_constant_info_get_type: * gi_constant_info_get_type:
* @info: a #GIConstantInfo * @info: a #GIConstantInfo
* *
* Obtain the type of the constant as a #GITypeInfo. * Obtain the type of the constant as a #GITypeInfo.
* *
* Returns: (transfer full): the #GITypeInfo. Free the struct by calling * Returns: (transfer full): the #GITypeInfo. Free the struct by calling
* g_base_info_unref() when done. * gi_base_info_unref() when done.
*/ */
GITypeInfo * GITypeInfo *
g_constant_info_get_type (GIConstantInfo *info) gi_constant_info_get_type (GIConstantInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
g_return_val_if_fail (info != NULL, NULL); g_return_val_if_fail (info != NULL, NULL);
g_return_val_if_fail (GI_IS_CONSTANT_INFO (info), 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) \ #define DO_ALIGNED_COPY(dest_addr, src_addr, type) \
memcpy((dest_addr), (src_addr), sizeof(type)) memcpy((dest_addr), (src_addr), sizeof(type))
/** /**
* g_constant_info_free_value: (skip) * gi_constant_info_free_value: (skip)
* @info: a #GIConstantInfo * @info: a #GIConstantInfo
* @value: the argument * @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 * Since: 1.32
*/ */
void void
g_constant_info_free_value (GIConstantInfo *info, gi_constant_info_free_value (GIConstantInfo *info,
GIArgument *value) GIArgument *value)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ConstantBlob *blob; 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 * @info: a #GIConstantInfo
* @value: (out): an argument * @value: (out): an argument
* *
* Obtain the value associated with the #GIConstantInfo and store it in the * Obtain the value associated with the #GIConstantInfo and store it in the
* @value parameter. @argument needs to be allocated before passing it in. * @value parameter. @argument needs to be allocated before passing it in.
* The size of the constant value stored in @argument will be returned. * 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 * Returns: size of the constant
*/ */
gint gint
g_constant_info_get_value (GIConstantInfo *info, gi_constant_info_get_value (GIConstantInfo *info,
GIArgument *value) GIArgument *value)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ConstantBlob *blob; ConstantBlob *blob;
@ -126,13 +126,9 @@ g_constant_info_get_value (GIConstantInfo *info,
{ {
if (blob->type.flags.pointer) if (blob->type.flags.pointer)
{ {
#if GLIB_CHECK_VERSION (2, 67, 5)
gsize blob_size = blob->size; gsize blob_size = blob->size;
value->v_pointer = g_memdup2 (&rinfo->typelib->data[blob->offset], 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 else
{ {

View File

@ -39,17 +39,17 @@ G_BEGIN_DECLS
* Checks if @info is a #GIConstantInfo. * Checks if @info is a #GIConstantInfo.
*/ */
#define GI_IS_CONSTANT_INFO(info) \ #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 GI_AVAILABLE_IN_ALL
GITypeInfo * g_constant_info_get_type (GIConstantInfo *info); GITypeInfo * gi_constant_info_get_type (GIConstantInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
void g_constant_info_free_value(GIConstantInfo *info, void gi_constant_info_free_value (GIConstantInfo *info,
GIArgument *value); GIArgument *value);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint g_constant_info_get_value(GIConstantInfo *info, gint gi_constant_info_get_value (GIConstantInfo *info,
GIArgument *value); GIArgument *value);
G_END_DECLS G_END_DECLS

View File

@ -41,12 +41,12 @@
* *
* The GIEnumInfo contains a set of values and a type. * 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. * a GIEnumInfo.
*/ */
/** /**
* g_enum_info_get_n_values: * gi_enum_info_get_n_values:
* @info: a #GIEnumInfo * @info: a #GIEnumInfo
* *
* Obtain the number of values this enumeration contains. * Obtain the number of values this enumeration contains.
@ -54,7 +54,7 @@
* Returns: the number of enumeration values * Returns: the number of enumeration values
*/ */
gint gint
g_enum_info_get_n_values (GIEnumInfo *info) gi_enum_info_get_n_values (GIEnumInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
EnumBlob *blob; 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 * @info: a #GIEnumInfo
* *
* Obtain the string form of the quark for the error domain associated with * 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 * Since: 1.30
*/ */
const gchar * const gchar *
g_enum_info_get_error_domain (GIEnumInfo *info) gi_enum_info_get_error_domain (GIEnumInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
EnumBlob *blob; EnumBlob *blob;
@ -90,23 +90,23 @@ g_enum_info_get_error_domain (GIEnumInfo *info)
blob = (EnumBlob *)&rinfo->typelib->data[rinfo->offset]; blob = (EnumBlob *)&rinfo->typelib->data[rinfo->offset];
if (blob->error_domain) 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 else
return NULL; return NULL;
} }
/** /**
* g_enum_info_get_value: * gi_enum_info_get_value:
* @info: a #GIEnumInfo * @info: a #GIEnumInfo
* @n: index of value to fetch * @n: index of value to fetch
* *
* Obtain a value for this enumeration. * Obtain a value for this enumeration.
* *
* Returns: (transfer full): the enumeration value or %NULL if type tag is wrong, * 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 * GIValueInfo *
g_enum_info_get_value (GIEnumInfo *info, gi_enum_info_get_value (GIEnumInfo *info,
gint n) gint n)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -120,11 +120,11 @@ g_enum_info_get_value (GIEnumInfo *info,
offset = rinfo->offset + header->enum_blob_size offset = rinfo->offset + header->enum_blob_size
+ n * header->value_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 * @info: a #GIEnumInfo
* *
* Obtain the number of methods that this enum type has. * Obtain the number of methods that this enum type has.
@ -133,7 +133,7 @@ g_enum_info_get_value (GIEnumInfo *info,
* Since: 1.30 * Since: 1.30
*/ */
gint gint
g_enum_info_get_n_methods (GIEnumInfo *info) gi_enum_info_get_n_methods (GIEnumInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
EnumBlob *blob; 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 * @info: a #GIEnumInfo
* @n: index of method to get * @n: index of method to get
* *
* Obtain an enum type method at index @n. * Obtain an enum type method at index @n.
* *
* Returns: (transfer full): the #GIFunctionInfo. Free the struct by calling * 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 * Since: 1.30
*/ */
GIFunctionInfo * GIFunctionInfo *
g_enum_info_get_method (GIEnumInfo *info, gi_enum_info_get_method (GIEnumInfo *info,
gint n) gint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -176,12 +176,12 @@ g_enum_info_get_method (GIEnumInfo *info,
+ blob->n_values * header->value_blob_size + blob->n_values * header->value_blob_size
+ n * header->function_blob_size; + n * header->function_blob_size;
return (GIFunctionInfo *) g_info_new (GI_INFO_TYPE_FUNCTION, (GIBaseInfo*)info, return (GIFunctionInfo *) gi_info_new (GI_INFO_TYPE_FUNCTION, (GIBaseInfo*)info,
rinfo->typelib, offset); rinfo->typelib, offset);
} }
/** /**
* g_enum_info_get_storage_type: * gi_enum_info_get_storage_type:
* @info: a #GIEnumInfo * @info: a #GIEnumInfo
* *
* Obtain the tag of the type used for the enum in the C ABI. This will * 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 * Returns: the storage type for the enumeration
*/ */
GITypeTag GITypeTag
g_enum_info_get_storage_type (GIEnumInfo *info) gi_enum_info_get_storage_type (GIEnumInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
EnumBlob *blob; 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 * @info: a #GIValueInfo
* *
* Obtain the enumeration value of the #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. * return type is to allow both.
*/ */
gint64 gint64
g_value_info_get_value (GIValueInfo *info) gi_value_info_get_value (GIValueInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ValueBlob *blob; ValueBlob *blob;

View File

@ -39,8 +39,8 @@ G_BEGIN_DECLS
* Checks if @info is a #GIEnumInfo. * Checks if @info is a #GIEnumInfo.
*/ */
#define GI_IS_ENUM_INFO(info) \ #define GI_IS_ENUM_INFO(info) \
((g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_ENUM) || \ ((gi_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_FLAGS))
/** /**
* GI_IS_VALUE_INFO * GI_IS_VALUE_INFO
@ -49,31 +49,31 @@ G_BEGIN_DECLS
* Checks if @info is a #GIValueInfo. * Checks if @info is a #GIValueInfo.
*/ */
#define GI_IS_VALUE_INFO(info) \ #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 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 GI_AVAILABLE_IN_ALL
GIValueInfo * g_enum_info_get_value (GIEnumInfo *info, GIValueInfo * gi_enum_info_get_value (GIEnumInfo *info,
gint n); gint n);
GI_AVAILABLE_IN_ALL 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 GI_AVAILABLE_IN_ALL
GIFunctionInfo * g_enum_info_get_method (GIEnumInfo *info, GIFunctionInfo * gi_enum_info_get_method (GIEnumInfo *info,
gint n); gint n);
GI_AVAILABLE_IN_ALL 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 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 GI_AVAILABLE_IN_ALL
gint64 g_value_info_get_value (GIValueInfo *info); gint64 gi_value_info_get_value (GIValueInfo *info);
G_END_DECLS G_END_DECLS

View File

@ -39,8 +39,8 @@
* *
* A GIFieldInfo struct represents a field of a struct, union, or object. * A GIFieldInfo struct represents a field of a struct, union, or object.
* *
* The GIFieldInfo is fetched by calling g_struct_info_get_field(), * The GIFieldInfo is fetched by calling gi_struct_info_get_field(),
* g_union_info_get_field() or g_object_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, * 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. * 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 * @info: a #GIFieldInfo
* *
* Obtain the flags for this #GIFieldInfo. See #GIFieldInfoFlags for possible * Obtain the flags for this #GIFieldInfo. See #GIFieldInfoFlags for possible
@ -58,7 +58,7 @@
* Returns: the flags * Returns: the flags
*/ */
GIFieldInfoFlags GIFieldInfoFlags
g_field_info_get_flags (GIFieldInfo *info) gi_field_info_get_flags (GIFieldInfo *info)
{ {
GIFieldInfoFlags flags; GIFieldInfoFlags flags;
GIRealInfo *rinfo = (GIRealInfo *)info; 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 * @info: a #GIFieldInfo
* *
* Obtain the size in bits of the field member, this is how * 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 * Returns: the field size
*/ */
gint gint
g_field_info_get_size (GIFieldInfo *info) gi_field_info_get_size (GIFieldInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
FieldBlob *blob; 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 * @info: a #GIFieldInfo
* *
* Obtain the offset in bytes of the field member, this is relative * 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 * Returns: the field offset
*/ */
gint gint
g_field_info_get_offset (GIFieldInfo *info) gi_field_info_get_offset (GIFieldInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
FieldBlob *blob; 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 * @info: a #GIFieldInfo
* *
* Obtain the type of a field as a #GITypeInfo. * Obtain the type of a field as a #GITypeInfo.
* *
* Returns: (transfer full): the #GITypeInfo. Free the struct by calling * Returns: (transfer full): the #GITypeInfo. Free the struct by calling
* g_base_info_unref() when done. * gi_base_info_unref() when done.
*/ */
GITypeInfo * GITypeInfo *
g_field_info_get_type (GIFieldInfo *info) gi_field_info_get_type (GIFieldInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
Header *header = (Header *)rinfo->typelib->data; Header *header = (Header *)rinfo->typelib->data;
@ -150,19 +150,19 @@ g_field_info_get_type (GIFieldInfo *info)
if (blob->has_embedded_type) if (blob->has_embedded_type)
{ {
type_info = (GIRealInfo *) g_info_new (GI_INFO_TYPE_TYPE, type_info = (GIRealInfo *) gi_info_new (GI_INFO_TYPE_TYPE,
(GIBaseInfo*)info, rinfo->typelib, (GIBaseInfo*)info, rinfo->typelib,
rinfo->offset + header->field_blob_size); rinfo->offset + header->field_blob_size);
type_info->type_is_embedded = TRUE; type_info->type_is_embedded = TRUE;
} }
else 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; return (GIBaseInfo*)type_info;
} }
/** /**
* g_field_info_get_field: (skip) * gi_field_info_get_field: (skip)
* @field_info: a #GIFieldInfo * @field_info: a #GIFieldInfo
* @mem: pointer to a block of memory representing a C structure or union * @mem: pointer to a block of memory representing a C structure or union
* @value: a #GIArgument into which to store the value retrieved * @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 * Returns: %TRUE if reading the field succeeded, otherwise %FALSE
*/ */
gboolean gboolean
g_field_info_get_field (GIFieldInfo *field_info, gi_field_info_get_field (GIFieldInfo *field_info,
gpointer mem, gpointer mem,
GIArgument *value) GIArgument *value)
{ {
int offset; int offset;
GITypeInfo *type_info; 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 (field_info != NULL, FALSE);
g_return_val_if_fail (GI_IS_FIELD_INFO (field_info), 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; return FALSE;
offset = g_field_info_get_offset (field_info); offset = gi_field_info_get_offset (field_info);
type_info = g_field_info_get_type (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); value->v_pointer = G_STRUCT_MEMBER (gpointer, mem, offset);
result = TRUE; result = TRUE;
} }
else else
{ {
switch (g_type_info_get_tag (type_info)) switch (gi_type_info_get_tag (type_info))
{ {
case GI_TYPE_TAG_VOID: case GI_TYPE_TAG_VOID:
g_warning("Field %s: should not be have void type", 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; break;
case GI_TYPE_TAG_BOOLEAN: case GI_TYPE_TAG_BOOLEAN:
value->v_boolean = G_STRUCT_MEMBER (gboolean, mem, offset) != FALSE; 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_GSLIST:
case GI_TYPE_TAG_GHASH: case GI_TYPE_TAG_GHASH:
g_warning("Field %s: type %s should have is_pointer set", g_warning("Field %s: type %s should have is_pointer set",
g_base_info_get_name ((GIBaseInfo *)field_info), gi_base_info_get_name ((GIBaseInfo *)field_info),
g_type_tag_to_string (g_type_info_get_tag (type_info))); gi_type_tag_to_string (gi_type_info_get_tag (type_info)));
break; break;
case GI_TYPE_TAG_ERROR: case GI_TYPE_TAG_ERROR:
/* Needs to be handled by the language binding directly */ /* Needs to be handled by the language binding directly */
break; break;
case GI_TYPE_TAG_INTERFACE: case GI_TYPE_TAG_INTERFACE:
{ {
GIBaseInfo *interface = g_type_info_get_interface (type_info); GIBaseInfo *interface = gi_type_info_get_interface (type_info);
switch (g_base_info_get_type (interface)) switch (gi_base_info_get_type (interface))
{ {
case GI_INFO_TYPE_STRUCT: case GI_INFO_TYPE_STRUCT:
case GI_INFO_TYPE_UNION: case GI_INFO_TYPE_UNION:
@ -276,13 +276,13 @@ g_field_info_get_field (GIFieldInfo *field_info,
case GI_INFO_TYPE_FLAGS: case GI_INFO_TYPE_FLAGS:
{ {
/* FIXME: there's a mismatch here between the value->v_int we use /* 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(). * here and the gint64 result returned from gi_value_info_get_value().
* But to switch this to gint64, we'd have to make g_function_info_invoke() * 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 * translate value->v_int64 to the proper ABI for an enum function
* call parameter, which will usually be int, and then fix up language * call parameter, which will usually be int, and then fix up language
* bindings. * 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) switch (storage_type)
{ {
case GI_TYPE_TAG_INT8: case GI_TYPE_TAG_INT8:
@ -307,8 +307,8 @@ g_field_info_get_field (GIFieldInfo *field_info,
break; break;
default: default:
g_warning("Field %s: Unexpected enum storage type %s", g_warning("Field %s: Unexpected enum storage type %s",
g_base_info_get_name ((GIBaseInfo *)field_info), gi_base_info_get_name ((GIBaseInfo *)field_info),
g_type_tag_to_string (storage_type)); gi_type_tag_to_string (storage_type));
break; break;
} }
break; break;
@ -316,8 +316,8 @@ g_field_info_get_field (GIFieldInfo *field_info,
case GI_INFO_TYPE_VFUNC: case GI_INFO_TYPE_VFUNC:
case GI_INFO_TYPE_CALLBACK: case GI_INFO_TYPE_CALLBACK:
g_warning("Field %s: Interface type %d should have is_pointer set", g_warning("Field %s: Interface type %d should have is_pointer set",
g_base_info_get_name ((GIBaseInfo *)field_info), gi_base_info_get_name ((GIBaseInfo *)field_info),
g_base_info_get_type (interface)); gi_base_info_get_type (interface));
break; break;
case GI_INFO_TYPE_INVALID: case GI_INFO_TYPE_INVALID:
case GI_INFO_TYPE_INTERFACE: 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_TYPE:
case GI_INFO_TYPE_UNRESOLVED: case GI_INFO_TYPE_UNRESOLVED:
g_warning("Field %s: Interface type %d not expected", g_warning("Field %s: Interface type %d not expected",
g_base_info_get_name ((GIBaseInfo *)field_info), gi_base_info_get_name ((GIBaseInfo *)field_info),
g_base_info_get_type (interface)); gi_base_info_get_type (interface));
break; break;
default: default:
break; break;
} }
g_base_info_unref ((GIBaseInfo *)interface); gi_base_info_unref ((GIBaseInfo *)interface);
break; break;
} }
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; return result;
} }
/** /**
* g_field_info_set_field: (skip) * gi_field_info_set_field: (skip)
* @field_info: a #GIFieldInfo * @field_info: a #GIFieldInfo
* @mem: pointer to a block of memory representing a C structure or union * @mem: pointer to a block of memory representing a C structure or union
* @value: a #GIArgument holding the value to store * @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 * Returns: %TRUE if writing the field succeeded, otherwise %FALSE
*/ */
gboolean gboolean
g_field_info_set_field (GIFieldInfo *field_info, gi_field_info_set_field (GIFieldInfo *field_info,
gpointer mem, gpointer mem,
const GIArgument *value) const GIArgument *value)
{ {
int offset; int offset;
GITypeInfo *type_info; 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 (field_info != NULL, FALSE);
g_return_val_if_fail (GI_IS_FIELD_INFO (field_info), 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; return FALSE;
offset = g_field_info_get_offset (field_info); offset = gi_field_info_get_offset (field_info);
type_info = g_field_info_get_type (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: case GI_TYPE_TAG_VOID:
g_warning("Field %s: should not be have void type", 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; break;
case GI_TYPE_TAG_BOOLEAN: case GI_TYPE_TAG_BOOLEAN:
G_STRUCT_MEMBER (gboolean, mem, offset) = value->v_boolean != FALSE; 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_GSLIST:
case GI_TYPE_TAG_GHASH: case GI_TYPE_TAG_GHASH:
g_warning("Field %s: type %s should have is_pointer set", g_warning("Field %s: type %s should have is_pointer set",
g_base_info_get_name ((GIBaseInfo *)field_info), gi_base_info_get_name ((GIBaseInfo *)field_info),
g_type_tag_to_string (g_type_info_get_tag (type_info))); gi_type_tag_to_string (gi_type_info_get_tag (type_info)));
break; break;
case GI_TYPE_TAG_ERROR: case GI_TYPE_TAG_ERROR:
/* Needs to be handled by the language binding directly */ /* Needs to be handled by the language binding directly */
break; break;
case GI_TYPE_TAG_INTERFACE: case GI_TYPE_TAG_INTERFACE:
{ {
GIBaseInfo *interface = g_type_info_get_interface (type_info); GIBaseInfo *interface = gi_type_info_get_interface (type_info);
switch (g_base_info_get_type (interface)) switch (gi_base_info_get_type (interface))
{ {
case GI_INFO_TYPE_STRUCT: case GI_INFO_TYPE_STRUCT:
case GI_INFO_TYPE_UNION: case GI_INFO_TYPE_UNION:
@ -461,7 +461,7 @@ g_field_info_set_field (GIFieldInfo *field_info,
{ {
/* See FIXME above /* 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) switch (storage_type)
{ {
case GI_TYPE_TAG_INT8: case GI_TYPE_TAG_INT8:
@ -486,8 +486,8 @@ g_field_info_set_field (GIFieldInfo *field_info,
break; break;
default: default:
g_warning("Field %s: Unexpected enum storage type %s", g_warning("Field %s: Unexpected enum storage type %s",
g_base_info_get_name ((GIBaseInfo *)field_info), gi_base_info_get_name ((GIBaseInfo *)field_info),
g_type_tag_to_string (storage_type)); gi_type_tag_to_string (storage_type));
break; break;
} }
break; break;
@ -496,8 +496,8 @@ g_field_info_set_field (GIFieldInfo *field_info,
case GI_INFO_TYPE_VFUNC: case GI_INFO_TYPE_VFUNC:
case GI_INFO_TYPE_CALLBACK: case GI_INFO_TYPE_CALLBACK:
g_warning("Field%s: Interface type %d should have is_pointer set", g_warning("Field%s: Interface type %d should have is_pointer set",
g_base_info_get_name ((GIBaseInfo *)field_info), gi_base_info_get_name ((GIBaseInfo *)field_info),
g_base_info_get_type (interface)); gi_base_info_get_type (interface));
break; break;
case GI_INFO_TYPE_INVALID: case GI_INFO_TYPE_INVALID:
case GI_INFO_TYPE_INTERFACE: 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_TYPE:
case GI_INFO_TYPE_UNRESOLVED: case GI_INFO_TYPE_UNRESOLVED:
g_warning("Field %s: Interface type %d not expected", g_warning("Field %s: Interface type %d not expected",
g_base_info_get_name ((GIBaseInfo *)field_info), gi_base_info_get_name ((GIBaseInfo *)field_info),
g_base_info_get_type (interface)); gi_base_info_get_type (interface));
break; break;
default: default:
break; break;
} }
g_base_info_unref ((GIBaseInfo *)interface); gi_base_info_unref ((GIBaseInfo *)interface);
break; break;
} }
break; break;
@ -527,12 +527,12 @@ g_field_info_set_field (GIFieldInfo *field_info,
break; break;
} }
} else { } else {
switch (g_type_info_get_tag (type_info)) switch (gi_type_info_get_tag (type_info))
{ {
case GI_TYPE_TAG_INTERFACE: case GI_TYPE_TAG_INTERFACE:
{ {
GIBaseInfo *interface = g_type_info_get_interface (type_info); GIBaseInfo *interface = gi_type_info_get_interface (type_info);
switch (g_base_info_get_type (interface)) switch (gi_base_info_get_type (interface))
{ {
case GI_INFO_TYPE_OBJECT: case GI_INFO_TYPE_OBJECT:
case GI_INFO_TYPE_INTERFACE: case GI_INFO_TYPE_INTERFACE:
@ -542,7 +542,7 @@ g_field_info_set_field (GIFieldInfo *field_info,
default: default:
break; break;
} }
g_base_info_unref ((GIBaseInfo *)interface); gi_base_info_unref ((GIBaseInfo *)interface);
} }
break; break;
default: 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; return result;
} }

View File

@ -40,29 +40,29 @@ G_BEGIN_DECLS
* *
*/ */
#define GI_IS_FIELD_INFO(info) \ #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 GI_AVAILABLE_IN_ALL
GIFieldInfoFlags g_field_info_get_flags (GIFieldInfo *info); GIFieldInfoFlags gi_field_info_get_flags (GIFieldInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint g_field_info_get_size (GIFieldInfo *info); gint gi_field_info_get_size (GIFieldInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint g_field_info_get_offset (GIFieldInfo *info); gint gi_field_info_get_offset (GIFieldInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GITypeInfo * g_field_info_get_type (GIFieldInfo *info); GITypeInfo * gi_field_info_get_type (GIFieldInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gboolean g_field_info_get_field (GIFieldInfo *field_info, gboolean gi_field_info_get_field (GIFieldInfo *field_info,
gpointer mem, gpointer mem,
GIArgument *value); GIArgument *value);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gboolean g_field_info_set_field (GIFieldInfo *field_info, gboolean gi_field_info_set_field (GIFieldInfo *field_info,
gpointer mem, gpointer mem,
const GIArgument *value); const GIArgument *value);
G_END_DECLS G_END_DECLS

View File

@ -41,17 +41,17 @@
* GIFunctionInfo represents a function, method or constructor. * GIFunctionInfo represents a function, method or constructor.
* *
* To find out what kind of entity a #GIFunctionInfo represents, call * 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 * See also #GICallableInfo for information on how to retreive arguments and
* other metadata. * other metadata.
*/ */
GIFunctionInfo * GIFunctionInfo *
_g_base_info_find_method (GIBaseInfo *base, gi_base_info_find_method (GIBaseInfo *base,
guint32 offset, guint32 offset,
gint n_methods, gint n_methods,
const gchar *name) const gchar *name)
{ {
/* FIXME hash */ /* FIXME hash */
GIRealInfo *rinfo = (GIRealInfo*)base; 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]; const gchar *fname = (const gchar *)&rinfo->typelib->data[fblob->name];
if (strcmp (name, fname) == 0) if (strcmp (name, fname) == 0)
return (GIFunctionInfo *) g_info_new (GI_INFO_TYPE_FUNCTION, base, return (GIFunctionInfo *) gi_info_new (GI_INFO_TYPE_FUNCTION, base,
rinfo->typelib, offset); rinfo->typelib, offset);
offset += header->function_blob_size; 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 * @info: a #GIFunctionInfo
* *
* Obtain the symbol of the function. The symbol is the name of the * 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 * Returns: the symbol
*/ */
const gchar * const gchar *
g_function_info_get_symbol (GIFunctionInfo *info) gi_function_info_get_symbol (GIFunctionInfo *info)
{ {
GIRealInfo *rinfo; GIRealInfo *rinfo;
FunctionBlob *blob; FunctionBlob *blob;
@ -95,11 +95,11 @@ g_function_info_get_symbol (GIFunctionInfo *info)
rinfo = (GIRealInfo *)info; rinfo = (GIRealInfo *)info;
blob = (FunctionBlob *)&rinfo->typelib->data[rinfo->offset]; 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 * @info: a #GIFunctionInfo
* *
* Obtain the #GIFunctionInfoFlags for the @info. * Obtain the #GIFunctionInfoFlags for the @info.
@ -107,7 +107,7 @@ g_function_info_get_symbol (GIFunctionInfo *info)
* Returns: the flags * Returns: the flags
*/ */
GIFunctionInfoFlags GIFunctionInfoFlags
g_function_info_get_flags (GIFunctionInfo *info) gi_function_info_get_flags (GIFunctionInfo *info)
{ {
GIFunctionInfoFlags flags; GIFunctionInfoFlags flags;
GIRealInfo *rinfo; 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 * @info: a #GIFunctionInfo
* *
* Obtain the property associated with this #GIFunctionInfo. * Obtain the property associated with this #GIFunctionInfo.
@ -153,10 +153,10 @@ g_function_info_get_flags (GIFunctionInfo *info)
* %NULL will be returned. * %NULL will be returned.
* *
* Returns: (transfer full): the property or %NULL if not set. Free it with * 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 * GIPropertyInfo *
g_function_info_get_property (GIFunctionInfo *info) gi_function_info_get_property (GIFunctionInfo *info)
{ {
GIRealInfo *rinfo, *container_rinfo; GIRealInfo *rinfo, *container_rinfo;
FunctionBlob *blob; FunctionBlob *blob;
@ -172,20 +172,20 @@ g_function_info_get_property (GIFunctionInfo *info)
{ {
GIInterfaceInfo *container = (GIInterfaceInfo *)rinfo->container; 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) else if (container_rinfo->type == GI_INFO_TYPE_OBJECT)
{ {
GIObjectInfo *container = (GIObjectInfo *)rinfo->container; GIObjectInfo *container = (GIObjectInfo *)rinfo->container;
return g_object_info_get_property (container, blob->index); return gi_object_info_get_property (container, blob->index);
} }
else else
return NULL; return NULL;
} }
/** /**
* g_function_info_get_vfunc: * gi_function_info_get_vfunc:
* @info: a #GIFunctionInfo * @info: a #GIFunctionInfo
* *
* Obtain the virtual function associated with this #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. * a virtual function set. For other cases, %NULL will be returned.
* *
* Returns: (transfer full): the virtual function or %NULL if not set. * 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 * GIVFuncInfo *
g_function_info_get_vfunc (GIFunctionInfo *info) gi_function_info_get_vfunc (GIFunctionInfo *info)
{ {
GIRealInfo *rinfo; GIRealInfo *rinfo;
FunctionBlob *blob; FunctionBlob *blob;
@ -209,27 +209,27 @@ g_function_info_get_vfunc (GIFunctionInfo *info)
blob = (FunctionBlob *)&rinfo->typelib->data[rinfo->offset]; blob = (FunctionBlob *)&rinfo->typelib->data[rinfo->offset];
container = (GIInterfaceInfo *)rinfo->container; 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 * TODO
* *
* Returns: TODO * Returns: TODO
*/ */
GQuark GQuark
g_invoke_error_quark (void) gi_invoke_error_quark (void)
{ {
static GQuark quark = 0; static GQuark quark = 0;
if (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; return quark;
} }
/** /**
* g_function_info_invoke: (skip) * gi_function_info_invoke: (skip)
* @info: a #GIFunctionInfo describing the function to invoke * @info: a #GIFunctionInfo describing the function to invoke
* @in_args: (array length=n_in_args): an array of #GIArgument<!-- -->s, one for each in * @in_args: (array length=n_in_args): an array of #GIArgument<!-- -->s, one for each in
* parameter of @info. If there are no in parameter, @in_args * parameter of @info. If there are no in parameter, @in_args
@ -254,44 +254,44 @@ g_invoke_error_quark (void)
* error occurred. * error occurred.
*/ */
gboolean gboolean
g_function_info_invoke (GIFunctionInfo *info, gi_function_info_invoke (GIFunctionInfo *info,
const GIArgument *in_args, const GIArgument *in_args,
int n_in_args, int n_in_args,
const GIArgument *out_args, const GIArgument *out_args,
int n_out_args, int n_out_args,
GIArgument *return_value, GIArgument *return_value,
GError **error) GError **error)
{ {
const gchar *symbol; const gchar *symbol;
gpointer func; gpointer func;
gboolean is_method; gboolean is_method;
gboolean throws; 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), if (!gi_typelib_symbol (gi_base_info_get_typelib ((GIBaseInfo *) info),
symbol, &func)) symbol, &func))
{ {
g_set_error (error, g_set_error (error,
G_INVOKE_ERROR, GI_INVOKE_ERROR,
G_INVOKE_ERROR_SYMBOL_NOT_FOUND, GI_INVOKE_ERROR_SYMBOL_NOT_FOUND,
"Could not locate %s: %s", symbol, g_module_error ()); "Could not locate %s: %s", symbol, g_module_error ());
return FALSE; return FALSE;
} }
is_method = (g_function_info_get_flags (info) & GI_FUNCTION_IS_METHOD) != 0 is_method = (gi_function_info_get_flags (info) & GI_FUNCTION_IS_METHOD) != 0
&& (g_function_info_get_flags (info) & GI_FUNCTION_IS_CONSTRUCTOR) == 0; && (gi_function_info_get_flags (info) & GI_FUNCTION_IS_CONSTRUCTOR) == 0;
throws = g_function_info_get_flags (info) & GI_FUNCTION_THROWS; throws = gi_function_info_get_flags (info) & GI_FUNCTION_THROWS;
return g_callable_info_invoke ((GICallableInfo*) info, return gi_callable_info_invoke ((GICallableInfo*) info,
func, func,
in_args, in_args,
n_in_args, n_in_args,
out_args, out_args,
n_out_args, n_out_args,
return_value, return_value,
is_method, is_method,
throws, throws,
error); error);
} }

View File

@ -39,59 +39,59 @@ G_BEGIN_DECLS
* Checks if @info is a #GIFunctionInfo. * Checks if @info is a #GIFunctionInfo.
*/ */
#define GI_IS_FUNCTION_INFO(info) \ #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 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 GI_AVAILABLE_IN_ALL
GIFunctionInfoFlags g_function_info_get_flags (GIFunctionInfo *info); GIFunctionInfoFlags gi_function_info_get_flags (GIFunctionInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIPropertyInfo * g_function_info_get_property (GIFunctionInfo *info); GIPropertyInfo * gi_function_info_get_property (GIFunctionInfo *info);
GI_AVAILABLE_IN_ALL 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 * TODO
*/ */
#define G_INVOKE_ERROR (g_invoke_error_quark ()) #define GI_INVOKE_ERROR (gi_invoke_error_quark ())
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GQuark g_invoke_error_quark (void); GQuark gi_invoke_error_quark (void);
/** /**
* GInvokeError: * GIInvokeError:
* @G_INVOKE_ERROR_FAILED: invokation failed, unknown error. * @GI_INVOKE_ERROR_FAILED: invokation failed, unknown error.
* @G_INVOKE_ERROR_SYMBOL_NOT_FOUND: symbol couldn't be found in any of the * @GI_INVOKE_ERROR_SYMBOL_NOT_FOUND: symbol couldn't be found in any of the
* libraries associated with the typelib of the function. * libraries associated with the typelib of the function.
* @G_INVOKE_ERROR_ARGUMENT_MISMATCH: the arguments provided didn't match * @GI_INVOKE_ERROR_ARGUMENT_MISMATCH: the arguments provided didn't match
* the expected arguments for the functions type signature. * the expected arguments for the functions type signature.
* *
* An error occuring while invoking a function via * An error occuring while invoking a function via
* g_function_info_invoke(). * gi_function_info_invoke().
*/ */
typedef enum typedef enum
{ {
G_INVOKE_ERROR_FAILED, GI_INVOKE_ERROR_FAILED,
G_INVOKE_ERROR_SYMBOL_NOT_FOUND, GI_INVOKE_ERROR_SYMBOL_NOT_FOUND,
G_INVOKE_ERROR_ARGUMENT_MISMATCH GI_INVOKE_ERROR_ARGUMENT_MISMATCH
} GInvokeError; } GIInvokeError;
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gboolean g_function_info_invoke (GIFunctionInfo *info, gboolean gi_function_info_invoke (GIFunctionInfo *info,
const GIArgument *in_args, const GIArgument *in_args,
int n_in_args, int n_in_args,
const GIArgument *out_args, const GIArgument *out_args,
int n_out_args, int n_out_args,
GIArgument *return_value, GIArgument *return_value,
GError **error); GError **error);
G_END_DECLS G_END_DECLS

View File

@ -43,7 +43,7 @@
*/ */
/** /**
* g_interface_info_get_n_prerequisites: * gi_interface_info_get_n_prerequisites:
* @info: a #GIInterfaceInfo * @info: a #GIInterfaceInfo
* *
* Obtain the number of prerequisites for this interface type. * Obtain the number of prerequisites for this interface type.
@ -53,7 +53,7 @@
* Returns: number of prerequisites * Returns: number of prerequisites
*/ */
gint gint
g_interface_info_get_n_prerequisites (GIInterfaceInfo *info) gi_interface_info_get_n_prerequisites (GIInterfaceInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
InterfaceBlob *blob; 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 * @info: a #GIInterfaceInfo
* @n: index of prerequisites to get * @n: index of prerequisites to get
* *
* Obtain an interface type prerequisites index @n. * Obtain an interface type prerequisites index @n.
* *
* Returns: (transfer full): the prerequisites as a #GIBaseInfo. Free the struct by calling * 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 * GIBaseInfo *
g_interface_info_get_prerequisite (GIInterfaceInfo *info, gi_interface_info_get_prerequisite (GIInterfaceInfo *info,
gint n) gint n)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
InterfaceBlob *blob; InterfaceBlob *blob;
@ -88,13 +88,13 @@ g_interface_info_get_prerequisite (GIInterfaceInfo *info,
blob = (InterfaceBlob *)&rinfo->typelib->data[rinfo->offset]; blob = (InterfaceBlob *)&rinfo->typelib->data[rinfo->offset];
return _g_info_from_entry (rinfo->repository, return gi_info_from_entry (rinfo->repository,
rinfo->typelib, blob->prerequisites[n]); rinfo->typelib, blob->prerequisites[n]);
} }
/** /**
* g_interface_info_get_n_properties: * gi_interface_info_get_n_properties:
* @info: a #GIInterfaceInfo * @info: a #GIInterfaceInfo
* *
* Obtain the number of properties that this interface type has. * 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 * Returns: number of properties
*/ */
gint gint
g_interface_info_get_n_properties (GIInterfaceInfo *info) gi_interface_info_get_n_properties (GIInterfaceInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
InterfaceBlob *blob; 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 * @info: a #GIInterfaceInfo
* @n: index of property to get * @n: index of property to get
* *
* Obtain an interface type property at index @n. * Obtain an interface type property at index @n.
* *
* Returns: (transfer full): the #GIPropertyInfo. Free the struct by calling * Returns: (transfer full): the #GIPropertyInfo. Free the struct by calling
* g_base_info_unref() when done. * gi_base_info_unref() when done.
*/ */
GIPropertyInfo * GIPropertyInfo *
g_interface_info_get_property (GIInterfaceInfo *info, gi_interface_info_get_property (GIInterfaceInfo *info,
gint n) gint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -144,12 +144,12 @@ g_interface_info_get_property (GIInterfaceInfo *info,
+ (blob->n_prerequisites + (blob->n_prerequisites % 2)) * 2 + (blob->n_prerequisites + (blob->n_prerequisites % 2)) * 2
+ n * header->property_blob_size; + n * header->property_blob_size;
return (GIPropertyInfo *) g_info_new (GI_INFO_TYPE_PROPERTY, (GIBaseInfo*)info, return (GIPropertyInfo *) gi_info_new (GI_INFO_TYPE_PROPERTY, (GIBaseInfo*)info,
rinfo->typelib, offset); rinfo->typelib, offset);
} }
/** /**
* g_interface_info_get_n_methods: * gi_interface_info_get_n_methods:
* @info: a #GIInterfaceInfo * @info: a #GIInterfaceInfo
* *
* Obtain the number of methods that this interface type has. * 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 * Returns: number of methods
*/ */
gint gint
g_interface_info_get_n_methods (GIInterfaceInfo *info) gi_interface_info_get_n_methods (GIInterfaceInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
InterfaceBlob *blob; 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 * @info: a #GIInterfaceInfo
* @n: index of method to get * @n: index of method to get
* *
* Obtain an interface type method at index @n. * Obtain an interface type method at index @n.
* *
* Returns: (transfer full): the #GIFunctionInfo. Free the struct by calling * Returns: (transfer full): the #GIFunctionInfo. Free the struct by calling
* g_base_info_unref() when done. * gi_base_info_unref() when done.
*/ */
GIFunctionInfo * GIFunctionInfo *
g_interface_info_get_method (GIInterfaceInfo *info, gi_interface_info_get_method (GIInterfaceInfo *info,
gint n) gint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -200,12 +200,12 @@ g_interface_info_get_method (GIInterfaceInfo *info,
+ blob->n_properties * header->property_blob_size + blob->n_properties * header->property_blob_size
+ n * header->function_blob_size; + n * header->function_blob_size;
return (GIFunctionInfo *) g_info_new (GI_INFO_TYPE_FUNCTION, (GIBaseInfo*)info, return (GIFunctionInfo *) gi_info_new (GI_INFO_TYPE_FUNCTION, (GIBaseInfo*)info,
rinfo->typelib, offset); rinfo->typelib, offset);
} }
/** /**
* g_interface_info_find_method: * gi_interface_info_find_method:
* @info: a #GIInterfaceInfo * @info: a #GIInterfaceInfo
* @name: name of method to obtain * @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. * returned if there's no method available with that name.
* *
* Returns: (transfer full): the #GIFunctionInfo or %NULL if none found. * 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 * GIFunctionInfo *
g_interface_info_find_method (GIInterfaceInfo *info, gi_interface_info_find_method (GIInterfaceInfo *info,
const gchar *name) const gchar *name)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; 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_prerequisites + (blob->n_prerequisites % 2)) * 2
+ blob->n_properties * header->property_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_interface_info_get_n_signals: * gi_interface_info_get_n_signals:
* @info: a #GIInterfaceInfo * @info: a #GIInterfaceInfo
* *
* Obtain the number of signals that this interface type has. * 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 * Returns: number of signals
*/ */
gint gint
g_interface_info_get_n_signals (GIInterfaceInfo *info) gi_interface_info_get_n_signals (GIInterfaceInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
InterfaceBlob *blob; 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 * @info: a #GIInterfaceInfo
* @n: index of signal to get * @n: index of signal to get
* *
* Obtain an interface type signal at index @n. * Obtain an interface type signal at index @n.
* *
* Returns: (transfer full): the #GISignalInfo. Free the struct by calling * Returns: (transfer full): the #GISignalInfo. Free the struct by calling
* g_base_info_unref() when done. * gi_base_info_unref() when done.
*/ */
GISignalInfo * GISignalInfo *
g_interface_info_get_signal (GIInterfaceInfo *info, gi_interface_info_get_signal (GIInterfaceInfo *info,
gint n) gint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -284,12 +284,12 @@ g_interface_info_get_signal (GIInterfaceInfo *info,
+ blob->n_methods * header->function_blob_size + blob->n_methods * header->function_blob_size
+ n * header->signal_blob_size; + n * header->signal_blob_size;
return (GISignalInfo *) g_info_new (GI_INFO_TYPE_SIGNAL, (GIBaseInfo*)info, return (GISignalInfo *) gi_info_new (GI_INFO_TYPE_SIGNAL, (GIBaseInfo*)info,
rinfo->typelib, offset); rinfo->typelib, offset);
} }
/** /**
* g_interface_info_find_signal: * gi_interface_info_find_signal:
* @info: a #GIInterfaceInfo * @info: a #GIInterfaceInfo
* @name: Name of signal * @name: Name of signal
* *
@ -300,20 +300,20 @@ g_interface_info_get_signal (GIInterfaceInfo *info,
* Since: 1.34 * Since: 1.34
*/ */
GISignalInfo * GISignalInfo *
g_interface_info_find_signal (GIInterfaceInfo *info, gi_interface_info_find_signal (GIInterfaceInfo *info,
const gchar *name) const gchar *name)
{ {
gint n_signals; gint n_signals;
gint i; 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++) 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; 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 * @info: a #GIInterfaceInfo
* *
* Obtain the number of virtual functions that this interface type has. * 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 * Returns: number of virtual functions
*/ */
gint gint
g_interface_info_get_n_vfuncs (GIInterfaceInfo *info) gi_interface_info_get_n_vfuncs (GIInterfaceInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
InterfaceBlob *blob; 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 * @info: a #GIInterfaceInfo
* @n: index of virtual function to get * @n: index of virtual function to get
* *
* Obtain an interface type virtual function at index @n. * Obtain an interface type virtual function at index @n.
* *
* Returns: (transfer full): the #GIVFuncInfo. Free the struct by calling * Returns: (transfer full): the #GIVFuncInfo. Free the struct by calling
* g_base_info_unref() when done. * gi_base_info_unref() when done.
*/ */
GIVFuncInfo * GIVFuncInfo *
g_interface_info_get_vfunc (GIInterfaceInfo *info, gi_interface_info_get_vfunc (GIInterfaceInfo *info,
gint n) gint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -376,24 +376,24 @@ g_interface_info_get_vfunc (GIInterfaceInfo *info,
+ blob->n_signals * header->signal_blob_size + blob->n_signals * header->signal_blob_size
+ n * header->vfunc_blob_size; + n * header->vfunc_blob_size;
return (GIVFuncInfo *) g_info_new (GI_INFO_TYPE_VFUNC, (GIBaseInfo*)info, return (GIVFuncInfo *) gi_info_new (GI_INFO_TYPE_VFUNC, (GIBaseInfo*)info,
rinfo->typelib, offset); rinfo->typelib, offset);
} }
/** /**
* g_interface_info_find_vfunc: * gi_interface_info_find_vfunc:
* @info: a #GIInterfaceInfo * @info: a #GIInterfaceInfo
* @name: The name of a virtual function to find. * @name: The name of a virtual function to find.
* *
* Locate a virtual function slot with name @name. See the documentation * 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 * Returns: (transfer full): the #GIVFuncInfo, or %NULL. Free it with
* g_base_info_unref() when done. * gi_base_info_unref() when done.
*/ */
GIVFuncInfo * GIVFuncInfo *
g_interface_info_find_vfunc (GIInterfaceInfo *info, gi_interface_info_find_vfunc (GIInterfaceInfo *info,
const gchar *name) const gchar *name)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -412,11 +412,11 @@ g_interface_info_find_vfunc (GIInterfaceInfo *info,
+ blob->n_methods * header->function_blob_size + blob->n_methods * header->function_blob_size
+ blob->n_signals * header->signal_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 * @info: a #GIInterfaceInfo
* *
* Obtain the number of constants that this interface type has. * 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 * Returns: number of constants
*/ */
gint gint
g_interface_info_get_n_constants (GIInterfaceInfo *info) gi_interface_info_get_n_constants (GIInterfaceInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
InterfaceBlob *blob; 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 * @info: a #GIInterfaceInfo
* @n: index of constant to get * @n: index of constant to get
* *
* Obtain an interface type constant at index @n. * Obtain an interface type constant at index @n.
* *
* Returns: (transfer full): the #GIConstantInfo. Free the struct by calling * Returns: (transfer full): the #GIConstantInfo. Free the struct by calling
* g_base_info_unref() when done. * gi_base_info_unref() when done.
*/ */
GIConstantInfo * GIConstantInfo *
g_interface_info_get_constant (GIInterfaceInfo *info, gi_interface_info_get_constant (GIInterfaceInfo *info,
gint n) gint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -470,21 +470,21 @@ g_interface_info_get_constant (GIInterfaceInfo *info,
+ blob->n_vfuncs * header->vfunc_blob_size + blob->n_vfuncs * header->vfunc_blob_size
+ n * header->constant_blob_size; + n * header->constant_blob_size;
return (GIConstantInfo *) g_info_new (GI_INFO_TYPE_CONSTANT, (GIBaseInfo*)info, return (GIConstantInfo *) gi_info_new (GI_INFO_TYPE_CONSTANT, (GIBaseInfo*)info,
rinfo->typelib, offset); rinfo->typelib, offset);
} }
/** /**
* g_interface_info_get_iface_struct: * gi_interface_info_get_iface_struct:
* @info: a #GIInterfaceInfo * @info: a #GIInterfaceInfo
* *
* Returns the layout C structure associated with this #GInterface. * Returns the layout C structure associated with this #GInterface.
* *
* Returns: (transfer full): the #GIStructInfo or %NULL. Free it with * Returns: (transfer full): the #GIStructInfo or %NULL. Free it with
* g_base_info_unref() when done. * gi_base_info_unref() when done.
*/ */
GIStructInfo * GIStructInfo *
g_interface_info_get_iface_struct (GIInterfaceInfo *info) gi_interface_info_get_iface_struct (GIInterfaceInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
InterfaceBlob *blob; InterfaceBlob *blob;
@ -495,7 +495,7 @@ g_interface_info_get_iface_struct (GIInterfaceInfo *info)
blob = (InterfaceBlob *)&rinfo->typelib->data[rinfo->offset]; blob = (InterfaceBlob *)&rinfo->typelib->data[rinfo->offset];
if (blob->gtype_struct) if (blob->gtype_struct)
return (GIStructInfo *) _g_info_from_entry (rinfo->repository, return (GIStructInfo *) gi_info_from_entry (rinfo->repository,
rinfo->typelib, blob->gtype_struct); rinfo->typelib, blob->gtype_struct);
else else
return NULL; return NULL;

View File

@ -39,65 +39,65 @@ G_BEGIN_DECLS
* Checks if @info is a #GIInterfaceInfo. * Checks if @info is a #GIInterfaceInfo.
*/ */
#define GI_IS_INTERFACE_INFO(info) \ #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 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 GI_AVAILABLE_IN_ALL
GIBaseInfo * g_interface_info_get_prerequisite (GIInterfaceInfo *info, GIBaseInfo * gi_interface_info_get_prerequisite (GIInterfaceInfo *info,
gint n); gint n);
GI_AVAILABLE_IN_ALL 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 GI_AVAILABLE_IN_ALL
GIPropertyInfo * g_interface_info_get_property (GIInterfaceInfo *info, GIPropertyInfo * gi_interface_info_get_property (GIInterfaceInfo *info,
gint n); gint n);
GI_AVAILABLE_IN_ALL 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 GI_AVAILABLE_IN_ALL
GIFunctionInfo * g_interface_info_get_method (GIInterfaceInfo *info, GIFunctionInfo * gi_interface_info_get_method (GIInterfaceInfo *info,
gint n); gint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIFunctionInfo * g_interface_info_find_method (GIInterfaceInfo *info, GIFunctionInfo * gi_interface_info_find_method (GIInterfaceInfo *info,
const gchar *name); const gchar *name);
GI_AVAILABLE_IN_ALL 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 GI_AVAILABLE_IN_ALL
GISignalInfo * g_interface_info_get_signal (GIInterfaceInfo *info, GISignalInfo * gi_interface_info_get_signal (GIInterfaceInfo *info,
gint n); gint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GISignalInfo * g_interface_info_find_signal (GIInterfaceInfo *info, GISignalInfo * gi_interface_info_find_signal (GIInterfaceInfo *info,
const gchar *name); const gchar *name);
GI_AVAILABLE_IN_ALL 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 GI_AVAILABLE_IN_ALL
GIVFuncInfo * g_interface_info_get_vfunc (GIInterfaceInfo *info, GIVFuncInfo * gi_interface_info_get_vfunc (GIInterfaceInfo *info,
gint n); gint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIVFuncInfo * g_interface_info_find_vfunc (GIInterfaceInfo *info, GIVFuncInfo * gi_interface_info_find_vfunc (GIInterfaceInfo *info,
const gchar *name); const gchar *name);
GI_AVAILABLE_IN_ALL 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 GI_AVAILABLE_IN_ALL
GIConstantInfo * g_interface_info_get_constant (GIInterfaceInfo *info, GIConstantInfo * gi_interface_info_get_constant (GIInterfaceInfo *info,
gint n); gint n);
GI_AVAILABLE_IN_ALL 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 G_END_DECLS

View File

@ -49,7 +49,7 @@
*/ */
/** /**
* g_object_info_get_field_offset: * gi_object_info_get_field_offset:
* @info: a #GIObjectInfo * @info: a #GIObjectInfo
* @n: index of queried field * @n: index of queried field
* *
@ -58,8 +58,8 @@
* Returns: field offset in bytes * Returns: field offset in bytes
*/ */
static gint32 static gint32
g_object_info_get_field_offset (GIObjectInfo *info, gi_object_info_get_field_offset (GIObjectInfo *info,
gint n) gint n)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
Header *header = (Header *)rinfo->typelib->data; 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 * @info: a #GIObjectInfo
* *
* Obtain the parent of the object type. * Obtain the parent of the object type.
* *
* Returns: (transfer full) (nullable): the #GIObjectInfo. Free the struct by calling * Returns: (transfer full) (nullable): the #GIObjectInfo. Free the struct by calling
* g_base_info_unref() when done. * gi_base_info_unref() when done.
*/ */
GIObjectInfo * GIObjectInfo *
g_object_info_get_parent (GIObjectInfo *info) gi_object_info_get_parent (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob; ObjectBlob *blob;
@ -103,14 +103,14 @@ g_object_info_get_parent (GIObjectInfo *info)
blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset]; blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
if (blob->parent) if (blob->parent)
return (GIObjectInfo *) _g_info_from_entry (rinfo->repository, return (GIObjectInfo *) gi_info_from_entry (rinfo->repository,
rinfo->typelib, blob->parent); rinfo->typelib, blob->parent);
else else
return NULL; return NULL;
} }
/** /**
* g_object_info_get_abstract: * gi_object_info_get_abstract:
* @info: a #GIObjectInfo * @info: a #GIObjectInfo
* *
* Obtain if the object type is an abstract type, eg if it cannot be * 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 * Returns: %TRUE if the object type is abstract
*/ */
gboolean gboolean
g_object_info_get_abstract (GIObjectInfo *info) gi_object_info_get_abstract (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob; 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 * @info: a #GIObjectInfo
* *
* Checks whether the object type is a final type, i.e. if it cannot * 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 * Since: 1.70
*/ */
gboolean gboolean
g_object_info_get_final (GIObjectInfo *info) gi_object_info_get_final (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *) info; GIRealInfo *rinfo = (GIRealInfo *) info;
ObjectBlob *blob; 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 * @info: a #GIObjectInfo
* *
* Obtain if the object type is of a fundamental type which is not * 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 * Returns: %TRUE if the object type is a fundamental type
*/ */
gboolean gboolean
g_object_info_get_fundamental (GIObjectInfo *info) gi_object_info_get_fundamental (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob; 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 * @info: a #GIObjectInfo
* *
* Obtain the name of the objects class/type. * 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 * Returns: name of the objects type
*/ */
const gchar * const gchar *
g_object_info_get_type_name (GIObjectInfo *info) gi_object_info_get_type_name (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob; ObjectBlob *blob;
@ -199,11 +199,11 @@ g_object_info_get_type_name (GIObjectInfo *info)
blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset]; 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 * @info: a #GIObjectInfo
* *
* Obtain the function which when called will return the GType * 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 * Returns: the type init function
*/ */
const gchar * const gchar *
g_object_info_get_type_init (GIObjectInfo *info) gi_object_info_get_type_init (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob; ObjectBlob *blob;
@ -222,11 +222,11 @@ g_object_info_get_type_init (GIObjectInfo *info)
blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset]; 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 * @info: a #GIObjectInfo
* *
* Obtain the number of interfaces that this object type has. * 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 * Returns: number of interfaces
*/ */
gint gint
g_object_info_get_n_interfaces (GIObjectInfo *info) gi_object_info_get_n_interfaces (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob; 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 * @info: a #GIObjectInfo
* @n: index of interface to get * @n: index of interface to get
* *
* Obtain an object type interface at index @n. * Obtain an object type interface at index @n.
* *
* Returns: (transfer full): the #GIInterfaceInfo. Free the struct by calling * Returns: (transfer full): the #GIInterfaceInfo. Free the struct by calling
* g_base_info_unref() when done. * gi_base_info_unref() when done.
*/ */
GIInterfaceInfo * GIInterfaceInfo *
g_object_info_get_interface (GIObjectInfo *info, gi_object_info_get_interface (GIObjectInfo *info,
gint n) gint n)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob; ObjectBlob *blob;
@ -269,12 +269,12 @@ g_object_info_get_interface (GIObjectInfo *info,
blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset]; blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
return (GIInterfaceInfo *) _g_info_from_entry (rinfo->repository, return (GIInterfaceInfo *) gi_info_from_entry (rinfo->repository,
rinfo->typelib, blob->interfaces[n]); rinfo->typelib, blob->interfaces[n]);
} }
/** /**
* g_object_info_get_n_fields: * gi_object_info_get_n_fields:
* @info: a #GIObjectInfo * @info: a #GIObjectInfo
* *
* Obtain the number of fields that this object type has. * 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 * Returns: number of fields
*/ */
gint gint
g_object_info_get_n_fields (GIObjectInfo *info) gi_object_info_get_n_fields (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob; 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 * @info: a #GIObjectInfo
* @n: index of field to get * @n: index of field to get
* *
* Obtain an object type field at index @n. * Obtain an object type field at index @n.
* *
* Returns: (transfer full): the #GIFieldInfo. Free the struct by calling * Returns: (transfer full): the #GIFieldInfo. Free the struct by calling
* g_base_info_unref() when done. * gi_base_info_unref() when done.
*/ */
GIFieldInfo * GIFieldInfo *
g_object_info_get_field (GIObjectInfo *info, gi_object_info_get_field (GIObjectInfo *info,
gint n) gint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; 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 (info != NULL, NULL);
g_return_val_if_fail (GI_IS_OBJECT_INFO (info), 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 * @info: a #GIObjectInfo
* *
* Obtain the number of properties that this object type has. * 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 * Returns: number of properties
*/ */
gint gint
g_object_info_get_n_properties (GIObjectInfo *info) gi_object_info_get_n_properties (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob; 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 * @info: a #GIObjectInfo
* @n: index of property to get * @n: index of property to get
* *
* Obtain an object type property at index @n. * Obtain an object type property at index @n.
* *
* Returns: (transfer full): the #GIPropertyInfo. Free the struct by calling * Returns: (transfer full): the #GIPropertyInfo. Free the struct by calling
* g_base_info_unref() when done. * gi_base_info_unref() when done.
*/ */
GIPropertyInfo * GIPropertyInfo *
g_object_info_get_property (GIObjectInfo *info, gi_object_info_get_property (GIObjectInfo *info,
gint n) gint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -372,12 +372,12 @@ g_object_info_get_property (GIObjectInfo *info,
+ blob->n_field_callbacks * header->callback_blob_size + blob->n_field_callbacks * header->callback_blob_size
+ n * header->property_blob_size; + n * header->property_blob_size;
return (GIPropertyInfo *) g_info_new (GI_INFO_TYPE_PROPERTY, (GIBaseInfo*)info, return (GIPropertyInfo *) gi_info_new (GI_INFO_TYPE_PROPERTY, (GIBaseInfo*)info,
rinfo->typelib, offset); rinfo->typelib, offset);
} }
/** /**
* g_object_info_get_n_methods: * gi_object_info_get_n_methods:
* @info: a #GIObjectInfo * @info: a #GIObjectInfo
* *
* Obtain the number of methods that this object type has. * 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 * Returns: number of methods
*/ */
gint gint
g_object_info_get_n_methods (GIObjectInfo *info) gi_object_info_get_n_methods (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob; 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 * @info: a #GIObjectInfo
* @n: index of method to get * @n: index of method to get
* *
* Obtain an object type method at index @n. * Obtain an object type method at index @n.
* *
* Returns: (transfer full): the #GIFunctionInfo. Free the struct by calling * Returns: (transfer full): the #GIFunctionInfo. Free the struct by calling
* g_base_info_unref() when done. * gi_base_info_unref() when done.
*/ */
GIFunctionInfo * GIFunctionInfo *
g_object_info_get_method (GIObjectInfo *info, gi_object_info_get_method (GIObjectInfo *info,
gint n) gint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -431,12 +431,12 @@ g_object_info_get_method (GIObjectInfo *info,
+ blob->n_properties * header->property_blob_size + blob->n_properties * header->property_blob_size
+ n * header->function_blob_size; + n * header->function_blob_size;
return (GIFunctionInfo *) g_info_new (GI_INFO_TYPE_FUNCTION, (GIBaseInfo*)info, return (GIFunctionInfo *) gi_info_new (GI_INFO_TYPE_FUNCTION, (GIBaseInfo*)info,
rinfo->typelib, offset); rinfo->typelib, offset);
} }
/** /**
* g_object_info_find_method: * gi_object_info_find_method:
* @info: a #GIObjectInfo * @info: a #GIObjectInfo
* @name: name of method to obtain * @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. * returned if there's no method available with that name.
* *
* Returns: (transfer full) (nullable): the #GIFunctionInfo. Free the struct by calling * Returns: (transfer full) (nullable): the #GIFunctionInfo. Free the struct by calling
* g_base_info_unref() when done. * gi_base_info_unref() when done.
*/ */
GIFunctionInfo * GIFunctionInfo *
g_object_info_find_method (GIObjectInfo *info, gi_object_info_find_method (GIObjectInfo *info,
const gchar *name) const gchar *name)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; 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_field_callbacks * header->callback_blob_size
+ blob->n_properties * header->property_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 * @info: a #GIObjectInfo
* @name: name of method to obtain * @name: name of method to obtain
* @implementor: (out) (transfer full): The implementor of the interface * @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. * to chain up if that's desired.
* *
* Returns: (transfer full) (nullable): the #GIFunctionInfo. Free the struct by calling * Returns: (transfer full) (nullable): the #GIFunctionInfo. Free the struct by calling
* g_base_info_unref() when done. * gi_base_info_unref() when done.
*/ */
GIFunctionInfo * GIFunctionInfo *
g_object_info_find_method_using_interfaces (GIObjectInfo *info, gi_object_info_find_method_using_interfaces (GIObjectInfo *info,
const gchar *name, const gchar *name,
GIObjectInfo **implementor) GIObjectInfo **implementor)
{ {
GIFunctionInfo *result = NULL; GIFunctionInfo *result = NULL;
GIObjectInfo *implementor_result = NULL; GIObjectInfo *implementor_result = NULL;
result = g_object_info_find_method (info, name); result = gi_object_info_find_method (info, name);
if (result) if (result)
implementor_result = g_base_info_ref ((GIBaseInfo*) info); implementor_result = gi_base_info_ref ((GIBaseInfo*) info);
if (result == NULL) if (result == NULL)
{ {
int n_interfaces; int n_interfaces;
int i; 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) for (i = 0; i < n_interfaces; ++i)
{ {
GIInterfaceInfo *iface_info; 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) if (result != NULL)
{ {
implementor_result = iface_info; implementor_result = iface_info;
break; break;
} }
g_base_info_unref ((GIBaseInfo*) iface_info); gi_base_info_unref ((GIBaseInfo*) iface_info);
} }
} }
if (implementor) if (implementor)
*implementor = implementor_result; *implementor = implementor_result;
else if (implementor_result != NULL) else if (implementor_result != NULL)
g_base_info_unref ((GIBaseInfo*) implementor_result); gi_base_info_unref ((GIBaseInfo*) implementor_result);
return result; return result;
} }
/** /**
* g_object_info_get_n_signals: * gi_object_info_get_n_signals:
* @info: a #GIObjectInfo * @info: a #GIObjectInfo
* *
* Obtain the number of signals that this object type has. * 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 * Returns: number of signals
*/ */
gint gint
g_object_info_get_n_signals (GIObjectInfo *info) gi_object_info_get_n_signals (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob; 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 * @info: a #GIObjectInfo
* @n: index of signal to get * @n: index of signal to get
* *
* Obtain an object type signal at index @n. * Obtain an object type signal at index @n.
* *
* Returns: (transfer full): the #GISignalInfo. Free the struct by calling * Returns: (transfer full): the #GISignalInfo. Free the struct by calling
* g_base_info_unref() when done. * gi_base_info_unref() when done.
*/ */
GISignalInfo * GISignalInfo *
g_object_info_get_signal (GIObjectInfo *info, gi_object_info_get_signal (GIObjectInfo *info,
gint n) gint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -582,12 +582,12 @@ g_object_info_get_signal (GIObjectInfo *info,
+ blob->n_methods * header->function_blob_size + blob->n_methods * header->function_blob_size
+ n * header->signal_blob_size; + n * header->signal_blob_size;
return (GISignalInfo *) g_info_new (GI_INFO_TYPE_SIGNAL, (GIBaseInfo*)info, return (GISignalInfo *) gi_info_new (GI_INFO_TYPE_SIGNAL, (GIBaseInfo*)info,
rinfo->typelib, offset); rinfo->typelib, offset);
} }
/** /**
* g_object_info_find_signal: * gi_object_info_find_signal:
* @info: a #GIObjectInfo * @info: a #GIObjectInfo
* @name: Name of signal * @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. * Returns: (transfer full) (nullable): Info for the signal with name @name in @info, or %NULL on failure.
*/ */
GISignalInfo * GISignalInfo *
g_object_info_find_signal (GIObjectInfo *info, gi_object_info_find_signal (GIObjectInfo *info,
const gchar *name) const gchar *name)
{ {
gint n_signals; gint n_signals;
gint i; 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++) 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; 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 * @info: a #GIObjectInfo
* *
* Obtain the number of virtual functions that this object type has. * 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 * Returns: number of virtual functions
*/ */
gint gint
g_object_info_get_n_vfuncs (GIObjectInfo *info) gi_object_info_get_n_vfuncs (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob; 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 * @info: a #GIObjectInfo
* @n: index of virtual function to get * @n: index of virtual function to get
* *
* Obtain an object type virtual function at index @n. * Obtain an object type virtual function at index @n.
* *
* Returns: (transfer full): the #GIVFuncInfo. Free the struct by calling * Returns: (transfer full): the #GIVFuncInfo. Free the struct by calling
* g_base_info_unref() when done. * gi_base_info_unref() when done.
*/ */
GIVFuncInfo * GIVFuncInfo *
g_object_info_get_vfunc (GIObjectInfo *info, gi_object_info_get_vfunc (GIObjectInfo *info,
gint n) gint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -675,29 +675,29 @@ g_object_info_get_vfunc (GIObjectInfo *info,
+ blob->n_signals * header->signal_blob_size + blob->n_signals * header->signal_blob_size
+ n * header->vfunc_blob_size; + n * header->vfunc_blob_size;
return (GIVFuncInfo *) g_info_new (GI_INFO_TYPE_VFUNC, (GIBaseInfo*)info, return (GIVFuncInfo *) gi_info_new (GI_INFO_TYPE_VFUNC, (GIBaseInfo*)info,
rinfo->typelib, offset); rinfo->typelib, offset);
} }
/** /**
* g_object_info_find_vfunc: * gi_object_info_find_vfunc:
* @info: a #GIObjectInfo * @info: a #GIObjectInfo
* @name: The name of a virtual function to find. * @name: The name of a virtual function to find.
* *
* Locate a virtual function slot with name @name. Note that the namespace * 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 * 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 * 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. * 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. * information on invoking virtuals.
* *
* Returns: (transfer full) (nullable): the #GIVFuncInfo, or %NULL. Free it with * Returns: (transfer full) (nullable): the #GIVFuncInfo, or %NULL. Free it with
* g_base_info_unref() when done. * gi_base_info_unref() when done.
*/ */
GIVFuncInfo * GIVFuncInfo *
g_object_info_find_vfunc (GIObjectInfo *info, gi_object_info_find_vfunc (GIObjectInfo *info,
const gchar *name) const gchar *name)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -718,11 +718,11 @@ g_object_info_find_vfunc (GIObjectInfo *info,
+ blob->n_methods * header->function_blob_size + blob->n_methods * header->function_blob_size
+ blob->n_signals * header->signal_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 * @info: a #GIObjectInfo
* @name: name of vfunc to obtain * @name: name of vfunc to obtain
* @implementor: (out) (transfer full): The implementor of the interface * @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 * @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 * 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 * 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. * returned.
* *
* Note that this function does *not* search parent classes; you will have * Note that this function does *not* search parent classes; you will have
* to chain up if that's desired. * to chain up if that's desired.
* *
* Returns: (transfer full) (nullable): the #GIVFuncInfo. Free the struct by calling * Returns: (transfer full) (nullable): the #GIVFuncInfo. Free the struct by calling
* g_base_info_unref() when done. * gi_base_info_unref() when done.
*/ */
GIVFuncInfo * GIVFuncInfo *
g_object_info_find_vfunc_using_interfaces (GIObjectInfo *info, gi_object_info_find_vfunc_using_interfaces (GIObjectInfo *info,
const gchar *name, const gchar *name,
GIObjectInfo **implementor) GIObjectInfo **implementor)
{ {
GIVFuncInfo *result = NULL; GIVFuncInfo *result = NULL;
GIObjectInfo *implementor_result = NULL; GIObjectInfo *implementor_result = NULL;
result = g_object_info_find_vfunc (info, name); result = gi_object_info_find_vfunc (info, name);
if (result) if (result)
implementor_result = g_base_info_ref ((GIBaseInfo*) info); implementor_result = gi_base_info_ref ((GIBaseInfo*) info);
if (result == NULL) if (result == NULL)
{ {
int n_interfaces; int n_interfaces;
int i; 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) for (i = 0; i < n_interfaces; ++i)
{ {
GIInterfaceInfo *iface_info; 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) if (result != NULL)
{ {
implementor_result = iface_info; implementor_result = iface_info;
break; break;
} }
g_base_info_unref ((GIBaseInfo*) iface_info); gi_base_info_unref ((GIBaseInfo*) iface_info);
} }
} }
if (implementor) if (implementor)
*implementor = implementor_result; *implementor = implementor_result;
else if (implementor_result != NULL) else if (implementor_result != NULL)
g_base_info_unref ((GIBaseInfo*) implementor_result); gi_base_info_unref ((GIBaseInfo*) implementor_result);
return result; return result;
} }
/** /**
* g_object_info_get_n_constants: * gi_object_info_get_n_constants:
* @info: a #GIObjectInfo * @info: a #GIObjectInfo
* *
* Obtain the number of constants that this object type has. * 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 * Returns: number of constants
*/ */
gint gint
g_object_info_get_n_constants (GIObjectInfo *info) gi_object_info_get_n_constants (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob; 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 * @info: a #GIObjectInfo
* @n: index of constant to get * @n: index of constant to get
* *
* Obtain an object type constant at index @n. * Obtain an object type constant at index @n.
* *
* Returns: (transfer full): the #GIConstantInfo. Free the struct by calling * Returns: (transfer full): the #GIConstantInfo. Free the struct by calling
* g_base_info_unref() when done. * gi_base_info_unref() when done.
*/ */
GIConstantInfo * GIConstantInfo *
g_object_info_get_constant (GIObjectInfo *info, gi_object_info_get_constant (GIObjectInfo *info,
gint n) gint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -838,22 +838,22 @@ g_object_info_get_constant (GIObjectInfo *info,
+ blob->n_vfuncs * header->vfunc_blob_size + blob->n_vfuncs * header->vfunc_blob_size
+ n * header->constant_blob_size; + n * header->constant_blob_size;
return (GIConstantInfo *) g_info_new (GI_INFO_TYPE_CONSTANT, (GIBaseInfo*)info, return (GIConstantInfo *) gi_info_new (GI_INFO_TYPE_CONSTANT, (GIBaseInfo*)info,
rinfo->typelib, offset); rinfo->typelib, offset);
} }
/** /**
* g_object_info_get_class_struct: * gi_object_info_get_class_struct:
* @info: a #GIObjectInfo * @info: a #GIObjectInfo
* *
* Every #GObject has two structures; an instance structure and a class * Every #GObject has two structures; an instance structure and a class
* structure. This function returns the metadata for the class structure. * structure. This function returns the metadata for the class structure.
* *
* Returns: (transfer full) (nullable): the #GIStructInfo or %NULL. Free with * Returns: (transfer full) (nullable): the #GIStructInfo or %NULL. Free with
* g_base_info_unref() when done. * gi_base_info_unref() when done.
*/ */
GIStructInfo * GIStructInfo *
g_object_info_get_class_struct (GIObjectInfo *info) gi_object_info_get_class_struct (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob; ObjectBlob *blob;
@ -864,7 +864,7 @@ g_object_info_get_class_struct (GIObjectInfo *info)
blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset]; blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
if (blob->gtype_struct) if (blob->gtype_struct)
return (GIStructInfo *) _g_info_from_entry (rinfo->repository, return (GIStructInfo *) gi_info_from_entry (rinfo->repository,
rinfo->typelib, blob->gtype_struct); rinfo->typelib, blob->gtype_struct);
else else
return NULL; return NULL;
@ -881,11 +881,11 @@ _get_func(GIObjectInfo *info,
GIObjectInfo *parent_info; GIObjectInfo *parent_info;
gpointer func = NULL; gpointer func = NULL;
parent_info = g_base_info_ref (info); parent_info = gi_base_info_ref (info);
while (parent_info != NULL) while (parent_info != NULL)
{ {
parents = g_slist_prepend (parents, parent_info); 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) for (l = parents; l; l = l->next)
@ -895,28 +895,28 @@ _get_func(GIObjectInfo *info,
if (symbol == NULL) if (symbol == NULL)
continue; continue;
g_typelib_symbol (((GIRealInfo *)parent_info)->typelib, symbol, (gpointer*) &func); gi_typelib_symbol (((GIRealInfo *)parent_info)->typelib, symbol, (gpointer*) &func);
if (func) if (func)
break; break;
} }
g_slist_free_full (parents, (GDestroyNotify) g_base_info_unref); g_slist_free_full (parents, (GDestroyNotify) gi_base_info_unref);
return func; return func;
} }
/** /**
* g_object_info_get_ref_function: * gi_object_info_get_ref_function:
* @info: a #GIObjectInfo * @info: a #GIObjectInfo
* *
* Obtain the symbol name of the function that should be called to ref this * 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 * object type. It's mainly used fundamental types. The type signature for
* the symbol is %GIObjectInfoRefFunction, to fetch the function pointer * 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 * Returns: (nullable): the symbol or %NULL
*/ */
const char * const char *
g_object_info_get_ref_function (GIObjectInfo *info) gi_object_info_get_ref_function (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob; ObjectBlob *blob;
@ -927,13 +927,13 @@ g_object_info_get_ref_function (GIObjectInfo *info)
blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset]; blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
if (blob->ref_func) 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; return NULL;
} }
/** /**
* g_object_info_get_ref_function_pointer: (skip) * gi_object_info_get_ref_function_pointer: (skip)
* @info: a #GIObjectInfo * @info: a #GIObjectInfo
* *
* Obtain a pointer to a function which can be used to * 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 * Returns: (nullable): the function pointer or %NULL
*/ */
GIObjectInfoRefFunction 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 (info != NULL, NULL);
g_return_val_if_fail (GI_IS_OBJECT_INFO (info), 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 * @info: a #GIObjectInfo
* *
* Obtain the symbol name of the function that should be called to unref this * 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 * object type. It's mainly used fundamental types. The type signature for
* the symbol is %GIObjectInfoUnrefFunction, to fetch the function pointer * 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 * Returns: (nullable): the symbol or %NULL
*/ */
const char * const char *
g_object_info_get_unref_function (GIObjectInfo *info) gi_object_info_get_unref_function (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob; ObjectBlob *blob;
@ -975,13 +975,13 @@ g_object_info_get_unref_function (GIObjectInfo *info)
blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset]; blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
if (blob->unref_func) 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; return NULL;
} }
/** /**
* g_object_info_get_unref_function_pointer: (skip) * gi_object_info_get_unref_function_pointer: (skip)
* @info: a #GIObjectInfo * @info: a #GIObjectInfo
* *
* Obtain a pointer to a function which can be used to * 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 * Returns: (nullable): the function pointer or %NULL
*/ */
GIObjectInfoUnrefFunction 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 (info != NULL, NULL);
g_return_val_if_fail (GI_IS_OBJECT_INFO (info), 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 * @info: a #GIObjectInfo
* *
* Obtain the symbol name of the function that should be called to convert * 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. * set a GValue giving an object instance pointer of this object type.
* I's mainly used fundamental types. The type signature for the symbol * I's mainly used fundamental types. The type signature for the symbol
* is %GIObjectInfoSetValueFunction, to fetch the function pointer * 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 * Returns: (nullable): the symbol or %NULL
*/ */
const char * const char *
g_object_info_get_set_value_function (GIObjectInfo *info) gi_object_info_get_set_value_function (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob; ObjectBlob *blob;
@ -1024,13 +1024,13 @@ g_object_info_get_set_value_function (GIObjectInfo *info)
blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset]; blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
if (blob->set_value_func) 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; return NULL;
} }
/** /**
* g_object_info_get_set_value_function_pointer: (skip) * gi_object_info_get_set_value_function_pointer: (skip)
* @info: a #GIObjectInfo * @info: a #GIObjectInfo
* *
* Obtain a pointer to a function which can be used to * 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 * Returns: (nullable): the function pointer or %NULL
*/ */
GIObjectInfoSetValueFunction 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 (info != NULL, NULL);
g_return_val_if_fail (GI_IS_OBJECT_INFO (info), 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 * @info: a #GIObjectInfo
* *
* Obtain the symbol name of the function that should be called to convert * Obtain the symbol name of the function that should be called to convert
* an object instance pointer of this object type to a GValue. * an object instance pointer of this object type to a GValue.
* I's mainly used fundamental types. The type signature for the symbol * I's mainly used fundamental types. The type signature for the symbol
* is %GIObjectInfoGetValueFunction, to fetch the function pointer * 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 * Returns: (nullable): the symbol or %NULL
*/ */
const char * const char *
g_object_info_get_get_value_function (GIObjectInfo *info) gi_object_info_get_get_value_function (GIObjectInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob; ObjectBlob *blob;
@ -1073,13 +1073,13 @@ g_object_info_get_get_value_function (GIObjectInfo *info)
blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset]; blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
if (blob->get_value_func) 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; return NULL;
} }
/** /**
* g_object_info_get_get_value_function_pointer: (skip) * gi_object_info_get_get_value_function_pointer: (skip)
* @info: a #GIObjectInfo * @info: a #GIObjectInfo
* *
* Obtain a pointer to a function which can be used to * 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 * Returns: (nullable): the function pointer or %NULL
*/ */
GIObjectInfoGetValueFunction 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 (info != NULL, NULL);
g_return_val_if_fail (GI_IS_OBJECT_INFO (info), 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);
} }

View File

@ -76,132 +76,132 @@ typedef void * (*GIObjectInfoGetValueFunction) (const GValue *value);
* Checks if @info is a #GIObjectInfo. * Checks if @info is a #GIObjectInfo.
*/ */
#define GI_IS_OBJECT_INFO(info) \ #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 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 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 GI_AVAILABLE_IN_ALL
gboolean g_object_info_get_abstract (GIObjectInfo *info); gboolean gi_object_info_get_abstract (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gboolean g_object_info_get_final (GIObjectInfo *info); gboolean gi_object_info_get_final (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gboolean g_object_info_get_fundamental (GIObjectInfo *info); gboolean gi_object_info_get_fundamental (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIObjectInfo * g_object_info_get_parent (GIObjectInfo *info); GIObjectInfo * gi_object_info_get_parent (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL 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 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); gint n);
GI_AVAILABLE_IN_ALL 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 GI_AVAILABLE_IN_ALL
GIFieldInfo * g_object_info_get_field (GIObjectInfo *info, GIFunctionInfo * gi_object_info_get_method (GIObjectInfo *info,
gint n); gint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint g_object_info_get_n_properties (GIObjectInfo *info); GIFunctionInfo * gi_object_info_find_method (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,
const gchar *name); const gchar *name);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIFunctionInfo * g_object_info_find_method_using_interfaces (GIObjectInfo *info, GIFunctionInfo * gi_object_info_find_method_using_interfaces (GIObjectInfo *info,
const gchar *name, const gchar *name,
GIObjectInfo **implementor); GIObjectInfo **implementor);
GI_AVAILABLE_IN_ALL 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 GI_AVAILABLE_IN_ALL
GISignalInfo * g_object_info_get_signal (GIObjectInfo *info, GISignalInfo * gi_object_info_get_signal (GIObjectInfo *info,
gint n); gint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GISignalInfo * g_object_info_find_signal (GIObjectInfo *info, GISignalInfo * gi_object_info_find_signal (GIObjectInfo *info,
const gchar *name); const gchar *name);
GI_AVAILABLE_IN_ALL 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 GI_AVAILABLE_IN_ALL
GIVFuncInfo * g_object_info_get_vfunc (GIObjectInfo *info, GIVFuncInfo * gi_object_info_get_vfunc (GIObjectInfo *info,
gint n); gint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIVFuncInfo * g_object_info_find_vfunc (GIObjectInfo *info, GIVFuncInfo * gi_object_info_find_vfunc (GIObjectInfo *info,
const gchar *name); const gchar *name);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIVFuncInfo * g_object_info_find_vfunc_using_interfaces (GIObjectInfo *info, GIVFuncInfo * gi_object_info_find_vfunc_using_interfaces (GIObjectInfo *info,
const gchar *name, const gchar *name,
GIObjectInfo **implementor); GIObjectInfo **implementor);
GI_AVAILABLE_IN_ALL 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 GI_AVAILABLE_IN_ALL
GIConstantInfo * g_object_info_get_constant (GIObjectInfo *info, GIConstantInfo * gi_object_info_get_constant (GIObjectInfo *info,
gint n); gint n);
GI_AVAILABLE_IN_ALL 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 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 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 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 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 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 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 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 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 G_END_DECLS

View File

@ -42,7 +42,7 @@
*/ */
/** /**
* g_property_info_get_flags: * gi_property_info_get_flags:
* @info: a #GIPropertyInfo * @info: a #GIPropertyInfo
* *
* Obtain the flags for this property info. See #GParamFlags for * Obtain the flags for this property info. See #GParamFlags for
@ -51,7 +51,7 @@
* Returns: the flags * Returns: the flags
*/ */
GParamFlags GParamFlags
g_property_info_get_flags (GIPropertyInfo *info) gi_property_info_get_flags (GIPropertyInfo *info)
{ {
GParamFlags flags; GParamFlags flags;
GIRealInfo *rinfo = (GIRealInfo *)info; 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 * @info: a #GIPropertyInfo
* *
* Obtain the type information for the property @info. * Obtain the type information for the property @info.
* *
* Returns: (transfer full): the #GITypeInfo, free it with * Returns: (transfer full): the #GITypeInfo, free it with
* g_base_info_unref() when done. * gi_base_info_unref() when done.
*/ */
GITypeInfo * GITypeInfo *
g_property_info_get_type (GIPropertyInfo *info) gi_property_info_get_type (GIPropertyInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
g_return_val_if_fail (info != NULL, NULL); g_return_val_if_fail (info != NULL, NULL);
g_return_val_if_fail (GI_IS_PROPERTY_INFO (info), NULL); g_return_val_if_fail (GI_IS_PROPERTY_INFO (info), NULL);
return _g_type_info_new ((GIBaseInfo*)info, return gi_type_info_new ((GIBaseInfo*)info,
rinfo->typelib, rinfo->typelib,
rinfo->offset + G_STRUCT_OFFSET (PropertyBlob, type)); rinfo->offset + G_STRUCT_OFFSET (PropertyBlob, type));
} }
/** /**
* g_property_info_get_ownership_transfer: * gi_property_info_get_ownership_transfer:
* @info: a #GIPropertyInfo * @info: a #GIPropertyInfo
* *
* Obtain the ownership transfer for this property. See #GITransfer for more * 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 * Returns: the transfer
*/ */
GITransfer GITransfer
g_property_info_get_ownership_transfer (GIPropertyInfo *info) gi_property_info_get_ownership_transfer (GIPropertyInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
PropertyBlob *blob; 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 * @info: a #GIPropertyInfo
* *
* Obtains the setter function associated with this #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. * are also not %G_PARAM_CONSTRUCT_ONLY.
* *
* Returns: (transfer full) (nullable): the function info or %NULL if not set. * 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 * GIFunctionInfo *
g_property_info_get_setter (GIPropertyInfo *info) gi_property_info_get_setter (GIPropertyInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
PropertyBlob *blob; PropertyBlob *blob;
@ -160,17 +160,17 @@ g_property_info_get_setter (GIPropertyInfo *info)
return NULL; return NULL;
container = rinfo->container; 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) 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) 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 else
return NULL; return NULL;
} }
/** /**
* g_property_info_get_getter: * gi_property_info_get_getter:
* @info: a #GIPropertyInfo * @info: a #GIPropertyInfo
* *
* Obtains the getter function associated with this #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. * The setter is only available for %G_PARAM_READABLE properties.
* *
* Returns: (transfer full) (nullable): the function info or %NULL if not set. * 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 * GIFunctionInfo *
g_property_info_get_getter (GIPropertyInfo *info) gi_property_info_get_getter (GIPropertyInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
PropertyBlob *blob; PropertyBlob *blob;
@ -199,11 +199,11 @@ g_property_info_get_getter (GIPropertyInfo *info)
return NULL; return NULL;
container = rinfo->container; 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) 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) 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 else
return NULL; return NULL;
} }

View File

@ -39,22 +39,22 @@ G_BEGIN_DECLS
* Checks if @info is a #GIPropertyInfo. * Checks if @info is a #GIPropertyInfo.
*/ */
#define GI_IS_PROPERTY_INFO(info) \ #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 GI_AVAILABLE_IN_ALL
GParamFlags g_property_info_get_flags (GIPropertyInfo *info); GParamFlags gi_property_info_get_flags (GIPropertyInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GITypeInfo * g_property_info_get_type (GIPropertyInfo *info); GITypeInfo * gi_property_info_get_type (GIPropertyInfo *info);
GI_AVAILABLE_IN_ALL 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 GI_AVAILABLE_IN_ALL
GIFunctionInfo *g_property_info_get_setter (GIPropertyInfo *info); GIFunctionInfo *gi_property_info_get_setter (GIPropertyInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIFunctionInfo *g_property_info_get_getter (GIPropertyInfo *info); GIFunctionInfo *gi_property_info_get_getter (GIPropertyInfo *info);
G_END_DECLS G_END_DECLS

View File

@ -45,13 +45,13 @@
* *
* A registered type info struct has a name and a type function. * A registered type info struct has a name and a type function.
* *
* To get the name call g_registered_type_info_get_type_name(). * To get the name call gi_registered_type_info_get_type_name().
* Most users want to call g_registered_type_info_get_g_type() and don't worry * Most users want to call gi_registered_type_info_get_g_type() and don't worry
* about the rest of the details. * about the rest of the details.
*/ */
/** /**
* g_registered_type_info_get_type_name: * gi_registered_type_info_get_type_name:
* @info: a #GIRegisteredTypeInfo * @info: a #GIRegisteredTypeInfo
* *
* Obtain the type name of the struct within the GObject type system. * Obtain the type name of the struct within the GObject type system.
@ -60,7 +60,7 @@
* Returns: the type name * Returns: the type name
*/ */
const gchar * const gchar *
g_registered_type_info_get_type_name (GIRegisteredTypeInfo *info) gi_registered_type_info_get_type_name (GIRegisteredTypeInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
RegisteredTypeBlob *blob; RegisteredTypeBlob *blob;
@ -71,25 +71,25 @@ g_registered_type_info_get_type_name (GIRegisteredTypeInfo *info)
blob = (RegisteredTypeBlob *)&rinfo->typelib->data[rinfo->offset]; blob = (RegisteredTypeBlob *)&rinfo->typelib->data[rinfo->offset];
if (blob->gtype_name) 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; return NULL;
} }
/** /**
* g_registered_type_info_get_type_init: * gi_registered_type_info_get_type_init:
* @info: a #GIRegisteredTypeInfo * @info: a #GIRegisteredTypeInfo
* *
* Obtain the type init function for @info. The type init function is the * Obtain the type init function for @info. The type init function is the
* function which will register the GType within the GObject type system. * function which will register the GType within the GObject type system.
* Usually this is not called by langauge bindings or applications, use * 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 * Returns: the symbol name of the type init function, suitable for
* passing into g_module_symbol(). * passing into g_module_symbol().
*/ */
const gchar * const gchar *
g_registered_type_info_get_type_init (GIRegisteredTypeInfo *info) gi_registered_type_info_get_type_init (GIRegisteredTypeInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
RegisteredTypeBlob *blob; RegisteredTypeBlob *blob;
@ -100,13 +100,13 @@ g_registered_type_info_get_type_init (GIRegisteredTypeInfo *info)
blob = (RegisteredTypeBlob *)&rinfo->typelib->data[rinfo->offset]; blob = (RegisteredTypeBlob *)&rinfo->typelib->data[rinfo->offset];
if (blob->gtype_init) 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; return NULL;
} }
/** /**
* g_registered_type_info_get_g_type: * gi_registered_type_info_get_g_type:
* @info: a #GIRegisteredTypeInfo * @info: a #GIRegisteredTypeInfo
* *
* Obtain the #GType for this registered type or G_TYPE_NONE which a special meaning. * 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. * Returns: the #GType.
*/ */
GType GType
g_registered_type_info_get_g_type (GIRegisteredTypeInfo *info) gi_registered_type_info_get_g_type (GIRegisteredTypeInfo *info)
{ {
const char *type_init; const char *type_init;
GType (* get_type_func) (void); 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 (info != NULL, G_TYPE_INVALID);
g_return_val_if_fail (GI_IS_REGISTERED_TYPE_INFO (info), 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) if (type_init == NULL)
return G_TYPE_NONE; return G_TYPE_NONE;
else if (!strcmp (type_init, "intern")) else if (!strcmp (type_init, "intern"))
/* The special string "intern" is used for some types exposed by libgobject /* The special string "intern" is used for some types exposed by libgobject
(that therefore should be always available) */ (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; get_type_func = NULL;
if (!g_typelib_symbol (rinfo->typelib, if (!gi_typelib_symbol (rinfo->typelib,
type_init, type_init,
(void**) &get_type_func)) (void**) &get_type_func))
return G_TYPE_NONE; return G_TYPE_NONE;
return (* get_type_func) (); return (* get_type_func) ();

View File

@ -40,22 +40,22 @@ G_BEGIN_DECLS
* Checks if @info is a #GIRegisteredTypeInfo or derived from it. * Checks if @info is a #GIRegisteredTypeInfo or derived from it.
*/ */
#define GI_IS_REGISTERED_TYPE_INFO(info) \ #define GI_IS_REGISTERED_TYPE_INFO(info) \
((g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_BOXED) || \ ((gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_BOXED) || \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_ENUM) || \ (gi_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_FLAGS) || \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_INTERFACE) || \ (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_INTERFACE) || \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_OBJECT) || \ (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_OBJECT) || \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_STRUCT) || \ (gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_STRUCT) || \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_UNION) || \ (gi_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_AVAILABLE_IN_ALL 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 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 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 G_END_DECLS

View File

@ -78,38 +78,38 @@ struct _GIUnresolvedInfo
const gchar *namespace; const gchar *namespace;
}; };
void _g_info_init (GIRealInfo *info, void gi_info_init (GIRealInfo *info,
GIInfoType type, GIInfoType type,
GIRepository *repository, GIRepository *repository,
GIBaseInfo *container, GIBaseInfo *container,
GITypelib *typelib, GITypelib *typelib,
guint32 offset); guint32 offset);
GIBaseInfo * _g_info_from_entry (GIRepository *repository, GIBaseInfo * gi_info_from_entry (GIRepository *repository,
GITypelib *typelib, GITypelib *typelib,
guint16 index); guint16 index);
GIBaseInfo * _g_info_new_full (GIInfoType type, GIBaseInfo * gi_info_new_full (GIInfoType type,
GIRepository *repository, GIRepository *repository,
GIBaseInfo *container, GIBaseInfo *container,
GITypelib *typelib, GITypelib *typelib,
guint32 offset); guint32 offset);
GITypeInfo * _g_type_info_new (GIBaseInfo *container, GITypeInfo * gi_type_info_new (GIBaseInfo *container,
GITypelib *typelib, GITypelib *typelib,
guint32 offset); guint32 offset);
void _g_type_info_init (GIBaseInfo *info, void gi_type_info_init (GIBaseInfo *info,
GIBaseInfo *container, GIBaseInfo *container,
GITypelib *typelib, GITypelib *typelib,
guint32 offset); guint32 offset);
GIFunctionInfo * _g_base_info_find_method (GIBaseInfo *base, GIFunctionInfo * gi_base_info_find_method (GIBaseInfo *base,
guint32 offset, guint32 offset,
gint n_methods, gint n_methods,
const gchar *name); const gchar *name);
GIVFuncInfo * _g_base_info_find_vfunc (GIRealInfo *rinfo, GIVFuncInfo * gi_base_info_find_vfunc (GIRealInfo *rinfo,
guint32 offset, guint32 offset,
gint n_vfuncs, gint n_vfuncs,
const gchar *name); const gchar *name);

View File

@ -50,10 +50,10 @@
* under the library directory used when compiling gobject-introspection. * under the library directory used when compiling gobject-introspection.
* *
* It is possible to control the search paths programmatically, using * 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 search paths by using the `GI_TYPELIB_PATH` environment variable.
* The environment variable takes precedence over the default search path * 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; guint i;
for (i = 0; i < cache->n_interfaces; 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); g_free (cache);
} }
@ -86,7 +86,7 @@ struct _GIRepositoryPrivate
GHashTable *unknown_gtypes; /* hashset of GType */ 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 #ifdef G_PLATFORM_WIN32
@ -124,13 +124,13 @@ DllMain (HINSTANCE hinstDLL,
#endif #endif
static void 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 repository->priv->typelibs
= g_hash_table_new_full (g_str_hash, g_str_equal, = g_hash_table_new_full (g_str_hash, g_str_equal,
(GDestroyNotify) NULL, (GDestroyNotify) NULL,
(GDestroyNotify) g_typelib_free); (GDestroyNotify) gi_typelib_free);
repository->priv->lazy_typelibs repository->priv->lazy_typelibs
= g_hash_table_new_full (g_str_hash, g_str_equal, = g_hash_table_new_full (g_str_hash, g_str_equal,
(GDestroyNotify) g_free, (GDestroyNotify) g_free,
@ -138,11 +138,11 @@ g_irepository_init (GIRepository *repository)
repository->priv->info_by_gtype repository->priv->info_by_gtype
= g_hash_table_new_full (g_direct_hash, g_direct_equal, = g_hash_table_new_full (g_direct_hash, g_direct_equal,
(GDestroyNotify) NULL, (GDestroyNotify) NULL,
(GDestroyNotify) g_base_info_unref); (GDestroyNotify) gi_base_info_unref);
repository->priv->info_by_error_domain repository->priv->info_by_error_domain
= g_hash_table_new_full (g_direct_hash, g_direct_equal, = g_hash_table_new_full (g_direct_hash, g_direct_equal,
(GDestroyNotify) NULL, (GDestroyNotify) NULL,
(GDestroyNotify) g_base_info_unref); (GDestroyNotify) gi_base_info_unref);
repository->priv->interfaces_for_gtype repository->priv->interfaces_for_gtype
= g_hash_table_new_full (g_direct_hash, g_direct_equal, = g_hash_table_new_full (g_direct_hash, g_direct_equal,
(GDestroyNotify) NULL, (GDestroyNotify) NULL,
@ -151,9 +151,9 @@ g_irepository_init (GIRepository *repository)
} }
static void 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->typelibs);
g_hash_table_destroy (repository->priv->lazy_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->interfaces_for_gtype);
g_hash_table_destroy (repository->priv->unknown_gtypes); 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 static void
g_irepository_class_init (GIRepositoryClass *class) gi_repository_class_init (GIRepositoryClass *class)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
gobject_class = G_OBJECT_CLASS (class); gobject_class = G_OBJECT_CLASS (class);
gobject_class->finalize = g_irepository_finalize; gobject_class->finalize = gi_repository_finalize;
} }
static void static void
@ -184,7 +184,7 @@ init_globals (void)
return; return;
if (default_repository == NULL) 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) if (typelib_search_path == NULL)
{ {
@ -194,7 +194,7 @@ init_globals (void)
/* This variable is intended to take precedence over both: /* This variable is intended to take precedence over both:
* - the default search path; * - 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"); 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 * @directory: (type filename): directory name to prepend to the typelib
* search path * search path
* *
* Prepends @directory 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 void
g_irepository_prepend_search_path (const char *directory) gi_repository_prepend_search_path (const char *directory)
{ {
init_globals (); init_globals ();
typelib_search_path = g_slist_prepend (typelib_search_path, g_strdup (directory)); 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 * Returns the current search path #GIRepository will use when loading
* typelib files. The list is internal to #GIRepository and should not * 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 * Returns: (element-type filename) (transfer none): #GSList of strings
*/ */
GSList * GSList *
g_irepository_get_search_path (void) gi_repository_get_search_path (void)
{ {
return typelib_search_path; return typelib_search_path;
} }
@ -282,7 +282,7 @@ get_typelib_dependencies (GITypelib *typelib)
if (header->dependencies == 0) if (header->dependencies == 0)
return NULL; 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); return g_strsplit (dependencies_glob, "|", 0);
} }
@ -314,7 +314,7 @@ check_version_conflict (GITypelib *typelib,
} }
header = (Header*)typelib->data; 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); g_assert (loaded_version != NULL);
if (strcmp (expected_version, loaded_version) != 0) 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_namespace = g_strndup (dependency, last_dash - dependency);
dependency_version = last_dash+1; 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)) 0, error))
{ {
g_free (dependency_namespace); g_free (dependency_namespace);
@ -415,7 +415,7 @@ register_internal (GIRepository *repository,
g_return_val_if_fail (header != NULL, FALSE); 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) 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 * @repository: (nullable): A #GIRepository or %NULL for the singleton
* process-global default #GIRepository * process-global default #GIRepository
* @namespace_: Namespace of interest * @namespace_: Namespace of interest
@ -460,10 +460,10 @@ register_internal (GIRepository *repository,
* Returned strings are of the form `namespace-version`. * Returned strings are of the form `namespace-version`.
* *
* Note: @namespace_ must have already been loaded using a function * 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 * 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 * Returns: (transfer full): Zero-terminated string array of immediate versioned
* dependencies * dependencies
@ -471,7 +471,7 @@ register_internal (GIRepository *repository,
* Since: 1.44 * Since: 1.44
*/ */
char ** char **
g_irepository_get_immediate_dependencies (GIRepository *repository, gi_repository_get_immediate_dependencies (GIRepository *repository,
const char *namespace) const char *namespace)
{ {
GITypelib *typelib; 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 * @repository: (allow-none): A #GIRepository or %NULL for the singleton
* process-global default #GIRepository * process-global default #GIRepository
* @namespace_: Namespace of interest * @namespace_: Namespace of interest
@ -545,16 +545,16 @@ get_typelib_dependencies_transitive (GIRepository *repository,
* The strings are of the form `namespace-version`. * The strings are of the form `namespace-version`.
* *
* Note: @namespace_ must have already been loaded using a function * 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 * 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 * Returns: (transfer full) (array zero-terminated=1): all versioned
* dependencies * dependencies
*/ */
char ** char **
g_irepository_get_dependencies (GIRepository *repository, gi_repository_get_dependencies (GIRepository *repository,
const char *namespace) const char *namespace)
{ {
GITypelib *typelib; 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 * @repository: (allow-none): A #GIRepository or %NULL for the singleton
* process-global default #GIRepository * process-global default #GIRepository
* @typelib: TODO * @typelib: TODO
@ -606,7 +606,7 @@ g_irepository_get_dependencies (GIRepository *repository,
* TODO * TODO
*/ */
const char * const char *
g_irepository_load_typelib (GIRepository *repository, gi_repository_load_typelib (GIRepository *repository,
GITypelib *typelib, GITypelib *typelib,
GIRepositoryLoadFlags flags, GIRepositoryLoadFlags flags,
GError **error) GError **error)
@ -614,23 +614,23 @@ g_irepository_load_typelib (GIRepository *repository,
Header *header; Header *header;
const char *namespace; const char *namespace;
const char *nsversion; const char *nsversion;
gboolean allow_lazy = flags & G_IREPOSITORY_LOAD_FLAG_LAZY; gboolean allow_lazy = flags & GI_REPOSITORY_LOAD_FLAG_LAZY;
gboolean is_lazy; gboolean is_lazy;
char *version_conflict; char *version_conflict;
repository = get_repository (repository); repository = get_repository (repository);
header = (Header *) typelib->data; header = (Header *) typelib->data;
namespace = g_typelib_get_string (typelib, header->namespace); namespace = gi_typelib_get_string (typelib, header->namespace);
nsversion = g_typelib_get_string (typelib, header->nsversion); nsversion = gi_typelib_get_string (typelib, header->nsversion);
if (get_registered_status (repository, namespace, nsversion, allow_lazy, if (get_registered_status (repository, namespace, nsversion, allow_lazy,
&is_lazy, &version_conflict)) &is_lazy, &version_conflict))
{ {
if (version_conflict != NULL) if (version_conflict != NULL)
{ {
g_set_error (error, G_IREPOSITORY_ERROR, g_set_error (error, GI_REPOSITORY_ERROR,
G_IREPOSITORY_ERROR_NAMESPACE_VERSION_CONFLICT, GI_REPOSITORY_ERROR_NAMESPACE_VERSION_CONFLICT,
"Attempting to load namespace '%s', version '%s', but '%s' is already loaded", "Attempting to load namespace '%s', version '%s', but '%s' is already loaded",
namespace, nsversion, version_conflict); namespace, nsversion, version_conflict);
return NULL; 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 * @repository: (allow-none): A #GIRepository or %NULL for the singleton
* process-global default #GIRepository * process-global default #GIRepository
* @namespace_: Namespace of interest * @namespace_: Namespace of interest
@ -651,14 +651,14 @@ g_irepository_load_typelib (GIRepository *repository,
* Check whether a particular namespace (and optionally, a specific * Check whether a particular namespace (and optionally, a specific
* version thereof) is currently loaded. This function is likely to * version thereof) is currently loaded. This function is likely to
* only be useful in unusual circumstances; in order to act upon * 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 * instead which will ensure the namespace is loaded, and return as
* quickly as this function will if it has already been loaded. * quickly as this function will if it has already been loaded.
* *
* Returns: %TRUE if namespace-version is loaded, %FALSE otherwise * Returns: %TRUE if namespace-version is loaded, %FALSE otherwise
*/ */
gboolean gboolean
g_irepository_is_registered (GIRepository *repository, gi_repository_is_registered (GIRepository *repository,
const gchar *namespace, const gchar *namespace,
const gchar *version) 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 * Returns the singleton process-global default #GIRepository. It is
* not currently supported to have multiple repositories in a * 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 * Returns: (transfer none): The global singleton #GIRepository
*/ */
GIRepository * GIRepository *
g_irepository_get_default (void) gi_repository_get_default (void)
{ {
return get_repository (NULL); return get_repository (NULL);
} }
/** /**
* g_irepository_get_n_infos: * gi_repository_get_n_infos:
* @repository: (allow-none): A #GIRepository or %NULL for the singleton * @repository: (allow-none): A #GIRepository or %NULL for the singleton
* process-global default #GIRepository * process-global default #GIRepository
* @namespace_: Namespace to inspect * @namespace_: Namespace to inspect
@ -701,7 +701,7 @@ g_irepository_get_default (void)
* Returns: number of metadata entries * Returns: number of metadata entries
*/ */
gint gint
g_irepository_get_n_infos (GIRepository *repository, gi_repository_get_n_infos (GIRepository *repository,
const gchar *namespace) const gchar *namespace)
{ {
GITypelib *typelib; 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 * @repository: (allow-none): A #GIRepository or %NULL for the singleton
* process-global default #GIRepository * process-global default #GIRepository
* @namespace_: Namespace to inspect * @namespace_: Namespace to inspect
@ -730,13 +730,13 @@ g_irepository_get_n_infos (GIRepository *repository,
* This function returns a particular metadata entry in the * This function returns a particular metadata entry in the
* given namespace @namespace_. The namespace must have * given namespace @namespace_. The namespace must have
* already been loaded before calling this function. * 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. * entries.
* *
* Returns: (transfer full): #GIBaseInfo containing metadata * Returns: (transfer full): #GIBaseInfo containing metadata
*/ */
GIBaseInfo * GIBaseInfo *
g_irepository_get_info (GIRepository *repository, gi_repository_get_info (GIRepository *repository,
const gchar *namespace, const gchar *namespace,
gint index) gint index)
{ {
@ -751,12 +751,12 @@ g_irepository_get_info (GIRepository *repository,
g_return_val_if_fail (typelib != NULL, NULL); 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) if (entry == NULL)
return NULL; return NULL;
return _g_info_new_full (entry->blob_type, return gi_info_new_full (entry->blob_type,
repository, repository,
NULL, typelib, entry->offset); NULL, typelib, entry->offset);
} }
typedef struct { typedef struct {
@ -777,11 +777,11 @@ find_by_gtype (GHashTable *table, FindByGTypeData *data, gboolean check_prefix)
GITypelib *typelib = (GITypelib*)value; GITypelib *typelib = (GITypelib*)value;
if (check_prefix) 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; 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) if (ret)
{ {
data->result_typelib = typelib; 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 * @repository: (allow-none): A #GIRepository or %NULL for the singleton
* process-global default #GIRepository * process-global default #GIRepository
* @gtype: GType to search for * @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 * Returns: (transfer full): #GIBaseInfo representing metadata about @type, or %NULL
*/ */
GIBaseInfo * GIBaseInfo *
g_irepository_find_by_gtype (GIRepository *repository, gi_repository_find_by_gtype (GIRepository *repository,
GType gtype) GType gtype)
{ {
FindByGTypeData data; FindByGTypeData data;
@ -823,7 +823,7 @@ g_irepository_find_by_gtype (GIRepository *repository,
(gpointer)gtype); (gpointer)gtype);
if (cached != NULL) 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)) if (g_hash_table_contains (repository->priv->unknown_gtypes, (gpointer)gtype))
return NULL; return NULL;
@ -854,13 +854,13 @@ g_irepository_find_by_gtype (GIRepository *repository,
if (entry != NULL) if (entry != NULL)
{ {
cached = _g_info_new_full (entry->blob_type, cached = gi_info_new_full (entry->blob_type,
repository, repository,
NULL, data.result_typelib, entry->offset); NULL, data.result_typelib, entry->offset);
g_hash_table_insert (repository->priv->info_by_gtype, g_hash_table_insert (repository->priv->info_by_gtype,
(gpointer) gtype, (gpointer) gtype,
g_base_info_ref (cached)); gi_base_info_ref (cached));
return cached; return cached;
} }
else 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 * @repository: (allow-none): A #GIRepository or %NULL for the singleton
* process-global default #GIRepository * process-global default #GIRepository
* @namespace_: Namespace which will be searched * @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 * Searches for a particular entry in a namespace. Before calling
* this function for a particular namespace, you must call * 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. * ensure the namespace has already been loaded.
* *
* Returns: (transfer full): #GIBaseInfo representing metadata about @name, or %NULL * Returns: (transfer full): #GIBaseInfo representing metadata about @name, or %NULL
*/ */
GIBaseInfo * GIBaseInfo *
g_irepository_find_by_name (GIRepository *repository, gi_repository_find_by_name (GIRepository *repository,
const gchar *namespace, const gchar *namespace,
const gchar *name) const gchar *name)
{ {
@ -898,12 +898,12 @@ g_irepository_find_by_name (GIRepository *repository,
typelib = get_registered (repository, namespace, NULL); typelib = get_registered (repository, namespace, NULL);
g_return_val_if_fail (typelib != NULL, 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) if (entry == NULL)
return NULL; return NULL;
return _g_info_new_full (entry->blob_type, return gi_info_new_full (entry->blob_type,
repository, repository,
NULL, typelib, entry->offset); NULL, typelib, entry->offset);
} }
typedef struct { typedef struct {
@ -925,20 +925,20 @@ find_by_error_domain_foreach (gpointer key,
if (data->result != NULL) if (data->result != NULL)
return; 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) if (data->result)
data->result_typelib = typelib; 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 * @repository: (allow-none): A #GIRepository or %NULL for the singleton
* process-global default #GIRepository * process-global default #GIRepository
* @domain: a #GError domain * @domain: a #GError domain
* *
* Searches for the enum type corresponding to the given #GError * Searches for the enum type corresponding to the given #GError
* domain. Before calling this function for a particular namespace, * 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. * otherwise ensure the namespace has already been loaded.
* *
* Returns: (transfer full): #GIEnumInfo representing metadata about @domain's * Returns: (transfer full): #GIEnumInfo representing metadata about @domain's
@ -946,7 +946,7 @@ find_by_error_domain_foreach (gpointer key,
* Since: 1.30 * Since: 1.30
*/ */
GIEnumInfo * GIEnumInfo *
g_irepository_find_by_error_domain (GIRepository *repository, gi_repository_find_by_error_domain (GIRepository *repository,
GQuark domain) GQuark domain)
{ {
FindByErrorDomainData data; FindByErrorDomainData data;
@ -958,7 +958,7 @@ g_irepository_find_by_error_domain (GIRepository *repository,
GUINT_TO_POINTER (domain)); GUINT_TO_POINTER (domain));
if (cached != NULL) if (cached != NULL)
return g_base_info_ref ((GIBaseInfo *)cached); return gi_base_info_ref ((GIBaseInfo *)cached);
data.repository = repository; data.repository = repository;
data.domain = domain; data.domain = domain;
@ -971,20 +971,20 @@ g_irepository_find_by_error_domain (GIRepository *repository,
if (data.result != NULL) if (data.result != NULL)
{ {
cached = _g_info_new_full (data.result->blob_type, cached = gi_info_new_full (data.result->blob_type,
repository, repository,
NULL, data.result_typelib, data.result->offset); NULL, data.result_typelib, data.result->offset);
g_hash_table_insert (repository->priv->info_by_error_domain, g_hash_table_insert (repository->priv->info_by_error_domain,
GUINT_TO_POINTER (domain), GUINT_TO_POINTER (domain),
g_base_info_ref (cached)); gi_base_info_ref (cached));
return cached; return cached;
} }
return NULL; return NULL;
} }
/** /**
* g_irepository_get_object_gtype_interfaces: * gi_repository_get_object_gtype_interfaces:
* @repository: (nullable): a #GIRepository, or %NULL for the default repository * @repository: (nullable): a #GIRepository, or %NULL for the default repository
* @gtype: a #GType whose fundamental type is G_TYPE_OBJECT * @gtype: a #GType whose fundamental type is G_TYPE_OBJECT
* @n_interfaces_out: (out): Number of interfaces * @n_interfaces_out: (out): Number of interfaces
@ -1005,7 +1005,7 @@ g_irepository_find_by_error_domain (GIRepository *repository,
* Since: 1.62 * Since: 1.62
*/ */
void void
g_irepository_get_object_gtype_interfaces (GIRepository *repository, gi_repository_get_object_gtype_interfaces (GIRepository *repository,
GType gtype, GType gtype,
guint *n_interfaces_out, guint *n_interfaces_out,
GIInterfaceInfo ***interfaces_out) GIInterfaceInfo ***interfaces_out)
@ -1030,14 +1030,14 @@ g_irepository_get_object_gtype_interfaces (GIRepository *repository,
{ {
GIBaseInfo *base_info; 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) if (base_info == NULL)
continue; 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? */ /* FIXME - could this really happen? */
g_base_info_unref (base_info); gi_base_info_unref (base_info);
continue; 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 * @repository: (allow-none): A #GIRepository or %NULL for the singleton
* process-global default #GIRepository * process-global default #GIRepository
* *
@ -1082,7 +1082,7 @@ collect_namespaces (gpointer key,
* Returns: (element-type utf8) (transfer full): List of namespaces * Returns: (element-type utf8) (transfer full): List of namespaces
*/ */
gchar ** gchar **
g_irepository_get_loaded_namespaces (GIRepository *repository) gi_repository_get_loaded_namespaces (GIRepository *repository)
{ {
GList *l, *list = NULL; GList *l, *list = NULL;
gchar **names; 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 * @repository: (allow-none): A #GIRepository or %NULL for the singleton
* process-global default #GIRepository * process-global default #GIRepository
* @namespace_: Namespace to inspect * @namespace_: Namespace to inspect
@ -1112,12 +1112,12 @@ g_irepository_get_loaded_namespaces (GIRepository *repository)
* namespace @namespace_. * namespace @namespace_.
* *
* Note: The namespace must have already been loaded using a function * 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 * Returns: Loaded version
*/ */
const gchar * const gchar *
g_irepository_get_version (GIRepository *repository, gi_repository_get_version (GIRepository *repository,
const gchar *namespace) const gchar *namespace)
{ {
GITypelib *typelib; GITypelib *typelib;
@ -1132,11 +1132,11 @@ g_irepository_get_version (GIRepository *repository,
g_return_val_if_fail (typelib != NULL, NULL); g_return_val_if_fail (typelib != NULL, NULL);
header = (Header *) typelib->data; 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 * @repository: (allow-none): A #GIRepository or %NULL for the singleton
* process-global default #GIRepository * process-global default #GIRepository
* @namespace_: Namespace to inspect * @namespace_: Namespace to inspect
@ -1147,13 +1147,13 @@ g_irepository_get_version (GIRepository *repository,
* function will return %NULL. * function will return %NULL.
* *
* Note: The namespace must have already been loaded using a function * 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, * Returns: (nullable): Comma-separated list of paths to shared libraries,
* or %NULL if none are associated * or %NULL if none are associated
*/ */
const gchar * const gchar *
g_irepository_get_shared_library (GIRepository *repository, gi_repository_get_shared_library (GIRepository *repository,
const gchar *namespace) const gchar *namespace)
{ {
GITypelib *typelib; GITypelib *typelib;
@ -1169,13 +1169,13 @@ g_irepository_get_shared_library (GIRepository *repository,
header = (Header *) typelib->data; header = (Header *) typelib->data;
if (header->shared_library) if (header->shared_library)
return g_typelib_get_string (typelib, header->shared_library); return gi_typelib_get_string (typelib, header->shared_library);
else else
return NULL; return NULL;
} }
/** /**
* g_irepository_get_c_prefix: * gi_repository_get_c_prefix:
* @repository: (allow-none): A #GIRepository or %NULL for the singleton * @repository: (allow-none): A #GIRepository or %NULL for the singleton
* process-global default #GIRepository * process-global default #GIRepository
* @namespace_: Namespace to inspect * @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. * starts with this prefix, as well each #GType in the library.
* *
* Note: The namespace must have already been loaded using a function * 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 * Returns: C namespace prefix, or %NULL if none associated
*/ */
const gchar * const gchar *
g_irepository_get_c_prefix (GIRepository *repository, gi_repository_get_c_prefix (GIRepository *repository,
const gchar *namespace_) const gchar *namespace_)
{ {
GITypelib *typelib; GITypelib *typelib;
@ -1206,13 +1206,13 @@ g_irepository_get_c_prefix (GIRepository *repository,
header = (Header *) typelib->data; header = (Header *) typelib->data;
if (header->c_prefix) if (header->c_prefix)
return g_typelib_get_string (typelib, header->c_prefix); return gi_typelib_get_string (typelib, header->c_prefix);
else else
return NULL; return NULL;
} }
/** /**
* g_irepository_get_typelib_path: * gi_repository_get_typelib_path:
* @repository: (allow-none): A #GIRepository or %NULL for the singleton * @repository: (allow-none): A #GIRepository or %NULL for the singleton
* process-global default #GIRepository * process-global default #GIRepository
* @namespace_: GI namespace to use, e.g. "Gtk" * @namespace_: GI namespace to use, e.g. "Gtk"
@ -1226,7 +1226,7 @@ g_irepository_get_c_prefix (GIRepository *repository,
*/ */
const gchar * const gchar *
g_irepository_get_typelib_path (GIRepository *repository, gi_repository_get_typelib_path (GIRepository *repository,
const gchar *namespace) const gchar *namespace)
{ {
gpointer orig_key, value; 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 * @repository: (allow-none): A #GIRepository or %NULL for the singleton
* process-global default #GIRepository * process-global default #GIRepository
* @namespace_: GI namespace, e.g. "Gtk" * @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. * Returns: (element-type utf8) (transfer full): the array of versions.
*/ */
GList * GList *
g_irepository_enumerate_versions (GIRepository *repository, gi_repository_enumerate_versions (GIRepository *repository,
const gchar *namespace_) const gchar *namespace_)
{ {
GList *ret = NULL; GList *ret = NULL;
@ -1521,9 +1521,9 @@ g_irepository_enumerate_versions (GIRepository *repository,
* available versions, as it could have been loaded using * available versions, as it could have been loaded using
* require_private(). * 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)) if (loaded_version && !g_list_find_custom (ret, loaded_version, g_str_equal))
ret = g_list_prepend (ret, g_strdup (loaded_version)); ret = g_list_prepend (ret, g_strdup (loaded_version));
} }
@ -1544,7 +1544,7 @@ require_internal (GIRepository *repository,
Header *header; Header *header;
GITypelib *typelib = NULL; GITypelib *typelib = NULL;
const gchar *typelib_namespace, *typelib_version; 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; gboolean is_lazy;
char *version_conflict = NULL; char *version_conflict = NULL;
char *path = NULL; char *path = NULL;
@ -1561,8 +1561,8 @@ require_internal (GIRepository *repository,
if (version_conflict != NULL) if (version_conflict != NULL)
{ {
g_set_error (error, G_IREPOSITORY_ERROR, g_set_error (error, GI_REPOSITORY_ERROR,
G_IREPOSITORY_ERROR_NAMESPACE_VERSION_CONFLICT, GI_REPOSITORY_ERROR_NAMESPACE_VERSION_CONFLICT,
"Requiring namespace '%s' version '%s', but '%s' is already loaded", "Requiring namespace '%s' version '%s', but '%s' is already loaded",
namespace, version, version_conflict); namespace, version, version_conflict);
return NULL; return NULL;
@ -1583,13 +1583,13 @@ require_internal (GIRepository *repository,
if (mfile == NULL) if (mfile == NULL)
{ {
if (version != NULL) if (version != NULL)
g_set_error (error, G_IREPOSITORY_ERROR, g_set_error (error, GI_REPOSITORY_ERROR,
G_IREPOSITORY_ERROR_TYPELIB_NOT_FOUND, GI_REPOSITORY_ERROR_TYPELIB_NOT_FOUND,
"Typelib file for namespace '%s', version '%s' not found", "Typelib file for namespace '%s', version '%s' not found",
namespace, version); namespace, version);
else else
g_set_error (error, G_IREPOSITORY_ERROR, g_set_error (error, GI_REPOSITORY_ERROR,
G_IREPOSITORY_ERROR_TYPELIB_NOT_FOUND, GI_REPOSITORY_ERROR_TYPELIB_NOT_FOUND,
"Typelib file for namespace '%s' (any version) not found", "Typelib file for namespace '%s' (any version) not found",
namespace); namespace);
goto out; goto out;
@ -1597,11 +1597,11 @@ require_internal (GIRepository *repository,
{ {
GError *temp_error = NULL; 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) if (!typelib)
{ {
g_set_error (error, G_IREPOSITORY_ERROR, g_set_error (error, GI_REPOSITORY_ERROR,
G_IREPOSITORY_ERROR_TYPELIB_NOT_FOUND, GI_REPOSITORY_ERROR_TYPELIB_NOT_FOUND,
"Failed to load typelib file '%s' for namespace '%s': %s", "Failed to load typelib file '%s' for namespace '%s': %s",
path, namespace, temp_error->message); path, namespace, temp_error->message);
g_clear_error (&temp_error); g_clear_error (&temp_error);
@ -1609,34 +1609,34 @@ require_internal (GIRepository *repository,
} }
} }
header = (Header *) typelib->data; header = (Header *) typelib->data;
typelib_namespace = g_typelib_get_string (typelib, header->namespace); typelib_namespace = gi_typelib_get_string (typelib, header->namespace);
typelib_version = g_typelib_get_string (typelib, header->nsversion); typelib_version = gi_typelib_get_string (typelib, header->nsversion);
if (strcmp (typelib_namespace, namespace) != 0) if (strcmp (typelib_namespace, namespace) != 0)
{ {
g_set_error (error, G_IREPOSITORY_ERROR, g_set_error (error, GI_REPOSITORY_ERROR,
G_IREPOSITORY_ERROR_NAMESPACE_MISMATCH, GI_REPOSITORY_ERROR_NAMESPACE_MISMATCH,
"Typelib file %s for namespace '%s' contains " "Typelib file %s for namespace '%s' contains "
"namespace '%s' which doesn't match the file name", "namespace '%s' which doesn't match the file name",
path, namespace, typelib_namespace); path, namespace, typelib_namespace);
g_typelib_free (typelib); gi_typelib_free (typelib);
goto out; goto out;
} }
if (version != NULL && strcmp (typelib_version, version) != 0) if (version != NULL && strcmp (typelib_version, version) != 0)
{ {
g_set_error (error, G_IREPOSITORY_ERROR, g_set_error (error, GI_REPOSITORY_ERROR,
G_IREPOSITORY_ERROR_NAMESPACE_MISMATCH, GI_REPOSITORY_ERROR_NAMESPACE_MISMATCH,
"Typelib file %s for namespace '%s' contains " "Typelib file %s for namespace '%s' contains "
"version '%s' which doesn't match the expected version '%s'", "version '%s' which doesn't match the expected version '%s'",
path, namespace, typelib_version, version); path, namespace, typelib_version, version);
g_typelib_free (typelib); gi_typelib_free (typelib);
goto out; goto out;
} }
if (!register_internal (repository, path, allow_lazy, if (!register_internal (repository, path, allow_lazy,
typelib, error)) typelib, error))
{ {
g_typelib_free (typelib); gi_typelib_free (typelib);
goto out; goto out;
} }
ret = typelib; 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 * @repository: (allow-none): A #GIRepository or %NULL for the singleton
* process-global default #GIRepository * process-global default #GIRepository
* @namespace_: GI namespace to use, e.g. "Gtk" * @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 * Returns: (transfer none): a pointer to the #GITypelib if successful, %NULL otherwise
*/ */
GITypelib * GITypelib *
g_irepository_require (GIRepository *repository, gi_repository_require (GIRepository *repository,
const gchar *namespace, const gchar *namespace,
const gchar *version, const gchar *version,
GIRepositoryLoadFlags flags, 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 * @repository: (allow-none): A #GIRepository or %NULL for the singleton
* process-global default #GIRepository * process-global default #GIRepository
* @typelib_dir: Private directory where to find the requested typelib * @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 * Returns: (transfer none): a pointer to the #GITypelib if successful, %NULL otherwise
*/ */
GITypelib * GITypelib *
g_irepository_require_private (GIRepository *repository, gi_repository_require_private (GIRepository *repository,
const gchar *typelib_dir, const gchar *typelib_dir,
const gchar *namespace, const gchar *namespace,
const gchar *version, const gchar *version,
@ -1712,13 +1712,13 @@ g_irepository_require_private (GIRepository *repository,
} }
static gboolean static gboolean
g_irepository_introspect_cb (const char *option_name, gi_repository_introspect_cb (const char *option_name,
const char *value, const char *value,
gpointer data, gpointer data,
GError **error) GError **error)
{ {
GError *tmp_error = NULL; GError *tmp_error = NULL;
gboolean ret = g_irepository_dump (value, &tmp_error); gboolean ret = gi_repository_dump (value, &tmp_error);
if (!ret) if (!ret)
{ {
g_error ("Failed to extract GType data: %s", 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[] = { static const GOptionEntry introspection_args[] = {
{ "introspect-dump", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_CALLBACK, { "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" }, "infile.txt,outfile.xml" },
G_OPTION_ENTRY_NULL G_OPTION_ENTRY_NULL
}; };
/** /**
* g_irepository_get_option_group: * gi_repository_get_option_group:
* *
* Obtain the option group for girepository, it's used * Obtain the option group for girepository, it's used
* by the dumper and for programs that wants to provide * 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 * Returns: (transfer full): the option group
*/ */
GOptionGroup * GOptionGroup *
g_irepository_get_option_group (void) gi_repository_get_option_group (void)
{ {
GOptionGroup *group; GOptionGroup *group;
group = g_option_group_new ("girepository", "Introspection Options", "Show Introspection Options", NULL, NULL); group = g_option_group_new ("girepository", "Introspection Options", "Show Introspection Options", NULL, NULL);
@ -1755,7 +1755,7 @@ g_irepository_get_option_group (void)
} }
GQuark GQuark
g_irepository_error_quark (void) gi_repository_error_quark (void)
{ {
static GQuark quark = 0; static GQuark quark = 0;
if (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 * @type: the type_tag
* *
* Obtain a string representation of @type * Obtain a string representation of @type
@ -1772,7 +1772,7 @@ g_irepository_error_quark (void)
* Returns: the string * Returns: the string
*/ */
const gchar* const gchar*
g_type_tag_to_string (GITypeTag type) gi_type_tag_to_string (GITypeTag type)
{ {
switch (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 * @type: the info type
* *
* Obtain a string representation of @type * Obtain a string representation of @type
@ -1834,7 +1834,7 @@ g_type_tag_to_string (GITypeTag type)
* Returns: the string * Returns: the string
*/ */
const gchar* const gchar*
g_info_type_to_string (GIInfoType type) gi_info_type_to_string (GIInfoType type)
{ {
switch (type) switch (type)
{ {

View File

@ -52,12 +52,12 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define G_TYPE_IREPOSITORY (g_irepository_get_type ()) #define GI_TYPE_REPOSITORY (gi_repository_get_type ())
#define G_IREPOSITORY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), G_TYPE_IREPOSITORY, GIRepository)) #define GI_REPOSITORY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GI_TYPE_REPOSITORY, GIRepository))
#define G_IREPOSITORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G_TYPE_IREPOSITORY, GIRepositoryClass)) #define GI_REPOSITORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GI_TYPE_REPOSITORY, GIRepositoryClass))
#define G_IS_IREPOSITORY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), G_TYPE_IREPOSITORY)) #define GI_IS_REPOSITORY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GI_TYPE_REPOSITORY))
#define G_IS_IREPOSITORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G_TYPE_IREPOSITORY)) #define GI_IS_REPOSITORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GI_TYPE_REPOSITORY))
#define G_IREPOSITORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G_TYPE_IREPOSITORY, GIRepositoryClass)) #define GI_REPOSITORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GI_TYPE_REPOSITORY, GIRepositoryClass))
/** /**
* GIRepository: * GIRepository:
@ -84,154 +84,154 @@ struct _GIRepositoryClass
/** /**
* GIRepositoryLoadFlags: * 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. * Flags that control how a typelib is loaded.
*/ */
typedef enum typedef enum
{ {
G_IREPOSITORY_LOAD_FLAG_LAZY = 1 << 0 GI_REPOSITORY_LOAD_FLAG_LAZY = 1 << 0
} GIRepositoryLoadFlags; } GIRepositoryLoadFlags;
/* Repository */ /* Repository */
GI_AVAILABLE_IN_ALL 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 GI_AVAILABLE_IN_ALL
GIRepository *g_irepository_get_default (void); GIRepository *gi_repository_get_default (void);
GI_AVAILABLE_IN_ALL 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 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 GI_AVAILABLE_IN_ALL
GSList * g_irepository_get_search_path (void); GSList * gi_repository_get_search_path (void);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
const char * g_irepository_load_typelib (GIRepository *repository, const char * gi_repository_load_typelib (GIRepository *repository,
GITypelib *typelib, GITypelib *typelib,
GIRepositoryLoadFlags flags, GIRepositoryLoadFlags flags,
GError **error); GError **error);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gboolean g_irepository_is_registered (GIRepository *repository, gboolean gi_repository_is_registered (GIRepository *repository,
const gchar *namespace_, const gchar *namespace_,
const gchar *version); const gchar *version);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIBaseInfo * g_irepository_find_by_name (GIRepository *repository, GIBaseInfo * gi_repository_find_by_name (GIRepository *repository,
const gchar *namespace_, const gchar *namespace_,
const gchar *name); const gchar *name);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GList * g_irepository_enumerate_versions (GIRepository *repository, GList * gi_repository_enumerate_versions (GIRepository *repository,
const gchar *namespace_); const gchar *namespace_);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GITypelib * g_irepository_require (GIRepository *repository, GITypelib * gi_repository_require (GIRepository *repository,
const gchar *namespace_, const gchar *namespace_,
const gchar *version, const gchar *version,
GIRepositoryLoadFlags flags, GIRepositoryLoadFlags flags,
GError **error); GError **error);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GITypelib * g_irepository_require_private (GIRepository *repository, GITypelib * gi_repository_require_private (GIRepository *repository,
const gchar *typelib_dir, const gchar *typelib_dir,
const gchar *namespace_, const gchar *namespace_,
const gchar *version, const gchar *version,
GIRepositoryLoadFlags flags, GIRepositoryLoadFlags flags,
GError **error); GError **error);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gchar ** g_irepository_get_immediate_dependencies (GIRepository *repository, gchar ** gi_repository_get_immediate_dependencies (GIRepository *repository,
const gchar *namespace_); const gchar *namespace_);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gchar ** g_irepository_get_dependencies (GIRepository *repository, gchar ** gi_repository_get_dependencies (GIRepository *repository,
const gchar *namespace_); const gchar *namespace_);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gchar ** g_irepository_get_loaded_namespaces (GIRepository *repository); gchar ** gi_repository_get_loaded_namespaces (GIRepository *repository);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIBaseInfo * g_irepository_find_by_gtype (GIRepository *repository, GIBaseInfo * gi_repository_find_by_gtype (GIRepository *repository,
GType gtype); GType gtype);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
void g_irepository_get_object_gtype_interfaces (GIRepository *repository, void gi_repository_get_object_gtype_interfaces (GIRepository *repository,
GType gtype, GType gtype,
guint *n_interfaces_out, guint *n_interfaces_out,
GIInterfaceInfo ***interfaces_out); GIInterfaceInfo ***interfaces_out);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint g_irepository_get_n_infos (GIRepository *repository, gint gi_repository_get_n_infos (GIRepository *repository,
const gchar *namespace_); const gchar *namespace_);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIBaseInfo * g_irepository_get_info (GIRepository *repository, GIBaseInfo * gi_repository_get_info (GIRepository *repository,
const gchar *namespace_, const gchar *namespace_,
gint index); gint index);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIEnumInfo * g_irepository_find_by_error_domain (GIRepository *repository, GIEnumInfo * gi_repository_find_by_error_domain (GIRepository *repository,
GQuark domain); GQuark domain);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
const gchar * g_irepository_get_typelib_path (GIRepository *repository, const gchar * gi_repository_get_typelib_path (GIRepository *repository,
const gchar *namespace_); const gchar *namespace_);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
const gchar * g_irepository_get_shared_library (GIRepository *repository, const gchar * gi_repository_get_shared_library (GIRepository *repository,
const gchar *namespace_); const gchar *namespace_);
GI_AVAILABLE_IN_ALL 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_); const gchar *namespace_);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
const gchar * g_irepository_get_version (GIRepository *repository, const gchar * gi_repository_get_version (GIRepository *repository,
const gchar *namespace_); const gchar *namespace_);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GOptionGroup * g_irepository_get_option_group (void); GOptionGroup * gi_repository_get_option_group (void);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gboolean g_irepository_dump (const char *arg, GError **error); gboolean gi_repository_dump (const char *arg, GError **error);
/** /**
* GIRepositoryError: * GIRepositoryError:
* @G_IREPOSITORY_ERROR_TYPELIB_NOT_FOUND: the typelib could not be found. * @GI_REPOSITORY_ERROR_TYPELIB_NOT_FOUND: the typelib could not be found.
* @G_IREPOSITORY_ERROR_NAMESPACE_MISMATCH: the namespace does not match the * @GI_REPOSITORY_ERROR_NAMESPACE_MISMATCH: the namespace does not match the
* requested namespace. * 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. * 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. * 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. * from a #GIRepository routine.
*/ */
typedef enum typedef enum
{ {
G_IREPOSITORY_ERROR_TYPELIB_NOT_FOUND, GI_REPOSITORY_ERROR_TYPELIB_NOT_FOUND,
G_IREPOSITORY_ERROR_NAMESPACE_MISMATCH, GI_REPOSITORY_ERROR_NAMESPACE_MISMATCH,
G_IREPOSITORY_ERROR_NAMESPACE_VERSION_CONFLICT, GI_REPOSITORY_ERROR_NAMESPACE_VERSION_CONFLICT,
G_IREPOSITORY_ERROR_LIBRARY_NOT_FOUND GI_REPOSITORY_ERROR_LIBRARY_NOT_FOUND
} GIRepositoryError; } GIRepositoryError;
/** /**
* G_IREPOSITORY_ERROR: * GI_REPOSITORY_ERROR:
* *
* Error domain for #GIRepository. Errors in this domain will be from the * Error domain for #GIRepository. Errors in this domain will be from the
* #GIRepositoryError enumeration. See #GError for more information on * #GIRepositoryError enumeration. See #GError for more information on
* error domains. * error domains.
*/ */
#define G_IREPOSITORY_ERROR (g_irepository_error_quark ()) #define GI_REPOSITORY_ERROR (gi_repository_error_quark ())
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GQuark g_irepository_error_quark (void); GQuark gi_repository_error_quark (void);
/* Global utility functions */ /* Global utility functions */

View File

@ -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 * @info: A #GITypeInfo
* *
* TODO * 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. * Returns: A #ffi_type corresponding to the platform default C ABI for @info.
*/ */
ffi_type * ffi_type *
g_type_info_get_ffi_type (GITypeInfo *info) gi_type_info_get_ffi_type (GITypeInfo *info)
{ {
gboolean is_enum = FALSE; gboolean is_enum = FALSE;
GIBaseInfo *iinfo; 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); iinfo = gi_type_info_get_interface (info);
switch (g_base_info_get_type (iinfo)) switch (gi_base_info_get_type (iinfo))
{ {
case GI_INFO_TYPE_ENUM: case GI_INFO_TYPE_ENUM:
case GI_INFO_TYPE_FLAGS: case GI_INFO_TYPE_FLAGS:
@ -155,14 +155,14 @@ g_type_info_get_ffi_type (GITypeInfo *info)
default: default:
break; 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 * @callable_info: a callable info from a typelib
* @n_args_p: (out): The number of arguments * @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. * should be freed using g_free() after use.
*/ */
static ffi_type ** static ffi_type **
g_callable_info_get_ffi_arg_types (GICallableInfo *callable_info, gi_callable_info_get_ffi_arg_types (GICallableInfo *callable_info,
int *n_args_p) int *n_args_p)
{ {
ffi_type **arg_types; ffi_type **arg_types;
gboolean is_method, throws; 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); g_return_val_if_fail (callable_info != NULL, NULL);
n_args = g_callable_info_get_n_args (callable_info); n_args = gi_callable_info_get_n_args (callable_info);
is_method = g_callable_info_is_method (callable_info); is_method = gi_callable_info_is_method (callable_info);
throws = g_callable_info_can_throw_gerror (callable_info); throws = gi_callable_info_can_throw_gerror (callable_info);
offset = is_method ? 1 : 0; offset = is_method ? 1 : 0;
n_invoke_args = n_args; n_invoke_args = n_args;
@ -208,12 +208,12 @@ g_callable_info_get_ffi_arg_types (GICallableInfo *callable_info,
GIArgInfo arg_info; GIArgInfo arg_info;
GITypeInfo arg_type; GITypeInfo arg_type;
g_callable_info_load_arg (callable_info, i, &arg_info); gi_callable_info_load_arg (callable_info, i, &arg_info);
g_arg_info_load_type (&arg_info, &arg_type); gi_arg_info_load_type (&arg_info, &arg_type);
switch (g_arg_info_get_direction (&arg_info)) switch (gi_arg_info_get_direction (&arg_info))
{ {
case GI_DIRECTION_IN: 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; break;
case GI_DIRECTION_OUT: case GI_DIRECTION_OUT:
case GI_DIRECTION_INOUT: 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 * @callable_info: a callable info from a typelib
* *
* Fetches the ffi_type for a corresponding return value of * 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 * Returns: the ffi_type for the return value
*/ */
static ffi_type * 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; GITypeInfo *return_type;
ffi_type *return_ffi_type; ffi_type *return_ffi_type;
g_return_val_if_fail (callable_info != NULL, NULL); g_return_val_if_fail (callable_info != NULL, NULL);
return_type = g_callable_info_get_return_type (callable_info); return_type = gi_callable_info_get_return_type (callable_info);
return_ffi_type = g_type_info_get_ffi_type (return_type); return_ffi_type = gi_type_info_get_ffi_type (return_type);
g_base_info_unref((GIBaseInfo*)return_type); gi_base_info_unref((GIBaseInfo*)return_type);
return return_ffi_type; return return_ffi_type;
} }
/** /**
* g_function_info_prep_invoker: * gi_function_info_prep_invoker:
* @info: A #GIFunctionInfo * @info: A #GIFunctionInfo
* @invoker: Output invoker structure * @invoker: Output invoker structure
* @error: A #GError * @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. * Returns: %TRUE on success, %FALSE otherwise with @error set.
*/ */
gboolean gboolean
g_function_info_prep_invoker (GIFunctionInfo *info, gi_function_info_prep_invoker (GIFunctionInfo *info,
GIFunctionInvoker *invoker, GIFunctionInvoker *invoker,
GError **error) GError **error)
{ {
const char *symbol; const char *symbol;
gpointer addr; 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 (info != NULL, FALSE);
g_return_val_if_fail (invoker != 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), if (!gi_typelib_symbol (gi_base_info_get_typelib ((GIBaseInfo *) info),
symbol, &addr)) symbol, &addr))
{ {
g_set_error (error, g_set_error (error,
G_INVOKE_ERROR, GI_INVOKE_ERROR,
G_INVOKE_ERROR_SYMBOL_NOT_FOUND, GI_INVOKE_ERROR_SYMBOL_NOT_FOUND,
"Could not locate %s: %s", symbol, g_module_error ()); "Could not locate %s: %s", symbol, g_module_error ());
return FALSE; 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 * @addr: The address
* @info: A #GICallableInfo * @info: A #GICallableInfo
* @invoker: Output invoker structure * @invoker: Output invoker structure
@ -314,10 +314,10 @@ g_function_info_prep_invoker (GIFunctionInfo *info,
* Returns: %TRUE on success, %FALSE otherwise with @error set. * Returns: %TRUE on success, %FALSE otherwise with @error set.
*/ */
gboolean gboolean
g_function_invoker_new_for_address (gpointer addr, gi_function_invoker_new_for_address (gpointer addr,
GICallableInfo *info, GICallableInfo *info,
GIFunctionInvoker *invoker, GIFunctionInvoker *invoker,
GError **error) GError **error)
{ {
ffi_type **atypes; ffi_type **atypes;
gint n_args; gint n_args;
@ -327,15 +327,15 @@ g_function_invoker_new_for_address (gpointer addr,
invoker->native_address = 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, 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; atypes) == FFI_OK;
} }
/** /**
* g_function_invoker_destroy: * gi_function_invoker_destroy:
* @invoker: A #GIFunctionInvoker * @invoker: A #GIFunctionInvoker
* *
* Release all resources allocated for the internals of @invoker; callers * Release all resources allocated for the internals of @invoker; callers
@ -343,7 +343,7 @@ g_function_invoker_new_for_address (gpointer addr,
* itself however. * itself however.
*/ */
void void
g_function_invoker_destroy (GIFunctionInvoker *invoker) gi_function_invoker_destroy (GIFunctionInvoker *invoker)
{ {
g_free (invoker->cif.arg_types); g_free (invoker->cif.arg_types);
} }
@ -355,7 +355,7 @@ typedef struct {
} GIClosureWrapper; } GIClosureWrapper;
/** /**
* g_callable_info_create_closure: * gi_callable_info_create_closure:
* @callable_info: a callable info from a typelib * @callable_info: a callable info from a typelib
* @cif: a ffi_cif structure * @cif: a ffi_cif structure
* @callback: the ffi callback * @callback: the ffi callback
@ -364,13 +364,13 @@ typedef struct {
* Prepares a callback for ffi invocation. * Prepares a callback for ffi invocation.
* *
* Returns: the ffi_closure or NULL on error. The return value * 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 * ffi_closure *
g_callable_info_create_closure (GICallableInfo *callable_info, gi_callable_info_create_closure (GICallableInfo *callable_info,
ffi_cif *cif, ffi_cif *cif,
GIFFIClosureCallback callback, GIFFIClosureCallback callback,
gpointer user_data) gpointer user_data)
{ {
gpointer exec_ptr; gpointer exec_ptr;
int n_args; int n_args;
@ -392,9 +392,9 @@ g_callable_info_create_closure (GICallableInfo *callable_info,
closure->native_address = exec_ptr; 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, 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); atypes);
if (status != FFI_OK) 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 * @callable_info: a callable info from a typelib
* @closure: ffi closure * @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 * gpointer *
g_callable_info_get_closure_native_address (GICallableInfo *callable_info, gi_callable_info_get_closure_native_address (GICallableInfo *callable_info,
ffi_closure *closure) ffi_closure *closure)
{ {
GIClosureWrapper *wrapper = (GIClosureWrapper *)closure; GIClosureWrapper *wrapper = (GIClosureWrapper *)closure;
return wrapper->native_address; return wrapper->native_address;
} }
/** /**
* g_callable_info_destroy_closure: * gi_callable_info_destroy_closure:
* @callable_info: a callable info from a typelib * @callable_info: a callable info from a typelib
* @closure: ffi closure * @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 void
g_callable_info_destroy_closure (GICallableInfo *callable_info, gi_callable_info_destroy_closure (GICallableInfo *callable_info,
ffi_closure *closure) ffi_closure *closure)
{ {
GIClosureWrapper *wrapper = (GIClosureWrapper *)closure; GIClosureWrapper *wrapper = (GIClosureWrapper *)closure;

View File

@ -73,7 +73,7 @@ GI_AVAILABLE_IN_ALL
ffi_type * gi_type_tag_get_ffi_type (GITypeTag type_tag, gboolean is_pointer); ffi_type * gi_type_tag_get_ffi_type (GITypeTag type_tag, gboolean is_pointer);
GI_AVAILABLE_IN_ALL 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 GI_AVAILABLE_IN_ALL
void gi_type_info_extract_ffi_return_value (GITypeInfo *return_info, 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); GIArgument *arg);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gboolean g_function_info_prep_invoker (GIFunctionInfo *info, gboolean gi_function_info_prep_invoker (GIFunctionInfo *info,
GIFunctionInvoker *invoker, GIFunctionInvoker *invoker,
GError **error); GError **error);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gboolean g_function_invoker_new_for_address (gpointer addr, gboolean gi_function_invoker_new_for_address (gpointer addr,
GICallableInfo *info, GICallableInfo *info,
GIFunctionInvoker *invoker, GIFunctionInvoker *invoker,
GError **error); GError **error);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
void g_function_invoker_destroy (GIFunctionInvoker *invoker); void gi_function_invoker_destroy (GIFunctionInvoker *invoker);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
ffi_closure * g_callable_info_create_closure (GICallableInfo *callable_info, ffi_closure * gi_callable_info_create_closure (GICallableInfo *callable_info,
ffi_cif *cif, ffi_cif *cif,
GIFFIClosureCallback callback, GIFFIClosureCallback callback,
gpointer user_data); gpointer user_data);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gpointer * g_callable_info_get_closure_native_address (GICallableInfo *callable_info, gpointer * gi_callable_info_get_closure_native_address (GICallableInfo *callable_info,
ffi_closure *closure); ffi_closure *closure);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
void g_callable_info_destroy_closure (GICallableInfo *callable_info, void gi_callable_info_destroy_closure (GICallableInfo *callable_info,
ffi_closure *closure); ffi_closure *closure);
G_END_DECLS G_END_DECLS

View File

@ -28,11 +28,11 @@
G_BEGIN_DECLS G_BEGIN_DECLS
typedef struct _GIrTypelibBuild GIrTypelibBuild; typedef struct _GIIrTypelibBuild GIIrTypelibBuild;
typedef struct _GIrModule GIrModule; typedef struct _GIIrModule GIIrModule;
struct _GIrTypelibBuild { struct _GIIrTypelibBuild {
GIrModule *module; GIIrModule *module;
GHashTable *strings; GHashTable *strings;
GHashTable *types; GHashTable *types;
GList *nodes_with_attributes; GList *nodes_with_attributes;
@ -41,7 +41,7 @@ struct _GIrTypelibBuild {
GList *stack; GList *stack;
}; };
struct _GIrModule struct _GIIrModule
{ {
gchar *name; gchar *name;
gchar *version; gchar *version;
@ -66,20 +66,20 @@ struct _GIrModule
GHashTable *disguised_structures; GHashTable *disguised_structures;
}; };
GIrModule *_g_ir_module_new (const gchar *name, GIIrModule *gi_ir_module_new (const gchar *name,
const gchar *nsversion, const gchar *nsversion,
const gchar *module_filename, const gchar *module_filename,
const gchar *c_prefix); const gchar *c_prefix);
void _g_ir_module_free (GIrModule *module); void gi_ir_module_free (GIIrModule *module);
void _g_ir_module_add_include_module (GIrModule *module, void gi_ir_module_add_include_module (GIIrModule *module,
GIrModule *include_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 gi_ir_node_init_stats (void);
void _g_irnode_dump_stats (void); void gi_ir_node_dump_stats (void);
G_END_DECLS G_END_DECLS

View File

@ -37,15 +37,15 @@
#define NUM_SECTIONS 2 #define NUM_SECTIONS 2
GIrModule * GIIrModule *
_g_ir_module_new (const gchar *name, gi_ir_module_new (const gchar *name,
const gchar *version, const gchar *version,
const gchar *shared_library, const gchar *shared_library,
const gchar *c_prefix) const gchar *c_prefix)
{ {
GIrModule *module; GIIrModule *module;
module = g_slice_new0 (GIrModule); module = g_slice_new0 (GIIrModule);
module->name = g_strdup (name); module->name = g_strdup (name);
module->version = g_strdup (version); module->version = g_strdup (version);
@ -64,14 +64,14 @@ _g_ir_module_new (const gchar *name,
} }
void void
_g_ir_module_free (GIrModule *module) gi_ir_module_free (GIIrModule *module)
{ {
GList *e; GList *e;
g_free (module->name); g_free (module->name);
for (e = module->entries; e; e = e->next) 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); g_list_free (module->entries);
/* Don't free dependencies, we inherit that from the parser */ /* 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->pointer_structures);
g_hash_table_destroy (module->disguised_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 * @build: Current build
* @line: Origin line number, or 0 if unknown * @line: Origin line number, or 0 if unknown
* @msg: printf-format string * @msg: printf-format string
@ -95,10 +95,10 @@ _g_ir_module_free (GIrModule *module)
* Report a fatal error, then exit. * Report a fatal error, then exit.
*/ */
void void
_g_ir_module_fatal (GIrTypelibBuild *build, gi_ir_module_fatal (GIIrTypelibBuild *build,
guint line, guint line,
const char *msg, const char *msg,
...) ...)
{ {
GString *context; GString *context;
char *formatted; char *formatted;
@ -117,7 +117,7 @@ _g_ir_module_fatal (GIrTypelibBuild *build,
g_string_append (context, "In "); g_string_append (context, "In ");
for (link = g_list_last (build->stack); link; link = link->prev) for (link = g_list_last (build->stack); link; link = link->prev)
{ {
GIrNode *node = link->data; GIIrNode *node = link->data;
const char *name = node->name; const char *name = node->name;
if (name) if (name)
g_string_append (context, name); g_string_append (context, name);
@ -142,7 +142,7 @@ add_alias_foreach (gpointer key,
gpointer value, gpointer value,
gpointer data) gpointer data)
{ {
GIrModule *module = data; GIIrModule *module = data;
g_hash_table_replace (module->aliases, g_strdup (key), g_strdup (value)); 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 value,
gpointer data) gpointer data)
{ {
GIrModule *module = data; GIIrModule *module = data;
g_hash_table_replace (module->pointer_structures, g_strdup (key), value); g_hash_table_replace (module->pointer_structures, g_strdup (key), value);
} }
@ -162,14 +162,14 @@ add_disguised_structure_foreach (gpointer key,
gpointer value, gpointer value,
gpointer data) gpointer data)
{ {
GIrModule *module = data; GIIrModule *module = data;
g_hash_table_replace (module->disguised_structures, g_strdup (key), value); g_hash_table_replace (module->disguised_structures, g_strdup (key), value);
} }
void void
_g_ir_module_add_include_module (GIrModule *module, gi_ir_module_add_include_module (GIIrModule *module,
GIrModule *include_module) GIIrModule *include_module)
{ {
module->include_modules = g_list_prepend (module->include_modules, module->include_modules = g_list_prepend (module->include_modules,
include_module); include_module);
@ -190,7 +190,7 @@ struct AttributeWriteData
{ {
guint count; guint count;
guchar *databuf; guchar *databuf;
GIrNode *node; GIIrNode *node;
GHashTable *strings; GHashTable *strings;
guint32 *offset; guint32 *offset;
guint32 *offset2; guint32 *offset2;
@ -206,19 +206,19 @@ write_attribute (gpointer key, gpointer value, gpointer datap)
*(data->offset) += sizeof (AttributeBlob); *(data->offset) += sizeof (AttributeBlob);
blob->offset = data->node->offset; blob->offset = data->node->offset;
blob->name = _g_ir_write_string ((const char*) key, data->strings, data->databuf, data->offset2); blob->name = gi_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->value = gi_ir_write_string ((const char*) value, data->strings, data->databuf, data->offset2);
data->count++; data->count++;
} }
static guint static guint
write_attributes (GIrModule *module, write_attributes (GIIrModule *module,
GIrNode *node, GIIrNode *node,
GHashTable *strings, GHashTable *strings,
guchar *data, guchar *data,
guint32 *offset, guint32 *offset,
guint32 *offset2) guint32 *offset2)
{ {
struct AttributeWriteData wdata; struct AttributeWriteData wdata;
wdata.count = 0; wdata.count = 0;
@ -237,8 +237,8 @@ static gint
node_cmp_offset_func (gconstpointer a, node_cmp_offset_func (gconstpointer a,
gconstpointer b) gconstpointer b)
{ {
const GIrNode *na = a; const GIIrNode *na = a;
const GIrNode *nb = b; const GIIrNode *nb = b;
return na->offset - nb->offset; return na->offset - nb->offset;
} }
@ -265,7 +265,7 @@ alloc_section (guint8 *data, SectionType section_id, guint32 offset)
} }
static guint8* static guint8*
add_directory_index_section (guint8 *data, GIrModule *module, guint32 *offset2) add_directory_index_section (guint8 *data, GIIrModule *module, guint32 *offset2)
{ {
DirEntry *entry; DirEntry *entry;
Header *header = (Header*)data; Header *header = (Header*)data;
@ -274,7 +274,7 @@ add_directory_index_section (guint8 *data, GIrModule *module, guint32 *offset2)
guint16 required_size; guint16 required_size;
guint32 new_offset; guint32 new_offset;
dirindex_builder = _gi_typelib_hash_builder_new (); dirindex_builder = gi_typelib_hash_builder_new ();
n_interfaces = ((Header *)data)->n_local_entries; n_interfaces = ((Header *)data)->n_local_entries;
@ -283,37 +283,37 @@ add_directory_index_section (guint8 *data, GIrModule *module, guint32 *offset2)
const char *str; const char *str;
entry = (DirEntry *)&data[header->directory + (i * header->entry_blob_size)]; entry = (DirEntry *)&data[header->directory + (i * header->entry_blob_size)];
str = (const char *) (&data[entry->name]); 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 /* This happens if CMPH couldn't create a perfect hash. So
* we just punt and leave no directory index section. * 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; return data;
} }
alloc_section (data, GI_SECTION_DIRECTORY_INDEX, *offset2); 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); required_size = ALIGN_VALUE (required_size, 4);
new_offset = *offset2 + required_size; new_offset = *offset2 + required_size;
data = g_realloc (data, new_offset); 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; *offset2 = new_offset;
_gi_typelib_hash_builder_destroy (dirindex_builder); gi_typelib_hash_builder_destroy (dirindex_builder);
return data; return data;
} }
GITypelib * GITypelib *
_g_ir_module_build_typelib (GIrModule *module) gi_ir_module_build_typelib (GIIrModule *module)
{ {
GError *error = NULL; GError *error = NULL;
GITypelib *typelib; GITypelib *typelib;
@ -360,7 +360,7 @@ _g_ir_module_build_typelib (GIrModule *module)
} }
restart: restart:
_g_irnode_init_stats (); gi_ir_node_init_stats ();
strings = g_hash_table_new (g_str_hash, g_str_equal); strings = g_hash_table_new (g_str_hash, g_str_equal);
types = 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; nodes_with_attributes = NULL;
@ -376,9 +376,9 @@ _g_ir_module_build_typelib (GIrModule *module)
for (e = module->entries; e; e = e->next) 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 */ /* Also reset the offset here */
node->offset = 0; node->offset = 0;
@ -402,7 +402,7 @@ _g_ir_module_build_typelib (GIrModule *module)
/* fill in header */ /* fill in header */
header = (Header *)data; header = (Header *)data;
memcpy (header, G_IR_MAGIC, 16); memcpy (header, GI_IR_MAGIC, 16);
header->major_version = 4; header->major_version = 4;
header->minor_version = 0; header->minor_version = 0;
header->reserved = 0; header->reserved = 0;
@ -414,17 +414,17 @@ _g_ir_module_build_typelib (GIrModule *module)
* the size calculations above. * the size calculations above.
*/ */
if (dependencies != NULL) 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 else
header->dependencies = 0; header->dependencies = 0;
header->size = 0; /* filled in later */ header->size = 0; /* filled in later */
header->namespace = _g_ir_write_string (module->name, strings, data, &header_size); header->namespace = gi_ir_write_string (module->name, strings, data, &header_size);
header->nsversion = _g_ir_write_string (module->version, strings, data, &header_size); header->nsversion = gi_ir_write_string (module->version, strings, data, &header_size);
header->shared_library = (module->shared_library? 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); : 0);
if (module->c_prefix != NULL) 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 else
header->c_prefix = 0; header->c_prefix = 0;
header->entry_blob_size = sizeof (DirEntry); 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++) for (e = module->entries, i = 0; e; e = e->next, i++)
{ {
GIrTypelibBuild build; GIIrTypelibBuild build;
GIrNode *node = e->data; GIIrNode *node = e->data;
if (strchr (node->name, '.')) if (strchr (node->name, '.'))
{ {
@ -488,7 +488,7 @@ _g_ir_module_build_typelib (GIrModule *module)
/* Reset the cached offsets */ /* Reset the cached offsets */
for (link = nodes_with_attributes; link; link = link->next) 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); g_list_free (nodes_with_attributes);
strings = NULL; strings = NULL;
@ -501,24 +501,24 @@ _g_ir_module_build_typelib (GIrModule *module)
offset = offset2; 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->blob_type = 0;
entry->local = FALSE; entry->local = FALSE;
entry->offset = _g_ir_write_string (namespace, strings, data, &offset2); entry->offset = gi_ir_write_string (namespace, strings, data, &offset2);
entry->name = _g_ir_write_string (node->name, strings, data, &offset2); entry->name = gi_ir_write_string (node->name, strings, data, &offset2);
} }
else else
{ {
old_offset = offset; 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->blob_type = node->type;
entry->local = TRUE; entry->local = TRUE;
entry->offset = offset; 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)); memset (&build, 0, sizeof (build));
build.module = module; build.module = module;
@ -527,13 +527,13 @@ _g_ir_module_build_typelib (GIrModule *module)
build.nodes_with_attributes = nodes_with_attributes; build.nodes_with_attributes = nodes_with_attributes;
build.n_attributes = header->n_attributes; build.n_attributes = header->n_attributes;
build.data = data; 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; nodes_with_attributes = build.nodes_with_attributes;
header->n_attributes = build.n_attributes; header->n_attributes = build.n_attributes;
if (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 - _g_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++; 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_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 */ /* Write attributes after the blobs */
offset = offset2; offset = offset2;
@ -553,7 +553,7 @@ _g_ir_module_build_typelib (GIrModule *module)
for (e = nodes_with_attributes; e; e = e->next) 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); write_attributes (module, node, strings, data, &offset, &offset2);
} }
@ -566,7 +566,7 @@ _g_ir_module_build_typelib (GIrModule *module)
header = (Header *)data; header = (Header *)data;
length = header->size = offset2; length = header->size = offset2;
typelib = g_typelib_new_from_memory (data, length, &error); typelib = gi_typelib_new_from_memory (data, length, &error);
if (!typelib) if (!typelib)
{ {
g_error ("error building typelib: %s", g_error ("error building typelib: %s",

View File

@ -29,68 +29,68 @@
G_BEGIN_DECLS G_BEGIN_DECLS
typedef struct _GIrNode GIrNode; typedef struct _GIIrNode GIIrNode;
typedef struct _GIrNodeFunction GIrNodeFunction; typedef struct _GIIrNodeFunction GIIrNodeFunction;
typedef struct _GIrNodeParam GIrNodeParam; typedef struct _GIIrNodeParam GIIrNodeParam;
typedef struct _GIrNodeType GIrNodeType; typedef struct _GIIrNodeType GIIrNodeType;
typedef struct _GIrNodeInterface GIrNodeInterface; typedef struct _GIIrNodeInterface GIIrNodeInterface;
typedef struct _GIrNodeSignal GIrNodeSignal; typedef struct _GIIrNodeSignal GIIrNodeSignal;
typedef struct _GIrNodeProperty GIrNodeProperty; typedef struct _GIIrNodeProperty GIIrNodeProperty;
typedef struct _GIrNodeVFunc GIrNodeVFunc; typedef struct _GIIrNodeVFunc GIIrNodeVFunc;
typedef struct _GIrNodeField GIrNodeField; typedef struct _GIIrNodeField GIIrNodeField;
typedef struct _GIrNodeValue GIrNodeValue; typedef struct _GIIrNodeValue GIIrNodeValue;
typedef struct _GIrNodeEnum GIrNodeEnum; typedef struct _GIIrNodeEnum GIIrNodeEnum;
typedef struct _GIrNodeBoxed GIrNodeBoxed; typedef struct _GIIrNodeBoxed GIIrNodeBoxed;
typedef struct _GIrNodeStruct GIrNodeStruct; typedef struct _GIIrNodeStruct GIIrNodeStruct;
typedef struct _GIrNodeConstant GIrNodeConstant; typedef struct _GIIrNodeConstant GIIrNodeConstant;
typedef struct _GIrNodeXRef GIrNodeXRef; typedef struct _GIIrNodeXRef GIIrNodeXRef;
typedef struct _GIrNodeUnion GIrNodeUnion; typedef struct _GIIrNodeUnion GIIrNodeUnion;
typedef enum typedef enum
{ {
G_IR_NODE_INVALID = 0, GI_IR_NODE_INVALID = 0,
G_IR_NODE_FUNCTION = 1, GI_IR_NODE_FUNCTION = 1,
G_IR_NODE_CALLBACK = 2, GI_IR_NODE_CALLBACK = 2,
G_IR_NODE_STRUCT = 3, GI_IR_NODE_STRUCT = 3,
G_IR_NODE_BOXED = 4, GI_IR_NODE_BOXED = 4,
G_IR_NODE_ENUM = 5, GI_IR_NODE_ENUM = 5,
G_IR_NODE_FLAGS = 6, GI_IR_NODE_FLAGS = 6,
G_IR_NODE_OBJECT = 7, GI_IR_NODE_OBJECT = 7,
G_IR_NODE_INTERFACE = 8, GI_IR_NODE_INTERFACE = 8,
G_IR_NODE_CONSTANT = 9, GI_IR_NODE_CONSTANT = 9,
G_IR_NODE_INVALID_0 = 10, /* DELETED - used to be ERROR_DOMAIN */ GI_IR_NODE_INVALID_0 = 10, /* DELETED - used to be ERROR_DOMAIN */
G_IR_NODE_UNION = 11, GI_IR_NODE_UNION = 11,
G_IR_NODE_PARAM = 12, GI_IR_NODE_PARAM = 12,
G_IR_NODE_TYPE = 13, GI_IR_NODE_TYPE = 13,
G_IR_NODE_PROPERTY = 14, GI_IR_NODE_PROPERTY = 14,
G_IR_NODE_SIGNAL = 15, GI_IR_NODE_SIGNAL = 15,
G_IR_NODE_VALUE = 16, GI_IR_NODE_VALUE = 16,
G_IR_NODE_VFUNC = 17, GI_IR_NODE_VFUNC = 17,
G_IR_NODE_FIELD = 18, GI_IR_NODE_FIELD = 18,
G_IR_NODE_XREF = 19 GI_IR_NODE_XREF = 19
} GIrNodeTypeId; } GIIrNodeTypeId;
struct _GIrNode struct _GIIrNode
{ {
GIrNodeTypeId type; GIIrNodeTypeId type;
gchar *name; gchar *name;
GIrModule *module; GIIrModule *module;
guint32 offset; /* Assigned as we build the typelib */ guint32 offset; /* Assigned as we build the typelib */
GHashTable *attributes; GHashTable *attributes;
}; };
struct _GIrNodeXRef struct _GIIrNodeXRef
{ {
GIrNode node; GIIrNode node;
gchar *namespace; gchar *namespace;
}; };
struct _GIrNodeFunction struct _GIIrNodeFunction
{ {
GIrNode node; GIIrNode node;
gboolean deprecated; gboolean deprecated;
gboolean is_varargs; /* Not in typelib yet */ gboolean is_varargs; /* Not in typelib yet */
@ -106,13 +106,13 @@ struct _GIrNodeFunction
gchar *symbol; gchar *symbol;
char *property; char *property;
GIrNodeParam *result; GIIrNodeParam *result;
GList *parameters; GList *parameters;
}; };
struct _GIrNodeType struct _GIIrNodeType
{ {
GIrNode node; GIIrNode node;
gboolean is_pointer; gboolean is_pointer;
gboolean is_basic; gboolean is_basic;
@ -133,16 +133,16 @@ struct _GIrNodeType
gint size; gint size;
gint array_type; gint array_type;
GIrNodeType *parameter_type1; GIIrNodeType *parameter_type1;
GIrNodeType *parameter_type2; GIIrNodeType *parameter_type2;
gchar *giinterface; gchar *giinterface;
gchar **errors; gchar **errors;
}; };
struct _GIrNodeParam struct _GIIrNodeParam
{ {
GIrNode node; GIIrNode node;
gboolean in; gboolean in;
gboolean out; gboolean out;
@ -158,12 +158,12 @@ struct _GIrNodeParam
gint8 closure; gint8 closure;
gint8 destroy; gint8 destroy;
GIrNodeType *type; GIIrNodeType *type;
}; };
struct _GIrNodeProperty struct _GIIrNodeProperty
{ {
GIrNode node; GIIrNode node;
gboolean deprecated; gboolean deprecated;
@ -178,12 +178,12 @@ struct _GIrNodeProperty
char *setter; char *setter;
char *getter; char *getter;
GIrNodeType *type; GIIrNodeType *type;
}; };
struct _GIrNodeSignal struct _GIIrNodeSignal
{ {
GIrNode node; GIIrNode node;
gboolean deprecated; gboolean deprecated;
@ -202,12 +202,12 @@ struct _GIrNodeSignal
gint class_closure; gint class_closure;
GList *parameters; GList *parameters;
GIrNodeParam *result; GIIrNodeParam *result;
}; };
struct _GIrNodeVFunc struct _GIIrNodeVFunc
{ {
GIrNode node; GIIrNode node;
gboolean is_varargs; /* Not in typelib yet */ gboolean is_varargs; /* Not in typelib yet */
gboolean must_chain_up; gboolean must_chain_up;
@ -220,27 +220,27 @@ struct _GIrNodeVFunc
char *invoker; char *invoker;
GList *parameters; GList *parameters;
GIrNodeParam *result; GIIrNodeParam *result;
gint offset; gint offset;
}; };
struct _GIrNodeField struct _GIIrNodeField
{ {
GIrNode node; GIIrNode node;
gboolean readable; gboolean readable;
gboolean writable; gboolean writable;
gint bits; gint bits;
gint offset; gint offset;
GIrNodeFunction *callback; GIIrNodeFunction *callback;
GIrNodeType *type; GIIrNodeType *type;
}; };
struct _GIrNodeInterface struct _GIIrNodeInterface
{ {
GIrNode node; GIIrNode node;
gboolean abstract; gboolean abstract;
gboolean deprecated; gboolean deprecated;
@ -267,29 +267,29 @@ struct _GIrNodeInterface
GList *members; GList *members;
}; };
struct _GIrNodeValue struct _GIIrNodeValue
{ {
GIrNode node; GIIrNode node;
gboolean deprecated; gboolean deprecated;
gint64 value; gint64 value;
}; };
struct _GIrNodeConstant struct _GIIrNodeConstant
{ {
GIrNode node; GIIrNode node;
gboolean deprecated; gboolean deprecated;
GIrNodeType *type; GIIrNodeType *type;
gchar *value; gchar *value;
}; };
struct _GIrNodeEnum struct _GIIrNodeEnum
{ {
GIrNode node; GIIrNode node;
gboolean deprecated; gboolean deprecated;
gint storage_type; gint storage_type;
@ -302,9 +302,9 @@ struct _GIrNodeEnum
GList *methods; GList *methods;
}; };
struct _GIrNodeBoxed struct _GIIrNodeBoxed
{ {
GIrNode node; GIIrNode node;
gboolean deprecated; gboolean deprecated;
@ -317,9 +317,9 @@ struct _GIrNodeBoxed
GList *members; GList *members;
}; };
struct _GIrNodeStruct struct _GIIrNodeStruct
{ {
GIrNode node; GIIrNode node;
gboolean deprecated; gboolean deprecated;
gboolean disguised; gboolean disguised;
@ -340,9 +340,9 @@ struct _GIrNodeStruct
GList *members; GList *members;
}; };
struct _GIrNodeUnion struct _GIIrNodeUnion
{ {
GIrNode node; GIIrNode node;
gboolean deprecated; gboolean deprecated;
@ -359,42 +359,42 @@ struct _GIrNodeUnion
gint size; gint size;
gint discriminator_offset; gint discriminator_offset;
GIrNodeType *discriminator_type; GIIrNodeType *discriminator_type;
}; };
GIrNode * _g_ir_node_new (GIrNodeTypeId type, GIIrNode *gi_ir_node_new (GIIrNodeTypeId type,
GIrModule *module); GIIrModule *module);
void _g_ir_node_free (GIrNode *node); void gi_ir_node_free (GIIrNode *node);
guint32 _g_ir_node_get_size (GIrNode *node); guint32 gi_ir_node_get_size (GIIrNode *node);
guint32 _g_ir_node_get_full_size (GIrNode *node); guint32 gi_ir_node_get_full_size (GIIrNode *node);
void _g_ir_node_build_typelib (GIrNode *node, void gi_ir_node_build_typelib (GIIrNode *node,
GIrNode *parent, GIIrNode *parent,
GIrTypelibBuild *build, GIIrTypelibBuild *build,
guint32 *offset, guint32 *offset,
guint32 *offset2, guint32 *offset2,
guint16 *count2); guint16 *count2);
int _g_ir_node_cmp (GIrNode *node, int gi_ir_node_cmp (GIIrNode *node,
GIrNode *other); GIIrNode *other);
gboolean _g_ir_node_can_have_member (GIrNode *node); gboolean gi_ir_node_can_have_member (GIIrNode *node);
void _g_ir_node_add_member (GIrNode *node, void gi_ir_node_add_member (GIIrNode *node,
GIrNodeFunction *member); GIIrNodeFunction *member);
guint32 _g_ir_write_string (const gchar *str, guint32 gi_ir_write_string (const gchar *str,
GHashTable *strings, GHashTable *strings,
guchar *data, guchar *data,
guint32 *offset); guint32 *offset);
const gchar * _g_ir_node_param_direction_string (GIrNodeParam * node); const gchar * gi_ir_node_param_direction_string (GIIrNodeParam * node);
const gchar * _g_ir_node_type_to_string (GIrNodeTypeId type); const gchar * gi_ir_node_type_to_string (GIIrNodeTypeId type);
GIrNode *_g_ir_find_node (GIrTypelibBuild *build, GIIrNode *gi_ir_find_node (GIIrTypelibBuild *build,
GIrModule *module, GIIrModule *module,
const char *name); const char *name);
/* In giroffsets.c */ /* In giroffsets.c */
void _g_ir_node_compute_offsets (GIrTypelibBuild *build, void gi_ir_node_compute_offsets (GIIrTypelibBuild *build,
GIrNode *node); GIIrNode *node);
G_END_DECLS G_END_DECLS

File diff suppressed because it is too large Load Diff

View File

@ -70,7 +70,7 @@ typedef enum {
} Enum9; } Enum9;
static void static void
compute_enum_storage_type (GIrNodeEnum *enum_node) compute_enum_storage_type (GIIrNodeEnum *enum_node)
{ {
GList *l; GList *l;
gint64 max_value = 0; gint64 max_value = 0;
@ -83,7 +83,7 @@ compute_enum_storage_type (GIrNodeEnum *enum_node)
for (l = enum_node->values; l; l = l->next) for (l = enum_node->values; l; l = l->next)
{ {
GIrNodeValue *value = l->data; GIIrNodeValue *value = l->data;
if (value->value > max_value) if (value->value > max_value)
max_value = value->value; max_value = value->value;
if (value->value < min_value) if (value->value < min_value)
@ -148,9 +148,9 @@ compute_enum_storage_type (GIrNodeEnum *enum_node)
} }
static gboolean static gboolean
get_enum_size_alignment (GIrNodeEnum *enum_node, get_enum_size_alignment (GIIrNodeEnum *enum_node,
gint *size, gint *size,
gint *alignment) gint *alignment)
{ {
ffi_type *type_ffi; ffi_type *type_ffi;
@ -176,7 +176,7 @@ get_enum_size_alignment (GIrNodeEnum *enum_node,
break; break;
default: default:
g_error ("Unexpected enum storage type %s", 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; *size = type_ffi->size;
@ -186,63 +186,63 @@ get_enum_size_alignment (GIrNodeEnum *enum_node,
} }
static gboolean static gboolean
get_interface_size_alignment (GIrTypelibBuild *build, get_interface_size_alignment (GIIrTypelibBuild *build,
GIrNodeType *type, GIIrNodeType *type,
gint *size, gint *size,
gint *alignment, gint *alignment,
const char *who) 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) 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; *size = -1;
*alignment = -1; *alignment = -1;
return FALSE; return FALSE;
} }
_g_ir_node_compute_offsets (build, iface); gi_ir_node_compute_offsets (build, iface);
switch (iface->type) switch (iface->type)
{ {
case G_IR_NODE_BOXED: case GI_IR_NODE_BOXED:
{ {
GIrNodeBoxed *boxed = (GIrNodeBoxed *)iface; GIIrNodeBoxed *boxed = (GIIrNodeBoxed *)iface;
*size = boxed->size; *size = boxed->size;
*alignment = boxed->alignment; *alignment = boxed->alignment;
break; break;
} }
case G_IR_NODE_STRUCT: case GI_IR_NODE_STRUCT:
{ {
GIrNodeStruct *struct_ = (GIrNodeStruct *)iface; GIIrNodeStruct *struct_ = (GIIrNodeStruct *)iface;
*size = struct_->size; *size = struct_->size;
*alignment = struct_->alignment; *alignment = struct_->alignment;
break; break;
} }
case G_IR_NODE_OBJECT: case GI_IR_NODE_OBJECT:
case G_IR_NODE_INTERFACE: case GI_IR_NODE_INTERFACE:
{ {
GIrNodeInterface *interface = (GIrNodeInterface *)iface; GIIrNodeInterface *interface = (GIIrNodeInterface *)iface;
*size = interface->size; *size = interface->size;
*alignment = interface->alignment; *alignment = interface->alignment;
break; break;
} }
case G_IR_NODE_UNION: case GI_IR_NODE_UNION:
{ {
GIrNodeUnion *union_ = (GIrNodeUnion *)iface; GIIrNodeUnion *union_ = (GIIrNodeUnion *)iface;
*size = union_->size; *size = union_->size;
*alignment = union_->alignment; *alignment = union_->alignment;
break; break;
} }
case G_IR_NODE_ENUM: case GI_IR_NODE_ENUM:
case G_IR_NODE_FLAGS: case GI_IR_NODE_FLAGS:
{ {
return get_enum_size_alignment ((GIrNodeEnum *)iface, return get_enum_size_alignment ((GIIrNodeEnum *)iface,
size, alignment); size, alignment);
} }
case G_IR_NODE_CALLBACK: case GI_IR_NODE_CALLBACK:
{ {
*size = ffi_type_pointer.size; *size = ffi_type_pointer.size;
*alignment = ffi_type_pointer.alignment; *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", g_warning ("%s has is not a pointer and is of type %s",
who, who,
_g_ir_node_type_to_string (iface->type)); gi_ir_node_type_to_string (iface->type));
*size = -1; *size = -1;
*alignment = -1; *alignment = -1;
break; break;
@ -263,11 +263,11 @@ get_interface_size_alignment (GIrTypelibBuild *build,
} }
static gboolean static gboolean
get_type_size_alignment (GIrTypelibBuild *build, get_type_size_alignment (GIIrTypelibBuild *build,
GIrNodeType *type, GIIrNodeType *type,
gint *size, gint *size,
gint *alignment, gint *alignment,
const char *who) const char *who)
{ {
ffi_type *type_ffi; 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", g_warning ("%s has is not a pointer and is of type %s",
who, who,
g_type_tag_to_string (type->tag)); gi_type_tag_to_string (type->tag));
*size = -1; *size = -1;
*alignment = -1; *alignment = -1;
return FALSE; return FALSE;
@ -330,17 +330,17 @@ get_type_size_alignment (GIrTypelibBuild *build,
} }
static gboolean static gboolean
get_field_size_alignment (GIrTypelibBuild *build, get_field_size_alignment (GIIrTypelibBuild *build,
GIrNodeField *field, GIIrNodeField *field,
GIrNode *parent_node, GIIrNode *parent_node,
gint *size, gint *size,
gint *alignment) gint *alignment)
{ {
GIrModule *module = build->module; GIIrModule *module = build->module;
gchar *who; gchar *who;
gboolean success; 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) if (field->callback)
{ {
@ -358,11 +358,11 @@ get_field_size_alignment (GIrTypelibBuild *build,
#define GI_ALIGN(n, align) (((n) + (align) - 1) & ~((align) - 1)) #define GI_ALIGN(n, align) (((n) + (align) - 1) & ~((align) - 1))
static gboolean static gboolean
compute_struct_field_offsets (GIrTypelibBuild *build, compute_struct_field_offsets (GIIrTypelibBuild *build,
GIrNode *node, GIIrNode *node,
GList *members, GList *members,
gint *size_out, gint *size_out,
gint *alignment_out) gint *alignment_out)
{ {
int size = 0; int size = 0;
int alignment = 1; int alignment = 1;
@ -373,11 +373,11 @@ compute_struct_field_offsets (GIrTypelibBuild *build,
for (l = members; l; l = l->next) 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) if (!have_error)
{ {
@ -399,7 +399,7 @@ compute_struct_field_offsets (GIrTypelibBuild *build,
if (have_error) if (have_error)
field->offset = -1; 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); size = GI_ALIGN (size, ffi_type_pointer.alignment);
alignment = MAX (alignment, ffi_type_pointer.alignment); alignment = MAX (alignment, ffi_type_pointer.alignment);
@ -425,11 +425,11 @@ compute_struct_field_offsets (GIrTypelibBuild *build,
} }
static gboolean static gboolean
compute_union_field_offsets (GIrTypelibBuild *build, compute_union_field_offsets (GIIrTypelibBuild *build,
GIrNode *node, GIIrNode *node,
GList *members, GList *members,
gint *size_out, gint *size_out,
gint *alignment_out) gint *alignment_out)
{ {
int size = 0; int size = 0;
int alignment = 1; int alignment = 1;
@ -440,11 +440,11 @@ compute_union_field_offsets (GIrTypelibBuild *build,
for (l = members; l; l = l->next) 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) if (!have_error)
{ {
@ -481,11 +481,11 @@ compute_union_field_offsets (GIrTypelibBuild *build,
} }
static gboolean static gboolean
check_needs_computation (GIrTypelibBuild *build, check_needs_computation (GIIrTypelibBuild *build,
GIrNode *node, GIIrNode *node,
gint alignment) gint alignment)
{ {
GIrModule *module = build->module; GIIrModule *module = build->module;
/* /*
* 0: Not yet computed * 0: Not yet computed
* >0: Previously succeeded * >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 * @build: Current typelib build
* @node: a #GIrNode * @node: a #GIIrNode
* *
* If a node is a a structure or union, makes sure that the field * 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 * offsets have been computed, and also computes the overall size and
* alignment for the type. * alignment for the type.
*/ */
void void
_g_ir_node_compute_offsets (GIrTypelibBuild *build, gi_ir_node_compute_offsets (GIIrTypelibBuild *build,
GIrNode *node) GIIrNode *node)
{ {
gboolean appended_stack; gboolean appended_stack;
if (build->stack) if (build->stack)
appended_stack = node != (GIrNode*)build->stack->data; appended_stack = node != (GIIrNode*)build->stack->data;
else else
appended_stack = TRUE; appended_stack = TRUE;
if (appended_stack) if (appended_stack)
@ -525,9 +525,9 @@ _g_ir_node_compute_offsets (GIrTypelibBuild *build,
switch (node->type) 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)) if (!check_needs_computation (build, node, boxed->alignment))
return; return;
@ -536,9 +536,9 @@ _g_ir_node_compute_offsets (GIrTypelibBuild *build,
&boxed->size, &boxed->alignment); &boxed->size, &boxed->alignment);
break; 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)) if (!check_needs_computation (build, node, struct_->alignment))
return; return;
@ -547,10 +547,10 @@ _g_ir_node_compute_offsets (GIrTypelibBuild *build,
&struct_->size, &struct_->alignment); &struct_->size, &struct_->alignment);
break; break;
} }
case G_IR_NODE_OBJECT: case GI_IR_NODE_OBJECT:
case G_IR_NODE_INTERFACE: case GI_IR_NODE_INTERFACE:
{ {
GIrNodeInterface *iface = (GIrNodeInterface *)node; GIIrNodeInterface *iface = (GIIrNodeInterface *)node;
if (!check_needs_computation (build, node, iface->alignment)) if (!check_needs_computation (build, node, iface->alignment))
return; return;
@ -559,21 +559,21 @@ _g_ir_node_compute_offsets (GIrTypelibBuild *build,
&iface->size, &iface->alignment); &iface->size, &iface->alignment);
break; 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)) if (!check_needs_computation (build, node, union_->alignment))
return; return;
compute_union_field_offsets (build, (GIrNode*)union_, union_->members, compute_union_field_offsets (build, (GIIrNode*)union_, union_->members,
&union_->size, &union_->alignment); &union_->size, &union_->alignment);
break; break;
} }
case G_IR_NODE_ENUM: case GI_IR_NODE_ENUM:
case G_IR_NODE_FLAGS: case GI_IR_NODE_FLAGS:
{ {
GIrNodeEnum *enum_ = (GIrNodeEnum *)node; GIIrNodeEnum *enum_ = (GIIrNodeEnum *)node;
if (enum_->storage_type != GI_TYPE_TAG_VOID) /* already done */ if (enum_->storage_type != GI_TYPE_TAG_VOID) /* already done */
return; return;

View File

@ -29,21 +29,21 @@ G_BEGIN_DECLS
#include "girmodule-private.h" #include "girmodule-private.h"
typedef struct _GIrParser GIrParser; typedef struct _GIIrParser GIIrParser;
GIrParser *_g_ir_parser_new (void); GIIrParser *gi_ir_parser_new (void);
void _g_ir_parser_free (GIrParser *parser); void gi_ir_parser_free (GIIrParser *parser);
void _g_ir_parser_set_includes (GIrParser *parser, void gi_ir_parser_set_includes (GIIrParser *parser,
const gchar *const *includes); const gchar *const *includes);
GIrModule *_g_ir_parser_parse_string (GIrParser *parser, GIIrModule *gi_ir_parser_parse_string (GIIrParser *parser,
const gchar *namespace, const gchar *namespace,
const gchar *filename, const gchar *filename,
const gchar *buffer, const gchar *buffer,
gssize length, gssize length,
GError **error); GError **error);
GIrModule *_g_ir_parser_parse_file (GIrParser *parser, GIIrModule *gi_ir_parser_parse_file (GIIrParser *parser,
const gchar *filename, const gchar *filename,
GError **error); GError **error);
G_END_DECLS G_END_DECLS

File diff suppressed because it is too large Load Diff

View File

@ -27,9 +27,9 @@
G_BEGIN_DECLS G_BEGIN_DECLS
void g_ir_writer_write (const char *filename, void gi_ir_writer_write (const char *filename,
const char *ns, const char *ns,
gboolean needs_prefix, gboolean needs_prefix,
gboolean show_all); gboolean show_all);
G_END_DECLS G_END_DECLS

File diff suppressed because it is too large Load Diff

View File

@ -46,7 +46,7 @@
*/ */
/** /**
* g_signal_info_get_flags: * gi_signal_info_get_flags:
* @info: a #GISignalInfo * @info: a #GISignalInfo
* *
* Obtain the flags for this signal info. See #GSignalFlags for * Obtain the flags for this signal info. See #GSignalFlags for
@ -55,7 +55,7 @@
* Returns: the flags * Returns: the flags
*/ */
GSignalFlags GSignalFlags
g_signal_info_get_flags (GISignalInfo *info) gi_signal_info_get_flags (GISignalInfo *info)
{ {
GSignalFlags flags; GSignalFlags flags;
GIRealInfo *rinfo = (GIRealInfo *)info; 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 * @info: a #GISignalInfo
* *
* Obtain the class closure for this signal if one is set. The class * 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 * Returns: (transfer full): the class closure or %NULL
*/ */
GIVFuncInfo * GIVFuncInfo *
g_signal_info_get_class_closure (GISignalInfo *info) gi_signal_info_get_class_closure (GISignalInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
SignalBlob *blob; SignalBlob *blob;
@ -113,13 +113,13 @@ g_signal_info_get_class_closure (GISignalInfo *info)
blob = (SignalBlob *)&rinfo->typelib->data[rinfo->offset]; blob = (SignalBlob *)&rinfo->typelib->data[rinfo->offset];
if (blob->has_class_closure) 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; return NULL;
} }
/** /**
* g_signal_info_true_stops_emit: * gi_signal_info_true_stops_emit:
* @info: a #GISignalInfo * @info: a #GISignalInfo
* *
* Obtain if the returning true in the signal handler will * 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 * Returns: %TRUE if returning true stops the signal emission
*/ */
gboolean gboolean
g_signal_info_true_stops_emit (GISignalInfo *info) gi_signal_info_true_stops_emit (GISignalInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
SignalBlob *blob; SignalBlob *blob;

View File

@ -40,16 +40,16 @@ G_BEGIN_DECLS
* Checks if @info is a #GISignalInfo. * Checks if @info is a #GISignalInfo.
*/ */
#define GI_IS_SIGNAL_INFO(info) \ #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 GI_AVAILABLE_IN_ALL
GSignalFlags g_signal_info_get_flags (GISignalInfo *info); GSignalFlags gi_signal_info_get_flags (GISignalInfo *info);
GI_AVAILABLE_IN_ALL 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 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 G_END_DECLS

View File

@ -44,7 +44,7 @@
*/ */
/** /**
* g_struct_info_get_n_fields: * gi_struct_info_get_n_fields:
* @info: a #GIStructInfo * @info: a #GIStructInfo
* *
* Obtain the number of fields this structure has. * Obtain the number of fields this structure has.
@ -52,7 +52,7 @@
* Returns: number of fields * Returns: number of fields
*/ */
gint gint
g_struct_info_get_n_fields (GIStructInfo *info) gi_struct_info_get_n_fields (GIStructInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset]; 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 * @info: a #GIStructInfo
* @n: index of queried field * @n: index of queried field
* *
@ -70,8 +70,8 @@ g_struct_info_get_n_fields (GIStructInfo *info)
* Returns: field offset in bytes * Returns: field offset in bytes
*/ */
static gint32 static gint32
g_struct_get_field_offset (GIStructInfo *info, gi_struct_get_field_offset (GIStructInfo *info,
gint n) gint n)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
Header *header = (Header *)rinfo->typelib->data; 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 * @info: a #GIStructInfo
* @n: a field index * @n: a field index
* *
* Obtain the type information for field with specified 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. * when done.
*/ */
GIFieldInfo * GIFieldInfo *
g_struct_info_get_field (GIStructInfo *info, gi_struct_info_get_field (GIStructInfo *info,
gint n) gint n)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
return (GIFieldInfo *) g_info_new (GI_INFO_TYPE_FIELD, (GIBaseInfo*)info, rinfo->typelib, return (GIFieldInfo *) gi_info_new (GI_INFO_TYPE_FIELD, (GIBaseInfo*)info, rinfo->typelib,
g_struct_get_field_offset (info, n)); gi_struct_get_field_offset (info, n));
} }
/** /**
* g_struct_info_find_field: * gi_struct_info_find_field:
* @info: a #GIStructInfo * @info: a #GIStructInfo
* @name: a field name * @name: a field name
* *
@ -119,11 +119,11 @@ g_struct_info_get_field (GIStructInfo *info,
* *
* Since: 1.46 * Since: 1.46
* Returns: (transfer full): the #GIFieldInfo or %NULL if not found, * 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 * GIFieldInfo *
g_struct_info_find_field (GIStructInfo *info, gi_struct_info_find_field (GIStructInfo *info,
const gchar *name) const gchar *name)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset]; StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset];
@ -138,10 +138,10 @@ g_struct_info_find_field (GIStructInfo *info,
if (strcmp (name, fname) == 0) if (strcmp (name, fname) == 0)
{ {
return (GIFieldInfo *) g_info_new (GI_INFO_TYPE_FIELD, return (GIFieldInfo *) gi_info_new (GI_INFO_TYPE_FIELD,
(GIBaseInfo* )info, (GIBaseInfo* )info,
rinfo->typelib, rinfo->typelib,
offset); offset);
} }
offset += header->field_blob_size; 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 * @info: a #GIStructInfo
* *
* Obtain the number of methods this structure has. * Obtain the number of methods this structure has.
@ -161,7 +161,7 @@ g_struct_info_find_field (GIStructInfo *info,
* Returns: number of methods * Returns: number of methods
*/ */
gint gint
g_struct_info_get_n_methods (GIStructInfo *info) gi_struct_info_get_n_methods (GIStructInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset]; 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 * @info: a #GIStructInfo
* @n: a method index * @n: a method index
* *
* Obtain the type information for method with specified 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. * when done.
*/ */
GIFunctionInfo * GIFunctionInfo *
g_struct_info_get_method (GIStructInfo *info, gi_struct_info_get_method (GIStructInfo *info,
gint n) gint n)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset]; StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset];
Header *header = (Header *)rinfo->typelib->data; Header *header = (Header *)rinfo->typelib->data;
gint offset; gint offset;
offset = g_struct_get_field_offset (info, blob->n_fields) + n * header->function_blob_size; offset = gi_struct_get_field_offset (info, blob->n_fields) + n * header->function_blob_size;
return (GIFunctionInfo *) g_info_new (GI_INFO_TYPE_FUNCTION, (GIBaseInfo*)info, return (GIFunctionInfo *) gi_info_new (GI_INFO_TYPE_FUNCTION, (GIBaseInfo*)info,
rinfo->typelib, offset); rinfo->typelib, offset);
} }
/** /**
* g_struct_info_find_method: * gi_struct_info_find_method:
* @info: a #GIStructInfo * @info: a #GIStructInfo
* @name: a method name * @name: a method name
* *
* Obtain the type information for method named @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. * when done.
*/ */
GIFunctionInfo * GIFunctionInfo *
g_struct_info_find_method (GIStructInfo *info, gi_struct_info_find_method (GIStructInfo *info,
const gchar *name) const gchar *name)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset]; StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset];
offset = g_struct_get_field_offset (info, blob->n_fields); offset = gi_struct_get_field_offset (info, blob->n_fields);
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_struct_info_get_size: * gi_struct_info_get_size:
* @info: a #GIStructInfo * @info: a #GIStructInfo
* *
* Obtain the total size of the structure. * 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 * Returns: size of the structure in bytes
*/ */
gsize gsize
g_struct_info_get_size (GIStructInfo *info) gi_struct_info_get_size (GIStructInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset]; 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 * @info: a #GIStructInfo
* *
* Obtain the required alignment of the structure. * Obtain the required alignment of the structure.
@ -241,7 +241,7 @@ g_struct_info_get_size (GIStructInfo *info)
* Returns: required alignment in bytes * Returns: required alignment in bytes
*/ */
gsize gsize
g_struct_info_get_alignment (GIStructInfo *info) gi_struct_info_get_alignment (GIStructInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset]; 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 * @info: TODO
* *
* TODO * TODO
@ -258,7 +258,7 @@ g_struct_info_get_alignment (GIStructInfo *info)
* Returns: TODO * Returns: TODO
*/ */
gboolean gboolean
g_struct_info_is_foreign (GIStructInfo *info) gi_struct_info_is_foreign (GIStructInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset]; 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 * @info: a #GIStructInfo
* *
* Return true if this structure represents the "class structure" for some * 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 * Returns: %TRUE if this is a class struct, %FALSE otherwise
*/ */
gboolean gboolean
g_struct_info_is_gtype_struct (GIStructInfo *info) gi_struct_info_is_gtype_struct (GIStructInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset]; 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 * @info: a struct information blob
* *
* Retrieves the name of the copy function for @info, if any is set. * 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 * Since: 1.76
*/ */
const char * const char *
g_struct_info_get_copy_function (GIStructInfo *info) gi_struct_info_get_copy_function (GIStructInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
StructBlob *blob; StructBlob *blob;
@ -307,13 +307,13 @@ g_struct_info_get_copy_function (GIStructInfo *info)
blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset]; blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset];
if (blob->copy_func) 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; return NULL;
} }
/** /**
* g_struct_info_get_free_function: * gi_struct_info_get_free_function:
* @info: a struct information blob * @info: a struct information blob
* *
* Retrieves the name of the free function for @info, if any is set. * 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 * Since: 1.76
*/ */
const char * const char *
g_struct_info_get_free_function (GIStructInfo *info) gi_struct_info_get_free_function (GIStructInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
StructBlob *blob; StructBlob *blob;
@ -334,7 +334,7 @@ g_struct_info_get_free_function (GIStructInfo *info)
blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset]; blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset];
if (blob->free_func) 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; return NULL;
} }

View File

@ -39,47 +39,47 @@ G_BEGIN_DECLS
* Checks if @info is a #GIStructInfo. * Checks if @info is a #GIStructInfo.
*/ */
#define GI_IS_STRUCT_INFO(info) \ #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 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 GI_AVAILABLE_IN_ALL
GIFieldInfo * g_struct_info_get_field (GIStructInfo *info, GIFieldInfo * gi_struct_info_get_field (GIStructInfo *info,
gint n); gint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIFieldInfo * g_struct_info_find_field (GIStructInfo *info, GIFieldInfo * gi_struct_info_find_field (GIStructInfo *info,
const gchar *name); const gchar *name);
GI_AVAILABLE_IN_ALL 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 GI_AVAILABLE_IN_ALL
GIFunctionInfo * g_struct_info_get_method (GIStructInfo *info, GIFunctionInfo * gi_struct_info_get_method (GIStructInfo *info,
gint n); gint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIFunctionInfo * g_struct_info_find_method (GIStructInfo *info, GIFunctionInfo * gi_struct_info_find_method (GIStructInfo *info,
const gchar *name); const gchar *name);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gsize g_struct_info_get_size (GIStructInfo *info); gsize gi_struct_info_get_size (GIStructInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gsize g_struct_info_get_alignment (GIStructInfo *info); gsize gi_struct_info_get_alignment (GIStructInfo *info);
GI_AVAILABLE_IN_ALL 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 GI_AVAILABLE_IN_ALL
gboolean g_struct_info_is_foreign (GIStructInfo *info); gboolean gi_struct_info_is_foreign (GIStructInfo *info);
GI_AVAILABLE_IN_ALL 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 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 G_END_DECLS

View File

@ -45,12 +45,12 @@
* *
* A type can either be a of a basic type which is a standard C primitive * 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 * 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. * interface.
*/ */
/** /**
* g_type_info_is_pointer: * gi_type_info_is_pointer:
* @info: a #GITypeInfo * @info: a #GITypeInfo
* *
* Obtain if the type is passed as a reference. * Obtain if the type is passed as a reference.
@ -63,7 +63,7 @@
* Returns: %TRUE if it is a pointer * Returns: %TRUE if it is a pointer
*/ */
gboolean gboolean
g_type_info_is_pointer (GITypeInfo *info) gi_type_info_is_pointer (GITypeInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
SimpleTypeBlob *type; 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 * @info: a #GITypeInfo
* *
* Obtain the type tag for the type. See #GITypeTag for a list * 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 * Returns: the type tag
*/ */
GITypeTag GITypeTag
g_type_info_get_tag (GITypeInfo *info) gi_type_info_get_tag (GITypeInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
SimpleTypeBlob *type; 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 * @info: a #GITypeInfo
* @n: index of the parameter * @n: index of the parameter
* *
@ -125,8 +125,8 @@ g_type_info_get_tag (GITypeInfo *info)
* Returns: (transfer full): the param type info * Returns: (transfer full): the param type info
*/ */
GITypeInfo * GITypeInfo *
g_type_info_get_param_type (GITypeInfo *info, gi_type_info_get_param_type (GITypeInfo *info,
gint n) gint n)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
SimpleTypeBlob *type; SimpleTypeBlob *type;
@ -146,9 +146,9 @@ g_type_info_get_param_type (GITypeInfo *info,
case GI_TYPE_TAG_GLIST: case GI_TYPE_TAG_GLIST:
case GI_TYPE_TAG_GSLIST: case GI_TYPE_TAG_GSLIST:
case GI_TYPE_TAG_GHASH: case GI_TYPE_TAG_GHASH:
return _g_type_info_new ((GIBaseInfo*)info, rinfo->typelib, return gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib,
rinfo->offset + sizeof (ParamTypeBlob) rinfo->offset + sizeof (ParamTypeBlob)
+ sizeof (SimpleTypeBlob) * n); + sizeof (SimpleTypeBlob) * n);
break; break;
default: default:
break; 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 * @info: a #GITypeInfo
* *
* For types which have #GI_TYPE_TAG_INTERFACE such as GObjects and boxed values, * 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 * 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 * 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 * Returns: (transfer full): the #GIBaseInfo, or %NULL. Free it with
* g_base_info_unref() when done. * gi_base_info_unref() when done.
*/ */
GIBaseInfo * GIBaseInfo *
g_type_info_get_interface (GITypeInfo *info) gi_type_info_get_interface (GITypeInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -196,8 +196,8 @@ g_type_info_get_interface (GITypeInfo *info)
g_assert_not_reached (); g_assert_not_reached ();
return NULL; return NULL;
} }
return (GIBaseInfo *) g_info_new (info_type, (GIBaseInfo*)info, rinfo->typelib, return (GIBaseInfo *) gi_info_new (info_type, (GIBaseInfo*)info, rinfo->typelib,
rinfo->offset); rinfo->offset);
} }
else else
{ {
@ -207,7 +207,7 @@ g_type_info_get_interface (GITypeInfo *info)
InterfaceTypeBlob *blob = (InterfaceTypeBlob *)&rinfo->typelib->data[rinfo->offset]; InterfaceTypeBlob *blob = (InterfaceTypeBlob *)&rinfo->typelib->data[rinfo->offset];
if (blob->tag == GI_TYPE_TAG_INTERFACE) 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 * @info: a #GITypeInfo
* *
* Obtain the position of the argument which gives the array length of the type. * 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 * Returns: the array length, or -1 if the type is not an array
*/ */
gint gint
g_type_info_get_array_length (GITypeInfo *info) gi_type_info_get_array_length (GITypeInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
SimpleTypeBlob *type; 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 * @info: a #GITypeInfo
* *
* Obtain the fixed array size of the type. The type tag must be a * 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 * Returns: the size or -1 if it's not an array
*/ */
gint gint
g_type_info_get_array_fixed_size (GITypeInfo *info) gi_type_info_get_array_fixed_size (GITypeInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
SimpleTypeBlob *type; 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 * @info: a #GITypeInfo
* *
* Obtain if the last element of the array is %NULL. The type tag must be a * 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 * Returns: %TRUE if zero terminated
*/ */
gboolean gboolean
g_type_info_is_zero_terminated (GITypeInfo *info) gi_type_info_is_zero_terminated (GITypeInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
SimpleTypeBlob *type; 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 * @info: a #GITypeInfo
* *
* Obtain the array type for this type. See #GIArrayType for a list of * 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 * Returns: the array type or -1
*/ */
GIArrayType GIArrayType
g_type_info_get_array_type (GITypeInfo *info) gi_type_info_get_array_type (GITypeInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
SimpleTypeBlob *type; 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 * @info: a #GITypeInfo
* *
* Obtain the type tag corresponding to the underlying storage type in C for * 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 * Since: 1.66
*/ */
GITypeTag 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) if (type_tag == GI_TYPE_TAG_INTERFACE)
{ {
GIBaseInfo *interface = g_type_info_get_interface (info); GIBaseInfo *interface = gi_type_info_get_interface (info);
GIInfoType info_type = g_base_info_get_type (interface); GIInfoType info_type = gi_base_info_get_type (interface);
if (info_type == GI_INFO_TYPE_ENUM || info_type == GI_INFO_TYPE_FLAGS) if (info_type == GI_INFO_TYPE_ENUM || info_type == GI_INFO_TYPE_FLAGS)
type_tag = g_enum_info_get_storage_type (interface); type_tag = gi_enum_info_get_storage_type (interface);
g_base_info_unref (interface); gi_base_info_unref (interface);
} }
return type_tag; return type_tag;
@ -376,7 +376,7 @@ g_type_info_get_storage_type (GITypeInfo *info)
/** /**
* gi_type_tag_argument_from_hash_pointer: * 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 * @hash_pointer: A pointer, such as a #GHashTable data pointer
* @arg: A #GIArgument to fill in * @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: case GI_TYPE_TAG_DOUBLE:
default: default:
g_critical ("Unsupported storage type for pointer-stuffing: %s", 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; arg->v_pointer = hash_pointer;
} }
} }
/** /**
* g_type_info_argument_from_hash_pointer: * gi_type_info_argument_from_hash_pointer:
* @info: a #GITypeInfo * @info: a #GITypeInfo
* @hash_pointer: A pointer, such as a #GHashTable data pointer * @hash_pointer: A pointer, such as a #GHashTable data pointer
* @arg: A #GIArgument to fill in * @arg: A #GIArgument to fill in
@ -468,18 +468,18 @@ gi_type_tag_argument_from_hash_pointer (GITypeTag storage_type,
* Since: 1.66 * Since: 1.66
*/ */
void void
g_type_info_argument_from_hash_pointer (GITypeInfo *info, gi_type_info_argument_from_hash_pointer (GITypeInfo *info,
gpointer hash_pointer, gpointer hash_pointer,
GIArgument *arg) 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, gi_type_tag_argument_from_hash_pointer (storage_type, hash_pointer,
arg); arg);
} }
/** /**
* gi_type_tag_hash_pointer_from_argument: * 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 * @arg: A #GIArgument with the value to stuff into a pointer
* *
* GLib data structures, such as #GList, #GSList, and #GHashTable, all store * 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: case GI_TYPE_TAG_DOUBLE:
default: default:
g_critical ("Unsupported storage type for pointer-stuffing: %s", 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; return arg->v_pointer;
} }
} }
/** /**
* g_type_info_hash_pointer_from_argument: * gi_type_info_hash_pointer_from_argument:
* @info: a #GITypeInfo * @info: a #GITypeInfo
* @arg: A #GIArgument with the value to stuff into a pointer * @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 * Since: 1.66
*/ */
gpointer gpointer
g_type_info_hash_pointer_from_argument (GITypeInfo *info, gi_type_info_hash_pointer_from_argument (GITypeInfo *info,
GIArgument *arg) 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); return gi_type_tag_hash_pointer_from_argument (storage_type, arg);
} }

View File

@ -39,17 +39,7 @@ G_BEGIN_DECLS
* Checks if @info is a #GITypeInfo. * Checks if @info is a #GITypeInfo.
*/ */
#define GI_IS_TYPE_INFO(info) \ #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)
/**
* 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 * GI_TYPE_TAG_IS_BASIC
@ -96,7 +86,7 @@ G_BEGIN_DECLS
* @tag: a type tag * @tag: a type tag
* *
* Checks if @tag is a container type. That is, a type which may have a nonnull * 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 * Since: 1.72
*/ */
@ -104,48 +94,48 @@ G_BEGIN_DECLS
((tag) >= GI_TYPE_TAG_GLIST && (tag) <= GI_TYPE_TAG_GHASH)) ((tag) >= GI_TYPE_TAG_GLIST && (tag) <= GI_TYPE_TAG_GHASH))
GI_AVAILABLE_IN_ALL 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 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 GI_AVAILABLE_IN_ALL
gboolean g_type_info_is_pointer (GITypeInfo *info); gboolean gi_type_info_is_pointer (GITypeInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GITypeTag g_type_info_get_tag (GITypeInfo *info); GITypeTag gi_type_info_get_tag (GITypeInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GITypeInfo * g_type_info_get_param_type (GITypeInfo *info, GITypeInfo * gi_type_info_get_param_type (GITypeInfo *info,
gint n); gint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIBaseInfo * g_type_info_get_interface (GITypeInfo *info); GIBaseInfo * gi_type_info_get_interface (GITypeInfo *info);
GI_AVAILABLE_IN_ALL 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 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 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 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 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 GI_AVAILABLE_IN_ALL
void g_type_info_argument_from_hash_pointer (GITypeInfo *info, void gi_type_info_argument_from_hash_pointer (GITypeInfo *info,
gpointer hash_pointer, gpointer hash_pointer,
GIArgument *arg); GIArgument *arg);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gpointer g_type_info_hash_pointer_from_argument (GITypeInfo *info, gpointer gi_type_info_hash_pointer_from_argument (GITypeInfo *info,
GIArgument *arg); GIArgument *arg);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
void gi_type_tag_argument_from_hash_pointer (GITypeTag storage_type, void gi_type_tag_argument_from_hash_pointer (GITypeTag storage_type,

View File

@ -146,15 +146,15 @@ Changes since 0.1:
*/ */
/** /**
* G_IR_MAGIC: * GI_IR_MAGIC:
* *
* Identifying prefix for the typelib. This was inspired by XPCOM, * Identifying prefix for the typelib. This was inspired by XPCOM,
* which in turn borrowed from PNG. * 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_INVALID: Should not appear in code
* @BLOB_TYPE_FUNCTION: A #FunctionBlob * @BLOB_TYPE_FUNCTION: A #FunctionBlob
* @BLOB_TYPE_CALLBACK: A #CallbackBlob * @BLOB_TYPE_CALLBACK: A #CallbackBlob
@ -184,14 +184,14 @@ typedef enum {
BLOB_TYPE_CONSTANT, BLOB_TYPE_CONSTANT,
BLOB_TYPE_INVALID_0, BLOB_TYPE_INVALID_0,
BLOB_TYPE_UNION BLOB_TYPE_UNION
} GTypelibBlobType; } GITypelibBlobType;
#if defined (G_CAN_INLINE) && defined (G_ALWAYS_INLINE) #if defined (G_CAN_INLINE) && defined (G_ALWAYS_INLINE)
G_ALWAYS_INLINE G_ALWAYS_INLINE
inline gboolean inline gboolean
_blob_is_registered_type (GTypelibBlobType blob_type) _blob_is_registered_type (GITypelibBlobType blob_type)
{ {
switch (blob_type) switch (blob_type)
{ {
@ -208,7 +208,7 @@ _blob_is_registered_type (GTypelibBlobType blob_type)
} }
#define BLOB_IS_REGISTERED_TYPE(blob) \ #define BLOB_IS_REGISTERED_TYPE(blob) \
_blob_is_registered_type ((GTypelibBlobType) (blob)->blob_type) _blob_is_registered_type ((GITypelibBlobType) (blob)->blob_type)
#else #else
@ -224,7 +224,7 @@ _blob_is_registered_type (GTypelibBlobType blob_type)
/** /**
* Header: * Header:
* @magic: See #G_IR_MAGIC. * @magic: See #GI_IR_MAGIC.
* @major_version: The major version number of the typelib format. Major version * @major_version: The major version number of the typelib format. Major version
* number changes indicate incompatible changes to the tyeplib format. * number changes indicate incompatible changes to the tyeplib format.
* @minor_version: The minor version number of the typelib format. Minor version * @minor_version: The minor version number of the typelib format. Minor version
@ -351,7 +351,7 @@ typedef struct {
/** /**
* DirEntry: * DirEntry:
* @blob_type: A #GTypelibBlobType * @blob_type: A #GITypelibBlobType
* @local: Whether this entry refers to a blob in this typelib. * @local: Whether this entry refers to a blob in this typelib.
* @reserved: Reserved for future use. * @reserved: Reserved for future use.
* @name: The name of the entry. * @name: The name of the entry.
@ -530,7 +530,7 @@ typedef struct {
/** /**
* CommonBlob: * CommonBlob:
* @blob_type: A #GTypelibBlobType * @blob_type: A #GITypelibBlobType
* @deprecated: Whether the blob is deprecated. * @deprecated: Whether the blob is deprecated.
* @reserved: Reserved for future use. * @reserved: Reserved for future use.
* @name: The name of the blob. * @name: The name of the blob.
@ -1256,27 +1256,27 @@ struct _GITypelib {
gboolean open_attempted; gboolean open_attempted;
}; };
DirEntry *g_typelib_get_dir_entry (GITypelib *typelib, DirEntry *gi_typelib_get_dir_entry (GITypelib *typelib,
guint16 index); guint16 index);
DirEntry *g_typelib_get_dir_entry_by_name (GITypelib *typelib, DirEntry *gi_typelib_get_dir_entry_by_name (GITypelib *typelib,
const char *name); const char *name);
DirEntry *g_typelib_get_dir_entry_by_gtype_name (GITypelib *typelib, DirEntry *gi_typelib_get_dir_entry_by_gtype_name (GITypelib *typelib,
const gchar *gtype_name); const gchar *gtype_name);
DirEntry *g_typelib_get_dir_entry_by_error_domain (GITypelib *typelib, DirEntry *gi_typelib_get_dir_entry_by_error_domain (GITypelib *typelib,
GQuark error_domain); GQuark error_domain);
gboolean g_typelib_matches_gtype_name_prefix (GITypelib *typelib, gboolean gi_typelib_matches_gtype_name_prefix (GITypelib *typelib,
const gchar *gtype_name); const gchar *gtype_name);
GI_AVAILABLE_IN_ALL 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 * @typelib: TODO
* @offset: TODO * @offset: TODO
* *
@ -1284,41 +1284,41 @@ void g_typelib_check_sanity (void);
* *
* Returns: TODO * 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: * GITypelibError:
* @G_TYPELIB_ERROR_INVALID: the typelib is invalid * @GI_TYPELIB_ERROR_INVALID: the typelib is invalid
* @G_TYPELIB_ERROR_INVALID_HEADER: the typelib header is invalid * @GI_TYPELIB_ERROR_INVALID_HEADER: the typelib header is invalid
* @G_TYPELIB_ERROR_INVALID_DIRECTORY: the typelib directory is invalid * @GI_TYPELIB_ERROR_INVALID_DIRECTORY: the typelib directory is invalid
* @G_TYPELIB_ERROR_INVALID_ENTRY: a typelib entry is invalid * @GI_TYPELIB_ERROR_INVALID_ENTRY: a typelib entry is invalid
* @G_TYPELIB_ERROR_INVALID_BLOB: a typelib blob is invalid * @GI_TYPELIB_ERROR_INVALID_BLOB: a typelib blob is invalid
* *
* A error set while validating the #GITypelib * A error set while validating the #GITypelib
*/ */
typedef enum typedef enum
{ {
G_TYPELIB_ERROR_INVALID, GI_TYPELIB_ERROR_INVALID,
G_TYPELIB_ERROR_INVALID_HEADER, GI_TYPELIB_ERROR_INVALID_HEADER,
G_TYPELIB_ERROR_INVALID_DIRECTORY, GI_TYPELIB_ERROR_INVALID_DIRECTORY,
G_TYPELIB_ERROR_INVALID_ENTRY, GI_TYPELIB_ERROR_INVALID_ENTRY,
G_TYPELIB_ERROR_INVALID_BLOB GI_TYPELIB_ERROR_INVALID_BLOB
} GITypelibError; } GITypelibError;
/** /**
* G_TYPELIB_ERROR: * GI_TYPELIB_ERROR:
* *
* TODO * 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 GI_AVAILABLE_IN_ALL
gboolean g_typelib_validate (GITypelib *typelib, gboolean gi_typelib_validate (GITypelib *typelib,
GError **error); GError **error);
/* defined in gibaseinfo.c */ /* defined in gibaseinfo.c */
@ -1332,19 +1332,19 @@ AttributeBlob *_attribute_blob_find_first (GIBaseInfo *info,
*/ */
typedef struct _GITypelibHashBuilder GITypelibHashBuilder; 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 G_END_DECLS

File diff suppressed because it is too large Load Diff

View File

@ -50,29 +50,29 @@ G_BEGIN_DECLS
typedef struct _GITypelib GITypelib; typedef struct _GITypelib GITypelib;
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GITypelib * g_typelib_new_from_memory (guint8 *memory, GITypelib * gi_typelib_new_from_memory (guint8 *memory,
gsize len, gsize len,
GError **error); GError **error);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GITypelib * g_typelib_new_from_const_memory (const guint8 *memory, GITypelib * gi_typelib_new_from_const_memory (const guint8 *memory,
gsize len, gsize len,
GError **error); GError **error);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GITypelib * g_typelib_new_from_mapped_file (GMappedFile *mfile, GITypelib * gi_typelib_new_from_mapped_file (GMappedFile *mfile,
GError **error); GError **error);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
void g_typelib_free (GITypelib *typelib); void gi_typelib_free (GITypelib *typelib);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gboolean g_typelib_symbol (GITypelib *typelib, gboolean gi_typelib_symbol (GITypelib *typelib,
const gchar *symbol_name, const gchar *symbol_name,
gpointer *symbol); gpointer *symbol);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
const gchar * g_typelib_get_namespace (GITypelib *typelib); const gchar * gi_typelib_get_namespace (GITypelib *typelib);
G_END_DECLS G_END_DECLS

View File

@ -501,12 +501,4 @@ typedef enum
GI_FUNCTION_THROWS = 1 << 5 GI_FUNCTION_THROWS = 1 << 5
} GIFunctionInfoFlags; } GIFunctionInfoFlags;
#ifndef __GI_SCANNER__
#ifndef __GTK_DOC_IGNORE__
/* backwards compatibility */
typedef GIArgument GArgument;
typedef struct _GITypelib GTypelib;
#endif
#endif
G_END_DECLS G_END_DECLS

View File

@ -44,7 +44,7 @@
*/ */
/** /**
* g_union_info_get_n_fields: * gi_union_info_get_n_fields:
* @info: a #GIUnionInfo * @info: a #GIUnionInfo
* *
* Obtain the number of fields this union has. * Obtain the number of fields this union has.
@ -52,7 +52,7 @@
* Returns: number of fields * Returns: number of fields
*/ */
gint gint
g_union_info_get_n_fields (GIUnionInfo *info) gi_union_info_get_n_fields (GIUnionInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset]; 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 * @info: a #GIUnionInfo
* @n: a field index * @n: a field index
* *
* Obtain the type information for field with specified 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. * when done.
*/ */
GIFieldInfo * GIFieldInfo *
g_union_info_get_field (GIUnionInfo *info, gi_union_info_get_field (GIUnionInfo *info,
gint n) gint n)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
Header *header = (Header *)rinfo->typelib->data; Header *header = (Header *)rinfo->typelib->data;
return (GIFieldInfo *) g_info_new (GI_INFO_TYPE_FIELD, (GIBaseInfo*)info, rinfo->typelib, return (GIFieldInfo *) gi_info_new (GI_INFO_TYPE_FIELD, (GIBaseInfo*)info, rinfo->typelib,
rinfo->offset + header->union_blob_size + rinfo->offset + header->union_blob_size +
n * header->field_blob_size); n * header->field_blob_size);
} }
/** /**
* g_union_info_get_n_methods: * gi_union_info_get_n_methods:
* @info: a #GIUnionInfo * @info: a #GIUnionInfo
* *
* Obtain the number of methods this union has. * Obtain the number of methods this union has.
@ -91,7 +91,7 @@ g_union_info_get_field (GIUnionInfo *info,
* Returns: number of methods * Returns: number of methods
*/ */
gint gint
g_union_info_get_n_methods (GIUnionInfo *info) gi_union_info_get_n_methods (GIUnionInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset]; 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 * @info: a #GIUnionInfo
* @n: a method index * @n: a method index
* *
* Obtain the type information for method with specified 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. * when done.
*/ */
GIFunctionInfo * GIFunctionInfo *
g_union_info_get_method (GIUnionInfo *info, gi_union_info_get_method (GIUnionInfo *info,
gint n) gint n)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset]; 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 offset = rinfo->offset + header->union_blob_size
+ blob->n_fields * header->field_blob_size + blob->n_fields * header->field_blob_size
+ n * header->function_blob_size; + n * header->function_blob_size;
return (GIFunctionInfo *) g_info_new (GI_INFO_TYPE_FUNCTION, (GIBaseInfo*)info, return (GIFunctionInfo *) gi_info_new (GI_INFO_TYPE_FUNCTION, (GIBaseInfo*)info,
rinfo->typelib, offset); rinfo->typelib, offset);
} }
/** /**
* g_union_info_is_discriminated: * gi_union_info_is_discriminated:
* @info: a #GIUnionInfo * @info: a #GIUnionInfo
* *
* Return true if this union contains discriminator field. * 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 * Returns: %TRUE if this is a discriminated union, %FALSE otherwise
*/ */
gboolean gboolean
g_union_info_is_discriminated (GIUnionInfo *info) gi_union_info_is_discriminated (GIUnionInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset]; 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 * @info: a #GIUnionInfo
* *
* Returns offset of the discriminator field in the structure. * 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 * Returns: offset in bytes of the discriminator
*/ */
gint gint
g_union_info_get_discriminator_offset (GIUnionInfo *info) gi_union_info_get_discriminator_offset (GIUnionInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset]; 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 * @info: a #GIUnionInfo
* *
* Obtain the type information of the union discriminator. * 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. * when done.
*/ */
GITypeInfo * GITypeInfo *
g_union_info_get_discriminator_type (GIUnionInfo *info) gi_union_info_get_discriminator_type (GIUnionInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)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 * @info: a #GIUnionInfo
* @n: a union field index * @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 * union field is the active one if discriminator contains this
* constant. * 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. * when done.
*/ */
GIConstantInfo * GIConstantInfo *
g_union_info_get_discriminator (GIUnionInfo *info, gi_union_info_get_discriminator (GIUnionInfo *info,
gint n) gint n)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset]; 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 + blob->n_functions * header->function_blob_size
+ n * header->constant_blob_size; + n * header->constant_blob_size;
return (GIConstantInfo *) g_info_new (GI_INFO_TYPE_CONSTANT, (GIBaseInfo*)info, return (GIConstantInfo *) gi_info_new (GI_INFO_TYPE_CONSTANT, (GIBaseInfo*)info,
rinfo->typelib, offset); rinfo->typelib, offset);
} }
return NULL; return NULL;
} }
/** /**
* g_union_info_find_method: * gi_union_info_find_method:
* @info: a #GIUnionInfo * @info: a #GIUnionInfo
* @name: a method name * @name: a method name
* *
* Obtain the type information for method named @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. * when done.
*/ */
GIFunctionInfo * GIFunctionInfo *
g_union_info_find_method (GIUnionInfo *info, gi_union_info_find_method (GIUnionInfo *info,
const gchar *name) const gchar *name)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -234,11 +234,11 @@ g_union_info_find_method (GIUnionInfo *info,
offset = rinfo->offset + header->union_blob_size offset = rinfo->offset + header->union_blob_size
+ blob->n_fields * header->field_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 * @info: a #GIUnionInfo
* *
* Obtain the total size of the union. * 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 * Returns: size of the union in bytes
*/ */
gsize gsize
g_union_info_get_size (GIUnionInfo *info) gi_union_info_get_size (GIUnionInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset]; 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 * @info: a #GIUnionInfo
* *
* Obtain the required alignment of the union. * Obtain the required alignment of the union.
@ -263,7 +263,7 @@ g_union_info_get_size (GIUnionInfo *info)
* Returns: required alignment in bytes * Returns: required alignment in bytes
*/ */
gsize gsize
g_union_info_get_alignment (GIUnionInfo *info) gi_union_info_get_alignment (GIUnionInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
UnionBlob *blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset]; 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 * @info: a union information blob
* *
* Retrieves the name of the copy function for @info, if any is set. * 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 * Since: 1.76
*/ */
const char * const char *
g_union_info_get_copy_function (GIUnionInfo *info) gi_union_info_get_copy_function (GIUnionInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
UnionBlob *blob; UnionBlob *blob;
@ -293,13 +293,13 @@ g_union_info_get_copy_function (GIUnionInfo *info)
blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset]; blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset];
if (blob->copy_func) 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; return NULL;
} }
/** /**
* g_union_info_get_free_function: * gi_union_info_get_free_function:
* @info: a union information blob * @info: a union information blob
* *
* Retrieves the name of the free function for @info, if any is set. * 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 * Since: 1.76
*/ */
const char * const char *
g_union_info_get_free_function (GIUnionInfo *info) gi_union_info_get_free_function (GIUnionInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
UnionBlob *blob; UnionBlob *blob;
@ -320,7 +320,7 @@ g_union_info_get_free_function (GIUnionInfo *info)
blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset]; blob = (UnionBlob *)&rinfo->typelib->data[rinfo->offset];
if (blob->free_func) 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; return NULL;
} }

View File

@ -39,49 +39,49 @@ G_BEGIN_DECLS
* Checks if @info is a #GIUnionInfo. * Checks if @info is a #GIUnionInfo.
*/ */
#define GI_IS_UNION_INFO(info) \ #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 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 GI_AVAILABLE_IN_ALL
GIFieldInfo * g_union_info_get_field (GIUnionInfo *info, GIFieldInfo * gi_union_info_get_field (GIUnionInfo *info,
gint n); gint n);
GI_AVAILABLE_IN_ALL 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 GI_AVAILABLE_IN_ALL
GIFunctionInfo * g_union_info_get_method (GIUnionInfo *info, GIFunctionInfo * gi_union_info_get_method (GIUnionInfo *info,
gint n); gint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gboolean g_union_info_is_discriminated (GIUnionInfo *info); gboolean gi_union_info_is_discriminated (GIUnionInfo *info);
GI_AVAILABLE_IN_ALL 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 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 GI_AVAILABLE_IN_ALL
GIConstantInfo * g_union_info_get_discriminator (GIUnionInfo *info, GIConstantInfo * gi_union_info_get_discriminator (GIUnionInfo *info,
gint n); gint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIFunctionInfo * g_union_info_find_method (GIUnionInfo *info, GIFunctionInfo * gi_union_info_find_method (GIUnionInfo *info,
const gchar *name); const gchar *name);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gsize g_union_info_get_size (GIUnionInfo *info); gsize gi_union_info_get_size (GIUnionInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gsize g_union_info_get_alignment (GIUnionInfo *info); gsize gi_union_info_get_alignment (GIUnionInfo *info);
GI_AVAILABLE_IN_ALL 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 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 G_END_DECLS

View File

@ -45,10 +45,10 @@
*/ */
GIVFuncInfo * GIVFuncInfo *
_g_base_info_find_vfunc (GIRealInfo *rinfo, gi_base_info_find_vfunc (GIRealInfo *rinfo,
guint32 offset, guint32 offset,
gint n_vfuncs, gint n_vfuncs,
const gchar *name) const gchar *name)
{ {
/* FIXME hash */ /* FIXME hash */
Header *header = (Header *)rinfo->typelib->data; 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]; const gchar *fname = (const gchar *)&rinfo->typelib->data[fblob->name];
if (strcmp (name, fname) == 0) 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); rinfo->typelib, offset);
offset += header->vfunc_blob_size; 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 * @info: a #GIVFuncInfo
* *
* Obtain the flags for this virtual function info. See #GIVFuncInfoFlags for * 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 * Returns: the flags
*/ */
GIVFuncInfoFlags GIVFuncInfoFlags
g_vfunc_info_get_flags (GIVFuncInfo *info) gi_vfunc_info_get_flags (GIVFuncInfo *info)
{ {
GIVFuncInfoFlags flags; GIVFuncInfoFlags flags;
GIRealInfo *rinfo = (GIRealInfo *)info; 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 * @info: a #GIVFuncInfo
* *
* Obtain the offset of the function pointer in the class struct. The value * 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 * Returns: the struct offset or 0xFFFF if it's unknown
*/ */
gint gint
g_vfunc_info_get_offset (GIVFuncInfo *info) gi_vfunc_info_get_offset (GIVFuncInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
VFuncBlob *blob; 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 * @info: a #GIVFuncInfo
* *
* Obtain the signal for the virtual function if one is set. * 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 * Returns: (transfer full): the signal or %NULL if none set
*/ */
GISignalInfo * GISignalInfo *
g_vfunc_info_get_signal (GIVFuncInfo *info) gi_vfunc_info_get_signal (GIVFuncInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
VFuncBlob *blob; VFuncBlob *blob;
@ -152,13 +152,13 @@ g_vfunc_info_get_signal (GIVFuncInfo *info)
blob = (VFuncBlob *)&rinfo->typelib->data[rinfo->offset]; blob = (VFuncBlob *)&rinfo->typelib->data[rinfo->offset];
if (blob->class_closure) 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; return NULL;
} }
/** /**
* g_vfunc_info_get_invoker: * gi_vfunc_info_get_invoker:
* @info: a #GIVFuncInfo * @info: a #GIVFuncInfo
* *
* If this virtual function has an associated invoker method, this * 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. * Not all virtuals will have invokers.
* *
* Returns: (transfer full): the #GIVFuncInfo or %NULL. Free it with * Returns: (transfer full): the #GIVFuncInfo or %NULL. Free it with
* g_base_info_unref() when done. * gi_base_info_unref() when done.
*/ */
GIFunctionInfo * GIFunctionInfo *
g_vfunc_info_get_invoker (GIVFuncInfo *info) gi_vfunc_info_get_invoker (GIVFuncInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
VFuncBlob *blob; VFuncBlob *blob;
@ -187,17 +187,17 @@ g_vfunc_info_get_invoker (GIVFuncInfo *info)
return NULL; return NULL;
container = rinfo->container; 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) 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) 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 else
g_assert_not_reached (); g_assert_not_reached ();
} }
/** /**
* g_vfunc_info_get_address: * gi_vfunc_info_get_address:
* @info: a #GIVFuncInfo * @info: a #GIVFuncInfo
* @implementor_gtype: #GType implementing this virtual function * @implementor_gtype: #GType implementing this virtual function
* @error: return location for a #GError * @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 * Returns: address to a function or %NULL if an error happened
*/ */
gpointer gpointer
g_vfunc_info_get_address (GIVFuncInfo *vfunc_info, gi_vfunc_info_get_address (GIVFuncInfo *vfunc_info,
GType implementor_gtype, GType implementor_gtype,
GError **error) GError **error)
{ {
GIBaseInfo *container_info; GIBaseInfo *container_info;
GIInterfaceInfo *interface_info; GIInterfaceInfo *interface_info;
@ -221,28 +221,28 @@ g_vfunc_info_get_address (GIVFuncInfo *vfunc_info,
gpointer implementor_class, implementor_vtable; gpointer implementor_class, implementor_vtable;
gpointer func = NULL; gpointer func = NULL;
container_info = g_base_info_get_container (vfunc_info); container_info = gi_base_info_get_container (vfunc_info);
if (g_base_info_get_type (container_info) == GI_INFO_TYPE_OBJECT) if (gi_base_info_get_type (container_info) == GI_INFO_TYPE_OBJECT)
{ {
object_info = (GIObjectInfo*) container_info; object_info = (GIObjectInfo*) container_info;
interface_info = NULL; interface_info = NULL;
struct_info = g_object_info_get_class_struct (object_info); struct_info = gi_object_info_get_class_struct (object_info);
} }
else else
{ {
interface_info = (GIInterfaceInfo*) container_info; interface_info = (GIInterfaceInfo*) container_info;
object_info = NULL; 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++) 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), if (strcmp (gi_base_info_get_name ( (GIBaseInfo*) field_info),
g_base_info_get_name ( (GIBaseInfo*) vfunc_info)) != 0) { gi_base_info_get_name ( (GIBaseInfo*) vfunc_info)) != 0) {
g_base_info_unref (field_info); gi_base_info_unref (field_info);
field_info = NULL; field_info = NULL;
continue; continue;
} }
@ -253,8 +253,8 @@ g_vfunc_info_get_address (GIVFuncInfo *vfunc_info,
if (field_info == NULL) if (field_info == NULL)
{ {
g_set_error (error, g_set_error (error,
G_INVOKE_ERROR, GI_INVOKE_ERROR,
G_INVOKE_ERROR_SYMBOL_NOT_FOUND, GI_INVOKE_ERROR_SYMBOL_NOT_FOUND,
"Couldn't find struct field for this vfunc"); "Couldn't find struct field for this vfunc");
goto out; goto out;
} }
@ -269,34 +269,34 @@ g_vfunc_info_get_address (GIVFuncInfo *vfunc_info,
{ {
GType interface_type; 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); 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); func = *(gpointer*) G_STRUCT_MEMBER_P (implementor_vtable, offset);
g_type_class_unref (implementor_class); g_type_class_unref (implementor_class);
g_base_info_unref (field_info); gi_base_info_unref (field_info);
if (func == NULL) if (func == NULL)
{ {
g_set_error (error, g_set_error (error,
G_INVOKE_ERROR, GI_INVOKE_ERROR,
G_INVOKE_ERROR_SYMBOL_NOT_FOUND, GI_INVOKE_ERROR_SYMBOL_NOT_FOUND,
"Class %s doesn't implement %s", "Class %s doesn't implement %s",
g_type_name (implementor_gtype), g_type_name (implementor_gtype),
g_base_info_get_name ( (GIBaseInfo*) vfunc_info)); gi_base_info_get_name ( (GIBaseInfo*) vfunc_info));
goto out; goto out;
} }
out: out:
g_base_info_unref ((GIBaseInfo*) struct_info); gi_base_info_unref ((GIBaseInfo*) struct_info);
return func; return func;
} }
/** /**
* g_vfunc_info_invoke: (skip) * gi_vfunc_info_invoke: (skip)
* @info: a #GIVFuncInfo describing the virtual function to invoke * @info: a #GIVFuncInfo describing the virtual function to invoke
* @implementor: #GType of the type that implements this virtual function * @implementor: #GType of the type that implements this virtual function
* @in_args: (array length=n_in_args): an array of #GIArgument<!-- -->s, one for each in * @in_args: (array length=n_in_args): an array of #GIArgument<!-- -->s, one for each in
@ -320,29 +320,29 @@ g_vfunc_info_get_address (GIVFuncInfo *vfunc_info,
* error occurred. * error occurred.
*/ */
gboolean gboolean
g_vfunc_info_invoke (GIVFuncInfo *info, gi_vfunc_info_invoke (GIVFuncInfo *info,
GType implementor, GType implementor,
const GIArgument *in_args, const GIArgument *in_args,
int n_in_args, int n_in_args,
const GIArgument *out_args, const GIArgument *out_args,
int n_out_args, int n_out_args,
GIArgument *return_value, GIArgument *return_value,
GError **error) GError **error)
{ {
gpointer func; gpointer func;
func = g_vfunc_info_get_address (info, implementor, error); func = gi_vfunc_info_get_address (info, implementor, error);
if (*error != NULL) if (*error != NULL)
return FALSE; return FALSE;
return g_callable_info_invoke ((GICallableInfo*) info, return gi_callable_info_invoke ((GICallableInfo*) info,
func, func,
in_args, in_args,
n_in_args, n_in_args,
out_args, out_args,
n_out_args, n_out_args,
return_value, return_value,
TRUE, TRUE,
FALSE, FALSE,
error); error);
} }

View File

@ -39,33 +39,33 @@ G_BEGIN_DECLS
* Checks if @info is a #GIVfuncInfo. * Checks if @info is a #GIVfuncInfo.
*/ */
#define GI_IS_VFUNC_INFO(info) \ #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 GI_AVAILABLE_IN_ALL
GIVFuncInfoFlags g_vfunc_info_get_flags (GIVFuncInfo *info); GIVFuncInfoFlags gi_vfunc_info_get_flags (GIVFuncInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint g_vfunc_info_get_offset (GIVFuncInfo *info); gint gi_vfunc_info_get_offset (GIVFuncInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GISignalInfo * g_vfunc_info_get_signal (GIVFuncInfo *info); GISignalInfo * gi_vfunc_info_get_signal (GIVFuncInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIFunctionInfo * g_vfunc_info_get_invoker (GIVFuncInfo *info); GIFunctionInfo * gi_vfunc_info_get_invoker (GIVFuncInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gpointer g_vfunc_info_get_address (GIVFuncInfo *info, gpointer gi_vfunc_info_get_address (GIVFuncInfo *info,
GType implementor_gtype, GType implementor_gtype,
GError **error); GError **error);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gboolean g_vfunc_info_invoke (GIVFuncInfo *info, gboolean gi_vfunc_info_invoke (GIVFuncInfo *info,
GType implementor, GType implementor,
const GIArgument *in_args, const GIArgument *in_args,
int n_in_args, int n_in_args,
const GIArgument *out_args, const GIArgument *out_args,
int n_out_args, int n_out_args,
GIArgument *return_value, GIArgument *return_value,
GError **error); GError **error);
G_END_DECLS G_END_DECLS

View File

@ -31,28 +31,28 @@ test_build_retrieve (void)
guint32 bufsize; guint32 bufsize;
guint8* buf; 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, "Action", 0);
_gi_typelib_hash_builder_add_string (builder, "ZLibDecompressor", 42); 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, "VolumeMonitor", 9);
_gi_typelib_hash_builder_add_string (builder, "FileMonitorFlags", 31); 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 (); 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); 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, "Action", 4) == 0);
g_assert (_gi_typelib_hash_search (buf, "ZLibDecompressor", 4) == 42); 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, "VolumeMonitor", 4) == 9);
g_assert (_gi_typelib_hash_search (buf, "FileMonitorFlags", 4) == 31); g_assert (gi_typelib_hash_search (buf, "FileMonitorFlags", 4) == 31);
} }
int int

View File

@ -64,7 +64,7 @@ struct _GITypelibHashBuilder {
}; };
GITypelibHashBuilder * GITypelibHashBuilder *
_gi_typelib_hash_builder_new (void) gi_typelib_hash_builder_new (void)
{ {
GITypelibHashBuilder *builder = g_slice_new0 (GITypelibHashBuilder); GITypelibHashBuilder *builder = g_slice_new0 (GITypelibHashBuilder);
builder->c = NULL; builder->c = NULL;
@ -73,16 +73,16 @@ _gi_typelib_hash_builder_new (void)
} }
void void
_gi_typelib_hash_builder_add_string (GITypelibHashBuilder *builder, gi_typelib_hash_builder_add_string (GITypelibHashBuilder *builder,
const char *str, const char *str,
guint16 value) guint16 value)
{ {
g_return_if_fail (builder->c == NULL); g_return_if_fail (builder->c == NULL);
g_hash_table_insert (builder->strings, g_strdup (str), GUINT_TO_POINTER ((guint) value)); g_hash_table_insert (builder->strings, g_strdup (str), GUINT_TO_POINTER ((guint) value));
} }
gboolean gboolean
_gi_typelib_hash_builder_prepare (GITypelibHashBuilder *builder) gi_typelib_hash_builder_prepare (GITypelibHashBuilder *builder)
{ {
char **strs; char **strs;
GHashTableIter hashiter; GHashTableIter hashiter;
@ -137,7 +137,7 @@ _gi_typelib_hash_builder_prepare (GITypelibHashBuilder *builder)
} }
guint32 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 != NULL, 0);
g_return_val_if_fail (builder->prepared, 0); g_return_val_if_fail (builder->prepared, 0);
@ -147,7 +147,7 @@ _gi_typelib_hash_builder_get_buffer_size (GITypelibHashBuilder *builder)
} }
void 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; guint16 *table;
GHashTableIter hashiter; GHashTableIter hashiter;
@ -185,7 +185,7 @@ _gi_typelib_hash_builder_pack (GITypelibHashBuilder *builder, guint8* mem, guint
} }
void void
_gi_typelib_hash_builder_destroy (GITypelibHashBuilder *builder) gi_typelib_hash_builder_destroy (GITypelibHashBuilder *builder)
{ {
if (builder->c) if (builder->c)
{ {
@ -197,7 +197,7 @@ _gi_typelib_hash_builder_destroy (GITypelibHashBuilder *builder)
} }
guint16 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; guint32 *mph;
guint16 *table; guint16 *table;