girepository: Rename symbols to the GI namespace

Rather than a mix of structs being in `GI` and their methods being in
`g_`.

We’ve chosen not to use the `g_` namespace because a number of the
libgirepository class names are quite generic, so we’d end up with
confusing symbols like `GScopeType` and `GArgument`.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3155
This commit is contained in:
Philip Withnall 2023-11-08 14:17:52 +00:00
parent f4db8af9de
commit b32da06a7c
50 changed files with 2960 additions and 2961 deletions

View File

@ -526,7 +526,7 @@ dump_error_quark (GQuark quark, const char *symbol, GOutputStream *out)
}
/**
* g_irepository_dump:
* gi_repository_dump:
* @arg: Comma-separated pair of input and output filenames
* @error: a %GError
*
@ -549,7 +549,7 @@ static gboolean
dump_irepository (const char *arg, GError **error)
#else
gboolean
g_irepository_dump (const char *arg, GError **error)
gi_repository_dump (const char *arg, GError **error)
#endif
{
GHashTable *output_types;

View File

@ -44,7 +44,7 @@
*/
/**
* g_arg_info_get_direction:
* gi_arg_info_get_direction:
* @info: a #GIArgInfo
*
* Obtain the direction of the argument. Check #GIDirection for possible
@ -53,7 +53,7 @@
* Returns: the direction
*/
GIDirection
g_arg_info_get_direction (GIArgInfo *info)
gi_arg_info_get_direction (GIArgInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ArgBlob *blob;
@ -72,7 +72,7 @@ g_arg_info_get_direction (GIArgInfo *info)
}
/**
* g_arg_info_is_return_value:
* gi_arg_info_is_return_value:
* @info: a #GIArgInfo
*
* Obtain if the argument is a return value. It can either be a
@ -81,7 +81,7 @@ g_arg_info_get_direction (GIArgInfo *info)
* Returns: %TRUE if it is a return value
*/
gboolean
g_arg_info_is_return_value (GIArgInfo *info)
gi_arg_info_is_return_value (GIArgInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ArgBlob *blob;
@ -95,7 +95,7 @@ g_arg_info_is_return_value (GIArgInfo *info)
}
/**
* g_arg_info_is_caller_allocates:
* gi_arg_info_is_caller_allocates:
* @info: a #GIArgInfo
*
* Obtain if the argument is a pointer to a struct or object that will
@ -106,7 +106,7 @@ g_arg_info_is_return_value (GIArgInfo *info)
* Returns: %TRUE if caller is required to have allocated the argument
*/
gboolean
g_arg_info_is_caller_allocates (GIArgInfo *info)
gi_arg_info_is_caller_allocates (GIArgInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ArgBlob *blob;
@ -120,7 +120,7 @@ g_arg_info_is_caller_allocates (GIArgInfo *info)
}
/**
* g_arg_info_is_optional:
* gi_arg_info_is_optional:
* @info: a #GIArgInfo
*
* Obtain if the argument is optional. For 'out' arguments this means
@ -129,7 +129,7 @@ g_arg_info_is_caller_allocates (GIArgInfo *info)
* Returns: %TRUE if it is an optional argument
*/
gboolean
g_arg_info_is_optional (GIArgInfo *info)
gi_arg_info_is_optional (GIArgInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ArgBlob *blob;
@ -143,19 +143,19 @@ g_arg_info_is_optional (GIArgInfo *info)
}
/**
* g_arg_info_may_be_null:
* gi_arg_info_may_be_null:
* @info: a #GIArgInfo
*
* Obtain if the type of the argument includes the possibility of %NULL.
* For 'in' values this means that %NULL is a valid value. For 'out'
* values, this means that %NULL may be returned.
*
* See also g_arg_info_is_optional().
* See also gi_arg_info_is_optional().
*
* Returns: %TRUE if the value may be %NULL
*/
gboolean
g_arg_info_may_be_null (GIArgInfo *info)
gi_arg_info_may_be_null (GIArgInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ArgBlob *blob;
@ -169,7 +169,7 @@ g_arg_info_may_be_null (GIArgInfo *info)
}
/**
* g_arg_info_is_skip:
* gi_arg_info_is_skip:
* @info: a #GIArgInfo
*
* Obtain if an argument is only useful in C.
@ -178,7 +178,7 @@ g_arg_info_may_be_null (GIArgInfo *info)
* Since: 1.30
*/
gboolean
g_arg_info_is_skip (GIArgInfo *info)
gi_arg_info_is_skip (GIArgInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ArgBlob *blob;
@ -192,7 +192,7 @@ g_arg_info_is_skip (GIArgInfo *info)
}
/**
* g_arg_info_get_ownership_transfer:
* gi_arg_info_get_ownership_transfer:
* @info: a #GIArgInfo
*
* Obtain the ownership transfer for this argument.
@ -201,7 +201,7 @@ g_arg_info_is_skip (GIArgInfo *info)
* Returns: the transfer
*/
GITransfer
g_arg_info_get_ownership_transfer (GIArgInfo *info)
gi_arg_info_get_ownership_transfer (GIArgInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ArgBlob *blob;
@ -220,7 +220,7 @@ g_arg_info_get_ownership_transfer (GIArgInfo *info)
}
/**
* g_arg_info_get_scope:
* gi_arg_info_get_scope:
* @info: a #GIArgInfo
*
* Obtain the scope type for this argument. The scope type explains
@ -231,7 +231,7 @@ g_arg_info_get_ownership_transfer (GIArgInfo *info)
* Returns: the scope type
*/
GIScopeType
g_arg_info_get_scope (GIArgInfo *info)
gi_arg_info_get_scope (GIArgInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ArgBlob *blob;
@ -245,7 +245,7 @@ g_arg_info_get_scope (GIArgInfo *info)
}
/**
* g_arg_info_get_closure:
* gi_arg_info_get_closure:
* @info: a #GIArgInfo
*
* Obtain the index of the user data argument. This is only valid
@ -254,7 +254,7 @@ g_arg_info_get_scope (GIArgInfo *info)
* Returns: index of the user data argument or -1 if there is none
*/
gint
g_arg_info_get_closure (GIArgInfo *info)
gi_arg_info_get_closure (GIArgInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ArgBlob *blob;
@ -268,7 +268,7 @@ g_arg_info_get_closure (GIArgInfo *info)
}
/**
* g_arg_info_get_destroy:
* gi_arg_info_get_destroy:
* @info: a #GIArgInfo
*
* Obtains the index of the #GDestroyNotify argument. This is only valid
@ -277,7 +277,7 @@ g_arg_info_get_closure (GIArgInfo *info)
* Returns: index of the #GDestroyNotify argument or -1 if there is none
*/
gint
g_arg_info_get_destroy (GIArgInfo *info)
gi_arg_info_get_destroy (GIArgInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ArgBlob *blob;
@ -291,45 +291,45 @@ g_arg_info_get_destroy (GIArgInfo *info)
}
/**
* g_arg_info_get_type:
* gi_arg_info_get_type:
* @info: a #GIArgInfo
*
* Obtain the type information for @info.
*
* Returns: (transfer full): the #GITypeInfo holding the type
* information for @info, free it with g_base_info_unref()
* information for @info, free it with gi_base_info_unref()
* when done.
*/
GITypeInfo *
g_arg_info_get_type (GIArgInfo *info)
gi_arg_info_get_type (GIArgInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
g_return_val_if_fail (info != NULL, NULL);
g_return_val_if_fail (GI_IS_ARG_INFO (info), NULL);
return _g_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + G_STRUCT_OFFSET (ArgBlob, arg_type));
return _gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + G_STRUCT_OFFSET (ArgBlob, arg_type));
}
/**
* g_arg_info_load_type:
* gi_arg_info_load_type:
* @info: a #GIArgInfo
* @type: (out caller-allocates): Initialized with information about type of @info
*
* Obtain information about a the type of given argument @info; this
* function is a variant of g_arg_info_get_type() designed for stack
* function is a variant of gi_arg_info_get_type() designed for stack
* allocation.
*
* The initialized @type must not be referenced after @info is deallocated.
*/
void
g_arg_info_load_type (GIArgInfo *info,
GITypeInfo *type)
gi_arg_info_load_type (GIArgInfo *info,
GITypeInfo *type)
{
GIRealInfo *rinfo = (GIRealInfo*) info;
g_return_if_fail (info != NULL);
g_return_if_fail (GI_IS_ARG_INFO (info));
_g_type_info_init (type, (GIBaseInfo*)info, rinfo->typelib, rinfo->offset + G_STRUCT_OFFSET (ArgBlob, arg_type));
_gi_type_info_init (type, (GIBaseInfo*)info, rinfo->typelib, rinfo->offset + G_STRUCT_OFFSET (ArgBlob, arg_type));
}

View File

@ -39,43 +39,43 @@ G_BEGIN_DECLS
* Checks if @info is a GIArgInfo.
*/
#define GI_IS_ARG_INFO(info) \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_ARG)
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_ARG)
GI_AVAILABLE_IN_ALL
GIDirection g_arg_info_get_direction (GIArgInfo *info);
GIDirection gi_arg_info_get_direction (GIArgInfo *info);
GI_AVAILABLE_IN_ALL
gboolean g_arg_info_is_return_value (GIArgInfo *info);
gboolean gi_arg_info_is_return_value (GIArgInfo *info);
GI_AVAILABLE_IN_ALL
gboolean g_arg_info_is_optional (GIArgInfo *info);
gboolean gi_arg_info_is_optional (GIArgInfo *info);
GI_AVAILABLE_IN_ALL
gboolean g_arg_info_is_caller_allocates (GIArgInfo *info);
gboolean gi_arg_info_is_caller_allocates (GIArgInfo *info);
GI_AVAILABLE_IN_ALL
gboolean g_arg_info_may_be_null (GIArgInfo *info);
gboolean gi_arg_info_may_be_null (GIArgInfo *info);
GI_AVAILABLE_IN_ALL
gboolean g_arg_info_is_skip (GIArgInfo *info);
gboolean gi_arg_info_is_skip (GIArgInfo *info);
GI_AVAILABLE_IN_ALL
GITransfer g_arg_info_get_ownership_transfer (GIArgInfo *info);
GITransfer gi_arg_info_get_ownership_transfer (GIArgInfo *info);
GI_AVAILABLE_IN_ALL
GIScopeType g_arg_info_get_scope (GIArgInfo *info);
GIScopeType gi_arg_info_get_scope (GIArgInfo *info);
GI_AVAILABLE_IN_ALL
gint g_arg_info_get_closure (GIArgInfo *info);
gint gi_arg_info_get_closure (GIArgInfo *info);
GI_AVAILABLE_IN_ALL
gint g_arg_info_get_destroy (GIArgInfo *info);
gint gi_arg_info_get_destroy (GIArgInfo *info);
GI_AVAILABLE_IN_ALL
GITypeInfo * g_arg_info_get_type (GIArgInfo *info);
GITypeInfo * gi_arg_info_get_type (GIArgInfo *info);
GI_AVAILABLE_IN_ALL
void g_arg_info_load_type (GIArgInfo *info,
GITypeInfo *type);
void gi_arg_info_load_type (GIArgInfo *info,
GITypeInfo *type);
G_END_DECLS

View File

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

View File

@ -48,54 +48,54 @@ typedef struct {
gpointer data4;
} GIAttributeIter;
#define GI_TYPE_BASE_INFO (g_base_info_gtype_get_type ())
#define GI_TYPE_BASE_INFO (gi_base_info_gtype_get_type ())
GI_AVAILABLE_IN_ALL
GType g_base_info_gtype_get_type (void) G_GNUC_CONST;
GType gi_base_info_gtype_get_type (void) G_GNUC_CONST;
GI_AVAILABLE_IN_ALL
GIBaseInfo * g_base_info_ref (GIBaseInfo *info);
GIBaseInfo * gi_base_info_ref (GIBaseInfo *info);
GI_AVAILABLE_IN_ALL
void g_base_info_unref (GIBaseInfo *info);
void gi_base_info_unref (GIBaseInfo *info);
GI_AVAILABLE_IN_ALL
GIInfoType g_base_info_get_type (GIBaseInfo *info);
GIInfoType gi_base_info_get_type (GIBaseInfo *info);
GI_AVAILABLE_IN_ALL
const gchar * g_base_info_get_name (GIBaseInfo *info);
const gchar * gi_base_info_get_name (GIBaseInfo *info);
GI_AVAILABLE_IN_ALL
const gchar * g_base_info_get_namespace (GIBaseInfo *info);
const gchar * gi_base_info_get_namespace (GIBaseInfo *info);
GI_AVAILABLE_IN_ALL
gboolean g_base_info_is_deprecated (GIBaseInfo *info);
gboolean gi_base_info_is_deprecated (GIBaseInfo *info);
GI_AVAILABLE_IN_ALL
const gchar * g_base_info_get_attribute (GIBaseInfo *info,
const gchar *name);
const gchar * gi_base_info_get_attribute (GIBaseInfo *info,
const gchar *name);
GI_AVAILABLE_IN_ALL
gboolean g_base_info_iterate_attributes (GIBaseInfo *info,
GIAttributeIter *iterator,
char **name,
char **value);
gboolean gi_base_info_iterate_attributes (GIBaseInfo *info,
GIAttributeIter *iterator,
char **name,
char **value);
GI_AVAILABLE_IN_ALL
GIBaseInfo * g_base_info_get_container (GIBaseInfo *info);
GIBaseInfo * gi_base_info_get_container (GIBaseInfo *info);
GI_AVAILABLE_IN_ALL
GITypelib * g_base_info_get_typelib (GIBaseInfo *info);
GITypelib * gi_base_info_get_typelib (GIBaseInfo *info);
GI_AVAILABLE_IN_ALL
gboolean g_base_info_equal (GIBaseInfo *info1,
GIBaseInfo *info2);
gboolean gi_base_info_equal (GIBaseInfo *info1,
GIBaseInfo *info2);
GI_AVAILABLE_IN_ALL
GIBaseInfo * g_info_new (GIInfoType type,
GIBaseInfo *container,
GITypelib *typelib,
guint32 offset);
GIBaseInfo * gi_info_new (GIInfoType type,
GIBaseInfo *container,
GITypelib *typelib,
guint32 offset);
G_END_DECLS

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

View File

@ -39,69 +39,69 @@ G_BEGIN_DECLS
* Checks if @info is a #GICallableInfo or derived from it.
*/
#define GI_IS_CALLABLE_INFO(info) \
((g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_FUNCTION) || \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_CALLBACK) || \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_SIGNAL) || \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_VFUNC))
((gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_FUNCTION) || \
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_CALLBACK) || \
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_SIGNAL) || \
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_VFUNC))
GI_AVAILABLE_IN_ALL
gboolean g_callable_info_is_method (GICallableInfo *info);
gboolean gi_callable_info_is_method (GICallableInfo *info);
GI_AVAILABLE_IN_ALL
gboolean g_callable_info_can_throw_gerror (GICallableInfo *info);
gboolean gi_callable_info_can_throw_gerror (GICallableInfo *info);
GI_AVAILABLE_IN_ALL
GITypeInfo * g_callable_info_get_return_type (GICallableInfo *info);
GITypeInfo * gi_callable_info_get_return_type (GICallableInfo *info);
GI_AVAILABLE_IN_ALL
void g_callable_info_load_return_type (GICallableInfo *info,
GITypeInfo *type);
void gi_callable_info_load_return_type (GICallableInfo *info,
GITypeInfo *type);
GI_AVAILABLE_IN_ALL
const gchar * g_callable_info_get_return_attribute (GICallableInfo *info,
const gchar *name);
const gchar * gi_callable_info_get_return_attribute (GICallableInfo *info,
const gchar *name);
GI_AVAILABLE_IN_ALL
gboolean g_callable_info_iterate_return_attributes (GICallableInfo *info,
GIAttributeIter *iterator,
char **name,
char **value);
gboolean gi_callable_info_iterate_return_attributes (GICallableInfo *info,
GIAttributeIter *iterator,
char **name,
char **value);
GI_AVAILABLE_IN_ALL
GITransfer g_callable_info_get_caller_owns (GICallableInfo *info);
GITransfer gi_callable_info_get_caller_owns (GICallableInfo *info);
GI_AVAILABLE_IN_ALL
gboolean g_callable_info_may_return_null (GICallableInfo *info);
gboolean gi_callable_info_may_return_null (GICallableInfo *info);
GI_AVAILABLE_IN_ALL
gboolean g_callable_info_skip_return (GICallableInfo *info);
gboolean gi_callable_info_skip_return (GICallableInfo *info);
GI_AVAILABLE_IN_ALL
gint g_callable_info_get_n_args (GICallableInfo *info);
gint gi_callable_info_get_n_args (GICallableInfo *info);
GI_AVAILABLE_IN_ALL
GIArgInfo * g_callable_info_get_arg (GICallableInfo *info,
gint n);
GIArgInfo * gi_callable_info_get_arg (GICallableInfo *info,
gint n);
GI_AVAILABLE_IN_ALL
void g_callable_info_load_arg (GICallableInfo *info,
gint n,
GIArgInfo *arg);
void gi_callable_info_load_arg (GICallableInfo *info,
gint n,
GIArgInfo *arg);
GI_AVAILABLE_IN_ALL
gboolean g_callable_info_invoke (GICallableInfo *info,
gpointer function,
const GIArgument *in_args,
int n_in_args,
const GIArgument *out_args,
int n_out_args,
GIArgument *return_value,
gboolean is_method,
gboolean throws,
GError **error);
gboolean gi_callable_info_invoke (GICallableInfo *info,
gpointer function,
const GIArgument *in_args,
int n_in_args,
const GIArgument *out_args,
int n_out_args,
GIArgument *return_value,
gboolean is_method,
gboolean throws,
GError **error);
GI_AVAILABLE_IN_ALL
GITransfer g_callable_info_get_instance_ownership_transfer (GICallableInfo *info);
GITransfer gi_callable_info_get_instance_ownership_transfer (GICallableInfo *info);
G_END_DECLS

View File

@ -40,46 +40,46 @@
* GIConstantInfo represents a constant.
*
* A constant has a type associated which can be obtained by calling
* g_constant_info_get_type() and a value, which can be obtained by
* calling g_constant_info_get_value().
* gi_constant_info_get_type() and a value, which can be obtained by
* calling gi_constant_info_get_value().
*/
/**
* g_constant_info_get_type:
* gi_constant_info_get_type:
* @info: a #GIConstantInfo
*
* Obtain the type of the constant as a #GITypeInfo.
*
* Returns: (transfer full): the #GITypeInfo. Free the struct by calling
* g_base_info_unref() when done.
* gi_base_info_unref() when done.
*/
GITypeInfo *
g_constant_info_get_type (GIConstantInfo *info)
gi_constant_info_get_type (GIConstantInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
g_return_val_if_fail (info != NULL, NULL);
g_return_val_if_fail (GI_IS_CONSTANT_INFO (info), NULL);
return _g_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + 8);
return _gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib, rinfo->offset + 8);
}
#define DO_ALIGNED_COPY(dest_addr, src_addr, type) \
memcpy((dest_addr), (src_addr), sizeof(type))
/**
* g_constant_info_free_value: (skip)
* gi_constant_info_free_value: (skip)
* @info: a #GIConstantInfo
* @value: the argument
*
* Free the value returned from g_constant_info_get_value().
* Free the value returned from gi_constant_info_get_value().
*
* Since: 1.32
*/
void
g_constant_info_free_value (GIConstantInfo *info,
GIArgument *value)
gi_constant_info_free_value (GIConstantInfo *info,
GIArgument *value)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ConstantBlob *blob;
@ -98,20 +98,20 @@ g_constant_info_free_value (GIConstantInfo *info,
}
/**
* g_constant_info_get_value: (skip)
* gi_constant_info_get_value: (skip)
* @info: a #GIConstantInfo
* @value: (out): an argument
*
* Obtain the value associated with the #GIConstantInfo and store it in the
* @value parameter. @argument needs to be allocated before passing it in.
* The size of the constant value stored in @argument will be returned.
* Free the value with g_constant_info_free_value().
* Free the value with gi_constant_info_free_value().
*
* Returns: size of the constant
*/
gint
g_constant_info_get_value (GIConstantInfo *info,
GIArgument *value)
gi_constant_info_get_value (GIConstantInfo *info,
GIArgument *value)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ConstantBlob *blob;

View File

@ -39,17 +39,17 @@ G_BEGIN_DECLS
* Checks if @info is a #GIConstantInfo.
*/
#define GI_IS_CONSTANT_INFO(info) \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_CONSTANT)
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_CONSTANT)
GI_AVAILABLE_IN_ALL
GITypeInfo * g_constant_info_get_type (GIConstantInfo *info);
GITypeInfo * gi_constant_info_get_type (GIConstantInfo *info);
GI_AVAILABLE_IN_ALL
void g_constant_info_free_value(GIConstantInfo *info,
GIArgument *value);
void gi_constant_info_free_value (GIConstantInfo *info,
GIArgument *value);
GI_AVAILABLE_IN_ALL
gint g_constant_info_get_value(GIConstantInfo *info,
GIArgument *value);
gint gi_constant_info_get_value (GIConstantInfo *info,
GIArgument *value);
G_END_DECLS

View File

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

View File

@ -39,8 +39,8 @@ G_BEGIN_DECLS
* Checks if @info is a #GIEnumInfo.
*/
#define GI_IS_ENUM_INFO(info) \
((g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_ENUM) || \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_FLAGS))
((gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_ENUM) || \
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_FLAGS))
/**
* GI_IS_VALUE_INFO
@ -49,31 +49,31 @@ G_BEGIN_DECLS
* Checks if @info is a #GIValueInfo.
*/
#define GI_IS_VALUE_INFO(info) \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_VALUE)
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_VALUE)
GI_AVAILABLE_IN_ALL
gint g_enum_info_get_n_values (GIEnumInfo *info);
gint gi_enum_info_get_n_values (GIEnumInfo *info);
GI_AVAILABLE_IN_ALL
GIValueInfo * g_enum_info_get_value (GIEnumInfo *info,
gint n);
GIValueInfo * gi_enum_info_get_value (GIEnumInfo *info,
gint n);
GI_AVAILABLE_IN_ALL
gint g_enum_info_get_n_methods (GIEnumInfo *info);
gint gi_enum_info_get_n_methods (GIEnumInfo *info);
GI_AVAILABLE_IN_ALL
GIFunctionInfo * g_enum_info_get_method (GIEnumInfo *info,
gint n);
GIFunctionInfo * gi_enum_info_get_method (GIEnumInfo *info,
gint n);
GI_AVAILABLE_IN_ALL
GITypeTag g_enum_info_get_storage_type (GIEnumInfo *info);
GITypeTag gi_enum_info_get_storage_type (GIEnumInfo *info);
GI_AVAILABLE_IN_ALL
const gchar * g_enum_info_get_error_domain (GIEnumInfo *info);
const gchar * gi_enum_info_get_error_domain (GIEnumInfo *info);
GI_AVAILABLE_IN_ALL
gint64 g_value_info_get_value (GIValueInfo *info);
gint64 gi_value_info_get_value (GIValueInfo *info);
G_END_DECLS

View File

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

View File

@ -40,29 +40,29 @@ G_BEGIN_DECLS
*
*/
#define GI_IS_FIELD_INFO(info) \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_FIELD)
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_FIELD)
GI_AVAILABLE_IN_ALL
GIFieldInfoFlags g_field_info_get_flags (GIFieldInfo *info);
GIFieldInfoFlags gi_field_info_get_flags (GIFieldInfo *info);
GI_AVAILABLE_IN_ALL
gint g_field_info_get_size (GIFieldInfo *info);
gint gi_field_info_get_size (GIFieldInfo *info);
GI_AVAILABLE_IN_ALL
gint g_field_info_get_offset (GIFieldInfo *info);
gint gi_field_info_get_offset (GIFieldInfo *info);
GI_AVAILABLE_IN_ALL
GITypeInfo * g_field_info_get_type (GIFieldInfo *info);
GITypeInfo * gi_field_info_get_type (GIFieldInfo *info);
GI_AVAILABLE_IN_ALL
gboolean g_field_info_get_field (GIFieldInfo *field_info,
gpointer mem,
GIArgument *value);
gboolean gi_field_info_get_field (GIFieldInfo *field_info,
gpointer mem,
GIArgument *value);
GI_AVAILABLE_IN_ALL
gboolean g_field_info_set_field (GIFieldInfo *field_info,
gpointer mem,
const GIArgument *value);
gboolean gi_field_info_set_field (GIFieldInfo *field_info,
gpointer mem,
const GIArgument *value);
G_END_DECLS

View File

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

View File

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

View File

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

View File

@ -39,65 +39,65 @@ G_BEGIN_DECLS
* Checks if @info is a #GIInterfaceInfo.
*/
#define GI_IS_INTERFACE_INFO(info) \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_INTERFACE)
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_INTERFACE)
GI_AVAILABLE_IN_ALL
gint g_interface_info_get_n_prerequisites (GIInterfaceInfo *info);
gint gi_interface_info_get_n_prerequisites (GIInterfaceInfo *info);
GI_AVAILABLE_IN_ALL
GIBaseInfo * g_interface_info_get_prerequisite (GIInterfaceInfo *info,
gint n);
GIBaseInfo * gi_interface_info_get_prerequisite (GIInterfaceInfo *info,
gint n);
GI_AVAILABLE_IN_ALL
gint g_interface_info_get_n_properties (GIInterfaceInfo *info);
gint gi_interface_info_get_n_properties (GIInterfaceInfo *info);
GI_AVAILABLE_IN_ALL
GIPropertyInfo * g_interface_info_get_property (GIInterfaceInfo *info,
gint n);
GIPropertyInfo * gi_interface_info_get_property (GIInterfaceInfo *info,
gint n);
GI_AVAILABLE_IN_ALL
gint g_interface_info_get_n_methods (GIInterfaceInfo *info);
gint gi_interface_info_get_n_methods (GIInterfaceInfo *info);
GI_AVAILABLE_IN_ALL
GIFunctionInfo * g_interface_info_get_method (GIInterfaceInfo *info,
gint n);
GIFunctionInfo * gi_interface_info_get_method (GIInterfaceInfo *info,
gint n);
GI_AVAILABLE_IN_ALL
GIFunctionInfo * g_interface_info_find_method (GIInterfaceInfo *info,
const gchar *name);
GIFunctionInfo * gi_interface_info_find_method (GIInterfaceInfo *info,
const gchar *name);
GI_AVAILABLE_IN_ALL
gint g_interface_info_get_n_signals (GIInterfaceInfo *info);
gint gi_interface_info_get_n_signals (GIInterfaceInfo *info);
GI_AVAILABLE_IN_ALL
GISignalInfo * g_interface_info_get_signal (GIInterfaceInfo *info,
gint n);
GISignalInfo * gi_interface_info_get_signal (GIInterfaceInfo *info,
gint n);
GI_AVAILABLE_IN_ALL
GISignalInfo * g_interface_info_find_signal (GIInterfaceInfo *info,
const gchar *name);
GISignalInfo * gi_interface_info_find_signal (GIInterfaceInfo *info,
const gchar *name);
GI_AVAILABLE_IN_ALL
gint g_interface_info_get_n_vfuncs (GIInterfaceInfo *info);
gint gi_interface_info_get_n_vfuncs (GIInterfaceInfo *info);
GI_AVAILABLE_IN_ALL
GIVFuncInfo * g_interface_info_get_vfunc (GIInterfaceInfo *info,
gint n);
GIVFuncInfo * gi_interface_info_get_vfunc (GIInterfaceInfo *info,
gint n);
GI_AVAILABLE_IN_ALL
GIVFuncInfo * g_interface_info_find_vfunc (GIInterfaceInfo *info,
const gchar *name);
GIVFuncInfo * gi_interface_info_find_vfunc (GIInterfaceInfo *info,
const gchar *name);
GI_AVAILABLE_IN_ALL
gint g_interface_info_get_n_constants (GIInterfaceInfo *info);
gint gi_interface_info_get_n_constants (GIInterfaceInfo *info);
GI_AVAILABLE_IN_ALL
GIConstantInfo * g_interface_info_get_constant (GIInterfaceInfo *info,
gint n);
GIConstantInfo * gi_interface_info_get_constant (GIInterfaceInfo *info,
gint n);
GI_AVAILABLE_IN_ALL
GIStructInfo * g_interface_info_get_iface_struct (GIInterfaceInfo *info);
GIStructInfo * gi_interface_info_get_iface_struct (GIInterfaceInfo *info);
G_END_DECLS

View File

@ -49,7 +49,7 @@
*/
/**
* g_object_info_get_field_offset:
* gi_object_info_get_field_offset:
* @info: a #GIObjectInfo
* @n: index of queried field
*
@ -58,8 +58,8 @@
* Returns: field offset in bytes
*/
static gint32
g_object_info_get_field_offset (GIObjectInfo *info,
gint n)
gi_object_info_get_field_offset (GIObjectInfo *info,
gint n)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
Header *header = (Header *)rinfo->typelib->data;
@ -83,16 +83,16 @@ g_object_info_get_field_offset (GIObjectInfo *info,
}
/**
* g_object_info_get_parent:
* gi_object_info_get_parent:
* @info: a #GIObjectInfo
*
* Obtain the parent of the object type.
*
* Returns: (transfer full) (nullable): the #GIObjectInfo. Free the struct by calling
* g_base_info_unref() when done.
* gi_base_info_unref() when done.
*/
GIObjectInfo *
g_object_info_get_parent (GIObjectInfo *info)
gi_object_info_get_parent (GIObjectInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob;
@ -103,14 +103,14 @@ g_object_info_get_parent (GIObjectInfo *info)
blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
if (blob->parent)
return (GIObjectInfo *) _g_info_from_entry (rinfo->repository,
rinfo->typelib, blob->parent);
return (GIObjectInfo *) _gi_info_from_entry (rinfo->repository,
rinfo->typelib, blob->parent);
else
return NULL;
}
/**
* g_object_info_get_abstract:
* gi_object_info_get_abstract:
* @info: a #GIObjectInfo
*
* Obtain if the object type is an abstract type, eg if it cannot be
@ -119,7 +119,7 @@ g_object_info_get_parent (GIObjectInfo *info)
* Returns: %TRUE if the object type is abstract
*/
gboolean
g_object_info_get_abstract (GIObjectInfo *info)
gi_object_info_get_abstract (GIObjectInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob;
@ -133,7 +133,7 @@ g_object_info_get_abstract (GIObjectInfo *info)
}
/**
* g_object_info_get_final:
* gi_object_info_get_final:
* @info: a #GIObjectInfo
*
* Checks whether the object type is a final type, i.e. if it cannot
@ -144,7 +144,7 @@ g_object_info_get_abstract (GIObjectInfo *info)
* Since: 1.70
*/
gboolean
g_object_info_get_final (GIObjectInfo *info)
gi_object_info_get_final (GIObjectInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *) info;
ObjectBlob *blob;
@ -158,7 +158,7 @@ g_object_info_get_final (GIObjectInfo *info)
}
/**
* g_object_info_get_fundamental:
* gi_object_info_get_fundamental:
* @info: a #GIObjectInfo
*
* Obtain if the object type is of a fundamental type which is not
@ -167,7 +167,7 @@ g_object_info_get_final (GIObjectInfo *info)
* Returns: %TRUE if the object type is a fundamental type
*/
gboolean
g_object_info_get_fundamental (GIObjectInfo *info)
gi_object_info_get_fundamental (GIObjectInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob;
@ -181,7 +181,7 @@ g_object_info_get_fundamental (GIObjectInfo *info)
}
/**
* g_object_info_get_type_name:
* gi_object_info_get_type_name:
* @info: a #GIObjectInfo
*
* Obtain the name of the objects class/type.
@ -189,7 +189,7 @@ g_object_info_get_fundamental (GIObjectInfo *info)
* Returns: name of the objects type
*/
const gchar *
g_object_info_get_type_name (GIObjectInfo *info)
gi_object_info_get_type_name (GIObjectInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob;
@ -199,11 +199,11 @@ g_object_info_get_type_name (GIObjectInfo *info)
blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
return g_typelib_get_string (rinfo->typelib, blob->gtype_name);
return gi_typelib_get_string (rinfo->typelib, blob->gtype_name);
}
/**
* g_object_info_get_type_init:
* gi_object_info_get_type_init:
* @info: a #GIObjectInfo
*
* Obtain the function which when called will return the GType
@ -212,7 +212,7 @@ g_object_info_get_type_name (GIObjectInfo *info)
* Returns: the type init function
*/
const gchar *
g_object_info_get_type_init (GIObjectInfo *info)
gi_object_info_get_type_init (GIObjectInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob;
@ -222,11 +222,11 @@ g_object_info_get_type_init (GIObjectInfo *info)
blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
return g_typelib_get_string (rinfo->typelib, blob->gtype_init);
return gi_typelib_get_string (rinfo->typelib, blob->gtype_init);
}
/**
* g_object_info_get_n_interfaces:
* gi_object_info_get_n_interfaces:
* @info: a #GIObjectInfo
*
* Obtain the number of interfaces that this object type has.
@ -234,7 +234,7 @@ g_object_info_get_type_init (GIObjectInfo *info)
* Returns: number of interfaces
*/
gint
g_object_info_get_n_interfaces (GIObjectInfo *info)
gi_object_info_get_n_interfaces (GIObjectInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob;
@ -248,18 +248,18 @@ g_object_info_get_n_interfaces (GIObjectInfo *info)
}
/**
* g_object_info_get_interface:
* gi_object_info_get_interface:
* @info: a #GIObjectInfo
* @n: index of interface to get
*
* Obtain an object type interface at index @n.
*
* Returns: (transfer full): the #GIInterfaceInfo. Free the struct by calling
* g_base_info_unref() when done.
* gi_base_info_unref() when done.
*/
GIInterfaceInfo *
g_object_info_get_interface (GIObjectInfo *info,
gint n)
gi_object_info_get_interface (GIObjectInfo *info,
gint n)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob;
@ -269,12 +269,12 @@ g_object_info_get_interface (GIObjectInfo *info,
blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
return (GIInterfaceInfo *) _g_info_from_entry (rinfo->repository,
rinfo->typelib, blob->interfaces[n]);
return (GIInterfaceInfo *) _gi_info_from_entry (rinfo->repository,
rinfo->typelib, blob->interfaces[n]);
}
/**
* g_object_info_get_n_fields:
* gi_object_info_get_n_fields:
* @info: a #GIObjectInfo
*
* Obtain the number of fields that this object type has.
@ -282,7 +282,7 @@ g_object_info_get_interface (GIObjectInfo *info,
* Returns: number of fields
*/
gint
g_object_info_get_n_fields (GIObjectInfo *info)
gi_object_info_get_n_fields (GIObjectInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob;
@ -296,18 +296,18 @@ g_object_info_get_n_fields (GIObjectInfo *info)
}
/**
* g_object_info_get_field:
* gi_object_info_get_field:
* @info: a #GIObjectInfo
* @n: index of field to get
*
* Obtain an object type field at index @n.
*
* Returns: (transfer full): the #GIFieldInfo. Free the struct by calling
* g_base_info_unref() when done.
* gi_base_info_unref() when done.
*/
GIFieldInfo *
g_object_info_get_field (GIObjectInfo *info,
gint n)
gi_object_info_get_field (GIObjectInfo *info,
gint n)
{
gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info;
@ -315,13 +315,13 @@ g_object_info_get_field (GIObjectInfo *info,
g_return_val_if_fail (info != NULL, NULL);
g_return_val_if_fail (GI_IS_OBJECT_INFO (info), NULL);
offset = g_object_info_get_field_offset(info, n);
offset = gi_object_info_get_field_offset(info, n);
return (GIFieldInfo *) g_info_new (GI_INFO_TYPE_FIELD, (GIBaseInfo*)info, rinfo->typelib, offset);
return (GIFieldInfo *) gi_info_new (GI_INFO_TYPE_FIELD, (GIBaseInfo*)info, rinfo->typelib, offset);
}
/**
* g_object_info_get_n_properties:
* gi_object_info_get_n_properties:
* @info: a #GIObjectInfo
*
* Obtain the number of properties that this object type has.
@ -329,7 +329,7 @@ g_object_info_get_field (GIObjectInfo *info,
* Returns: number of properties
*/
gint
g_object_info_get_n_properties (GIObjectInfo *info)
gi_object_info_get_n_properties (GIObjectInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob;
@ -342,18 +342,18 @@ g_object_info_get_n_properties (GIObjectInfo *info)
}
/**
* g_object_info_get_property:
* gi_object_info_get_property:
* @info: a #GIObjectInfo
* @n: index of property to get
*
* Obtain an object type property at index @n.
*
* Returns: (transfer full): the #GIPropertyInfo. Free the struct by calling
* g_base_info_unref() when done.
* gi_base_info_unref() when done.
*/
GIPropertyInfo *
g_object_info_get_property (GIObjectInfo *info,
gint n)
gi_object_info_get_property (GIObjectInfo *info,
gint n)
{
gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info;
@ -372,12 +372,12 @@ g_object_info_get_property (GIObjectInfo *info,
+ blob->n_field_callbacks * header->callback_blob_size
+ n * header->property_blob_size;
return (GIPropertyInfo *) g_info_new (GI_INFO_TYPE_PROPERTY, (GIBaseInfo*)info,
rinfo->typelib, offset);
return (GIPropertyInfo *) gi_info_new (GI_INFO_TYPE_PROPERTY, (GIBaseInfo*)info,
rinfo->typelib, offset);
}
/**
* g_object_info_get_n_methods:
* gi_object_info_get_n_methods:
* @info: a #GIObjectInfo
*
* Obtain the number of methods that this object type has.
@ -385,7 +385,7 @@ g_object_info_get_property (GIObjectInfo *info,
* Returns: number of methods
*/
gint
g_object_info_get_n_methods (GIObjectInfo *info)
gi_object_info_get_n_methods (GIObjectInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob;
@ -399,18 +399,18 @@ g_object_info_get_n_methods (GIObjectInfo *info)
}
/**
* g_object_info_get_method:
* gi_object_info_get_method:
* @info: a #GIObjectInfo
* @n: index of method to get
*
* Obtain an object type method at index @n.
*
* Returns: (transfer full): the #GIFunctionInfo. Free the struct by calling
* g_base_info_unref() when done.
* gi_base_info_unref() when done.
*/
GIFunctionInfo *
g_object_info_get_method (GIObjectInfo *info,
gint n)
gi_object_info_get_method (GIObjectInfo *info,
gint n)
{
gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info;
@ -431,12 +431,12 @@ g_object_info_get_method (GIObjectInfo *info,
+ blob->n_properties * header->property_blob_size
+ n * header->function_blob_size;
return (GIFunctionInfo *) g_info_new (GI_INFO_TYPE_FUNCTION, (GIBaseInfo*)info,
rinfo->typelib, offset);
return (GIFunctionInfo *) gi_info_new (GI_INFO_TYPE_FUNCTION, (GIBaseInfo*)info,
rinfo->typelib, offset);
}
/**
* g_object_info_find_method:
* gi_object_info_find_method:
* @info: a #GIObjectInfo
* @name: name of method to obtain
*
@ -444,11 +444,11 @@ g_object_info_get_method (GIObjectInfo *info,
* returned if there's no method available with that name.
*
* Returns: (transfer full) (nullable): the #GIFunctionInfo. Free the struct by calling
* g_base_info_unref() when done.
* gi_base_info_unref() when done.
*/
GIFunctionInfo *
g_object_info_find_method (GIObjectInfo *info,
const gchar *name)
gi_object_info_find_method (GIObjectInfo *info,
const gchar *name)
{
gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info;
@ -467,11 +467,11 @@ g_object_info_find_method (GIObjectInfo *info,
+ blob->n_field_callbacks * header->callback_blob_size
+ blob->n_properties * header->property_blob_size;
return _g_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_methods, name);
return _gi_base_info_find_method ((GIBaseInfo*)info, offset, blob->n_methods, name);
}
/**
* g_object_info_find_method_using_interfaces:
* gi_object_info_find_method_using_interfaces:
* @info: a #GIObjectInfo
* @name: name of method to obtain
* @implementor: (out) (transfer full): The implementor of the interface
@ -484,51 +484,51 @@ g_object_info_find_method (GIObjectInfo *info,
* to chain up if that's desired.
*
* Returns: (transfer full) (nullable): the #GIFunctionInfo. Free the struct by calling
* g_base_info_unref() when done.
* gi_base_info_unref() when done.
*/
GIFunctionInfo *
g_object_info_find_method_using_interfaces (GIObjectInfo *info,
const gchar *name,
GIObjectInfo **implementor)
gi_object_info_find_method_using_interfaces (GIObjectInfo *info,
const gchar *name,
GIObjectInfo **implementor)
{
GIFunctionInfo *result = NULL;
GIObjectInfo *implementor_result = NULL;
result = g_object_info_find_method (info, name);
result = gi_object_info_find_method (info, name);
if (result)
implementor_result = g_base_info_ref ((GIBaseInfo*) info);
implementor_result = gi_base_info_ref ((GIBaseInfo*) info);
if (result == NULL)
{
int n_interfaces;
int i;
n_interfaces = g_object_info_get_n_interfaces (info);
n_interfaces = gi_object_info_get_n_interfaces (info);
for (i = 0; i < n_interfaces; ++i)
{
GIInterfaceInfo *iface_info;
iface_info = g_object_info_get_interface (info, i);
iface_info = gi_object_info_get_interface (info, i);
result = g_interface_info_find_method (iface_info, name);
result = gi_interface_info_find_method (iface_info, name);
if (result != NULL)
{
implementor_result = iface_info;
break;
}
g_base_info_unref ((GIBaseInfo*) iface_info);
gi_base_info_unref ((GIBaseInfo*) iface_info);
}
}
if (implementor)
*implementor = implementor_result;
else if (implementor_result != NULL)
g_base_info_unref ((GIBaseInfo*) implementor_result);
gi_base_info_unref ((GIBaseInfo*) implementor_result);
return result;
}
/**
* g_object_info_get_n_signals:
* gi_object_info_get_n_signals:
* @info: a #GIObjectInfo
*
* Obtain the number of signals that this object type has.
@ -536,7 +536,7 @@ g_object_info_find_method_using_interfaces (GIObjectInfo *info,
* Returns: number of signals
*/
gint
g_object_info_get_n_signals (GIObjectInfo *info)
gi_object_info_get_n_signals (GIObjectInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob;
@ -550,18 +550,18 @@ g_object_info_get_n_signals (GIObjectInfo *info)
}
/**
* g_object_info_get_signal:
* gi_object_info_get_signal:
* @info: a #GIObjectInfo
* @n: index of signal to get
*
* Obtain an object type signal at index @n.
*
* Returns: (transfer full): the #GISignalInfo. Free the struct by calling
* g_base_info_unref() when done.
* gi_base_info_unref() when done.
*/
GISignalInfo *
g_object_info_get_signal (GIObjectInfo *info,
gint n)
gi_object_info_get_signal (GIObjectInfo *info,
gint n)
{
gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info;
@ -582,12 +582,12 @@ g_object_info_get_signal (GIObjectInfo *info,
+ blob->n_methods * header->function_blob_size
+ n * header->signal_blob_size;
return (GISignalInfo *) g_info_new (GI_INFO_TYPE_SIGNAL, (GIBaseInfo*)info,
rinfo->typelib, offset);
return (GISignalInfo *) gi_info_new (GI_INFO_TYPE_SIGNAL, (GIBaseInfo*)info,
rinfo->typelib, offset);
}
/**
* g_object_info_find_signal:
* gi_object_info_find_signal:
* @info: a #GIObjectInfo
* @name: Name of signal
*
@ -596,20 +596,20 @@ g_object_info_get_signal (GIObjectInfo *info,
* Returns: (transfer full) (nullable): Info for the signal with name @name in @info, or %NULL on failure.
*/
GISignalInfo *
g_object_info_find_signal (GIObjectInfo *info,
const gchar *name)
gi_object_info_find_signal (GIObjectInfo *info,
const gchar *name)
{
gint n_signals;
gint i;
n_signals = g_object_info_get_n_signals (info);
n_signals = gi_object_info_get_n_signals (info);
for (i = 0; i < n_signals; i++)
{
GISignalInfo *siginfo = g_object_info_get_signal (info, i);
GISignalInfo *siginfo = gi_object_info_get_signal (info, i);
if (g_strcmp0 (g_base_info_get_name (siginfo), name) != 0)
if (g_strcmp0 (gi_base_info_get_name (siginfo), name) != 0)
{
g_base_info_unref ((GIBaseInfo*)siginfo);
gi_base_info_unref ((GIBaseInfo*)siginfo);
continue;
}
@ -620,7 +620,7 @@ g_object_info_find_signal (GIObjectInfo *info,
/**
* g_object_info_get_n_vfuncs:
* gi_object_info_get_n_vfuncs:
* @info: a #GIObjectInfo
*
* Obtain the number of virtual functions that this object type has.
@ -628,7 +628,7 @@ g_object_info_find_signal (GIObjectInfo *info,
* Returns: number of virtual functions
*/
gint
g_object_info_get_n_vfuncs (GIObjectInfo *info)
gi_object_info_get_n_vfuncs (GIObjectInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob;
@ -642,18 +642,18 @@ g_object_info_get_n_vfuncs (GIObjectInfo *info)
}
/**
* g_object_info_get_vfunc:
* gi_object_info_get_vfunc:
* @info: a #GIObjectInfo
* @n: index of virtual function to get
*
* Obtain an object type virtual function at index @n.
*
* Returns: (transfer full): the #GIVFuncInfo. Free the struct by calling
* g_base_info_unref() when done.
* gi_base_info_unref() when done.
*/
GIVFuncInfo *
g_object_info_get_vfunc (GIObjectInfo *info,
gint n)
gi_object_info_get_vfunc (GIObjectInfo *info,
gint n)
{
gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info;
@ -675,29 +675,29 @@ g_object_info_get_vfunc (GIObjectInfo *info,
+ blob->n_signals * header->signal_blob_size
+ n * header->vfunc_blob_size;
return (GIVFuncInfo *) g_info_new (GI_INFO_TYPE_VFUNC, (GIBaseInfo*)info,
rinfo->typelib, offset);
return (GIVFuncInfo *) gi_info_new (GI_INFO_TYPE_VFUNC, (GIBaseInfo*)info,
rinfo->typelib, offset);
}
/**
* g_object_info_find_vfunc:
* gi_object_info_find_vfunc:
* @info: a #GIObjectInfo
* @name: The name of a virtual function to find.
*
* Locate a virtual function slot with name @name. Note that the namespace
* for virtuals is distinct from that of methods; there may or may not be
* a concrete method associated for a virtual. If there is one, it may
* be retrieved using g_vfunc_info_get_invoker(), otherwise %NULL will be
* be retrieved using gi_vfunc_info_get_invoker(), otherwise %NULL will be
* returned.
* See the documentation for g_vfunc_info_get_invoker() for more
* See the documentation for gi_vfunc_info_get_invoker() for more
* information on invoking virtuals.
*
* Returns: (transfer full) (nullable): the #GIVFuncInfo, or %NULL. Free it with
* g_base_info_unref() when done.
* gi_base_info_unref() when done.
*/
GIVFuncInfo *
g_object_info_find_vfunc (GIObjectInfo *info,
const gchar *name)
gi_object_info_find_vfunc (GIObjectInfo *info,
const gchar *name)
{
gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info;
@ -718,11 +718,11 @@ g_object_info_find_vfunc (GIObjectInfo *info,
+ blob->n_methods * header->function_blob_size
+ blob->n_signals * header->signal_blob_size;
return _g_base_info_find_vfunc (rinfo, offset, blob->n_vfuncs, name);
return _gi_base_info_find_vfunc (rinfo, offset, blob->n_vfuncs, name);
}
/**
* g_object_info_find_vfunc_using_interfaces:
* gi_object_info_find_vfunc_using_interfaces:
* @info: a #GIObjectInfo
* @name: name of vfunc to obtain
* @implementor: (out) (transfer full): The implementor of the interface
@ -731,58 +731,58 @@ g_object_info_find_vfunc (GIObjectInfo *info,
* @info and any interfaces it implements. Note that the namespace for
* virtuals is distinct from that of methods; there may or may not be a
* concrete method associated for a virtual. If there is one, it may be
* retrieved using g_vfunc_info_get_invoker(), otherwise %NULL will be
* retrieved using gi_vfunc_info_get_invoker(), otherwise %NULL will be
* returned.
*
* Note that this function does *not* search parent classes; you will have
* to chain up if that's desired.
*
* Returns: (transfer full) (nullable): the #GIVFuncInfo. Free the struct by calling
* g_base_info_unref() when done.
* gi_base_info_unref() when done.
*/
GIVFuncInfo *
g_object_info_find_vfunc_using_interfaces (GIObjectInfo *info,
const gchar *name,
GIObjectInfo **implementor)
gi_object_info_find_vfunc_using_interfaces (GIObjectInfo *info,
const gchar *name,
GIObjectInfo **implementor)
{
GIVFuncInfo *result = NULL;
GIObjectInfo *implementor_result = NULL;
result = g_object_info_find_vfunc (info, name);
result = gi_object_info_find_vfunc (info, name);
if (result)
implementor_result = g_base_info_ref ((GIBaseInfo*) info);
implementor_result = gi_base_info_ref ((GIBaseInfo*) info);
if (result == NULL)
{
int n_interfaces;
int i;
n_interfaces = g_object_info_get_n_interfaces (info);
n_interfaces = gi_object_info_get_n_interfaces (info);
for (i = 0; i < n_interfaces; ++i)
{
GIInterfaceInfo *iface_info;
iface_info = g_object_info_get_interface (info, i);
iface_info = gi_object_info_get_interface (info, i);
result = g_interface_info_find_vfunc (iface_info, name);
result = gi_interface_info_find_vfunc (iface_info, name);
if (result != NULL)
{
implementor_result = iface_info;
break;
}
g_base_info_unref ((GIBaseInfo*) iface_info);
gi_base_info_unref ((GIBaseInfo*) iface_info);
}
}
if (implementor)
*implementor = implementor_result;
else if (implementor_result != NULL)
g_base_info_unref ((GIBaseInfo*) implementor_result);
gi_base_info_unref ((GIBaseInfo*) implementor_result);
return result;
}
/**
* g_object_info_get_n_constants:
* gi_object_info_get_n_constants:
* @info: a #GIObjectInfo
*
* Obtain the number of constants that this object type has.
@ -790,7 +790,7 @@ g_object_info_find_vfunc_using_interfaces (GIObjectInfo *info,
* Returns: number of constants
*/
gint
g_object_info_get_n_constants (GIObjectInfo *info)
gi_object_info_get_n_constants (GIObjectInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob;
@ -804,18 +804,18 @@ g_object_info_get_n_constants (GIObjectInfo *info)
}
/**
* g_object_info_get_constant:
* gi_object_info_get_constant:
* @info: a #GIObjectInfo
* @n: index of constant to get
*
* Obtain an object type constant at index @n.
*
* Returns: (transfer full): the #GIConstantInfo. Free the struct by calling
* g_base_info_unref() when done.
* gi_base_info_unref() when done.
*/
GIConstantInfo *
g_object_info_get_constant (GIObjectInfo *info,
gint n)
gi_object_info_get_constant (GIObjectInfo *info,
gint n)
{
gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info;
@ -838,22 +838,22 @@ g_object_info_get_constant (GIObjectInfo *info,
+ blob->n_vfuncs * header->vfunc_blob_size
+ n * header->constant_blob_size;
return (GIConstantInfo *) g_info_new (GI_INFO_TYPE_CONSTANT, (GIBaseInfo*)info,
rinfo->typelib, offset);
return (GIConstantInfo *) gi_info_new (GI_INFO_TYPE_CONSTANT, (GIBaseInfo*)info,
rinfo->typelib, offset);
}
/**
* g_object_info_get_class_struct:
* gi_object_info_get_class_struct:
* @info: a #GIObjectInfo
*
* Every #GObject has two structures; an instance structure and a class
* structure. This function returns the metadata for the class structure.
*
* Returns: (transfer full) (nullable): the #GIStructInfo or %NULL. Free with
* g_base_info_unref() when done.
* gi_base_info_unref() when done.
*/
GIStructInfo *
g_object_info_get_class_struct (GIObjectInfo *info)
gi_object_info_get_class_struct (GIObjectInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob;
@ -864,8 +864,8 @@ g_object_info_get_class_struct (GIObjectInfo *info)
blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
if (blob->gtype_struct)
return (GIStructInfo *) _g_info_from_entry (rinfo->repository,
rinfo->typelib, blob->gtype_struct);
return (GIStructInfo *) _gi_info_from_entry (rinfo->repository,
rinfo->typelib, blob->gtype_struct);
else
return NULL;
}
@ -881,11 +881,11 @@ _get_func(GIObjectInfo *info,
GIObjectInfo *parent_info;
gpointer func = NULL;
parent_info = g_base_info_ref (info);
parent_info = gi_base_info_ref (info);
while (parent_info != NULL)
{
parents = g_slist_prepend (parents, parent_info);
parent_info = g_object_info_get_parent (parent_info);
parent_info = gi_object_info_get_parent (parent_info);
}
for (l = parents; l; l = l->next)
@ -895,28 +895,28 @@ _get_func(GIObjectInfo *info,
if (symbol == NULL)
continue;
g_typelib_symbol (((GIRealInfo *)parent_info)->typelib, symbol, (gpointer*) &func);
gi_typelib_symbol (((GIRealInfo *)parent_info)->typelib, symbol, (gpointer*) &func);
if (func)
break;
}
g_slist_free_full (parents, (GDestroyNotify) g_base_info_unref);
g_slist_free_full (parents, (GDestroyNotify) gi_base_info_unref);
return func;
}
/**
* g_object_info_get_ref_function:
* gi_object_info_get_ref_function:
* @info: a #GIObjectInfo
*
* Obtain the symbol name of the function that should be called to ref this
* object type. It's mainly used fundamental types. The type signature for
* the symbol is %GIObjectInfoRefFunction, to fetch the function pointer
* see g_object_info_get_ref_function().
* see gi_object_info_get_ref_function().
*
* Returns: (nullable): the symbol or %NULL
*/
const char *
g_object_info_get_ref_function (GIObjectInfo *info)
gi_object_info_get_ref_function (GIObjectInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob;
@ -927,13 +927,13 @@ g_object_info_get_ref_function (GIObjectInfo *info)
blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
if (blob->ref_func)
return g_typelib_get_string (rinfo->typelib, blob->ref_func);
return gi_typelib_get_string (rinfo->typelib, blob->ref_func);
return NULL;
}
/**
* g_object_info_get_ref_function_pointer: (skip)
* gi_object_info_get_ref_function_pointer: (skip)
* @info: a #GIObjectInfo
*
* Obtain a pointer to a function which can be used to
@ -944,27 +944,27 @@ g_object_info_get_ref_function (GIObjectInfo *info)
* Returns: (nullable): the function pointer or %NULL
*/
GIObjectInfoRefFunction
g_object_info_get_ref_function_pointer (GIObjectInfo *info)
gi_object_info_get_ref_function_pointer (GIObjectInfo *info)
{
g_return_val_if_fail (info != NULL, NULL);
g_return_val_if_fail (GI_IS_OBJECT_INFO (info), NULL);
return (GIObjectInfoRefFunction)_get_func(info, (SymbolGetter)g_object_info_get_ref_function);
return (GIObjectInfoRefFunction)_get_func(info, (SymbolGetter)gi_object_info_get_ref_function);
}
/**
* g_object_info_get_unref_function:
* gi_object_info_get_unref_function:
* @info: a #GIObjectInfo
*
* Obtain the symbol name of the function that should be called to unref this
* object type. It's mainly used fundamental types. The type signature for
* the symbol is %GIObjectInfoUnrefFunction, to fetch the function pointer
* see g_object_info_get_unref_function().
* see gi_object_info_get_unref_function().
*
* Returns: (nullable): the symbol or %NULL
*/
const char *
g_object_info_get_unref_function (GIObjectInfo *info)
gi_object_info_get_unref_function (GIObjectInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob;
@ -975,13 +975,13 @@ g_object_info_get_unref_function (GIObjectInfo *info)
blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
if (blob->unref_func)
return g_typelib_get_string (rinfo->typelib, blob->unref_func);
return gi_typelib_get_string (rinfo->typelib, blob->unref_func);
return NULL;
}
/**
* g_object_info_get_unref_function_pointer: (skip)
* gi_object_info_get_unref_function_pointer: (skip)
* @info: a #GIObjectInfo
*
* Obtain a pointer to a function which can be used to
@ -992,28 +992,28 @@ g_object_info_get_unref_function (GIObjectInfo *info)
* Returns: (nullable): the function pointer or %NULL
*/
GIObjectInfoUnrefFunction
g_object_info_get_unref_function_pointer (GIObjectInfo *info)
gi_object_info_get_unref_function_pointer (GIObjectInfo *info)
{
g_return_val_if_fail (info != NULL, NULL);
g_return_val_if_fail (GI_IS_OBJECT_INFO (info), NULL);
return (GIObjectInfoUnrefFunction)_get_func(info, (SymbolGetter)g_object_info_get_unref_function);
return (GIObjectInfoUnrefFunction)_get_func(info, (SymbolGetter)gi_object_info_get_unref_function);
}
/**
* g_object_info_get_set_value_function:
* gi_object_info_get_set_value_function:
* @info: a #GIObjectInfo
*
* Obtain the symbol name of the function that should be called to convert
* set a GValue giving an object instance pointer of this object type.
* I's mainly used fundamental types. The type signature for the symbol
* is %GIObjectInfoSetValueFunction, to fetch the function pointer
* see g_object_info_get_set_value_function().
* see gi_object_info_get_set_value_function().
*
* Returns: (nullable): the symbol or %NULL
*/
const char *
g_object_info_get_set_value_function (GIObjectInfo *info)
gi_object_info_get_set_value_function (GIObjectInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob;
@ -1024,13 +1024,13 @@ g_object_info_get_set_value_function (GIObjectInfo *info)
blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
if (blob->set_value_func)
return g_typelib_get_string (rinfo->typelib, blob->set_value_func);
return gi_typelib_get_string (rinfo->typelib, blob->set_value_func);
return NULL;
}
/**
* g_object_info_get_set_value_function_pointer: (skip)
* gi_object_info_get_set_value_function_pointer: (skip)
* @info: a #GIObjectInfo
*
* Obtain a pointer to a function which can be used to
@ -1041,28 +1041,28 @@ g_object_info_get_set_value_function (GIObjectInfo *info)
* Returns: (nullable): the function pointer or %NULL
*/
GIObjectInfoSetValueFunction
g_object_info_get_set_value_function_pointer (GIObjectInfo *info)
gi_object_info_get_set_value_function_pointer (GIObjectInfo *info)
{
g_return_val_if_fail (info != NULL, NULL);
g_return_val_if_fail (GI_IS_OBJECT_INFO (info), NULL);
return (GIObjectInfoSetValueFunction)_get_func(info, (SymbolGetter)g_object_info_get_set_value_function);
return (GIObjectInfoSetValueFunction)_get_func(info, (SymbolGetter)gi_object_info_get_set_value_function);
}
/**
* g_object_info_get_get_value_function:
* gi_object_info_get_get_value_function:
* @info: a #GIObjectInfo
*
* Obtain the symbol name of the function that should be called to convert
* an object instance pointer of this object type to a GValue.
* I's mainly used fundamental types. The type signature for the symbol
* is %GIObjectInfoGetValueFunction, to fetch the function pointer
* see g_object_info_get_get_value_function().
* see gi_object_info_get_get_value_function().
*
* Returns: (nullable): the symbol or %NULL
*/
const char *
g_object_info_get_get_value_function (GIObjectInfo *info)
gi_object_info_get_get_value_function (GIObjectInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
ObjectBlob *blob;
@ -1073,13 +1073,13 @@ g_object_info_get_get_value_function (GIObjectInfo *info)
blob = (ObjectBlob *)&rinfo->typelib->data[rinfo->offset];
if (blob->get_value_func)
return g_typelib_get_string (rinfo->typelib, blob->get_value_func);
return gi_typelib_get_string (rinfo->typelib, blob->get_value_func);
return NULL;
}
/**
* g_object_info_get_get_value_function_pointer: (skip)
* gi_object_info_get_get_value_function_pointer: (skip)
* @info: a #GIObjectInfo
*
* Obtain a pointer to a function which can be used to
@ -1090,10 +1090,10 @@ g_object_info_get_get_value_function (GIObjectInfo *info)
* Returns: (nullable): the function pointer or %NULL
*/
GIObjectInfoGetValueFunction
g_object_info_get_get_value_function_pointer (GIObjectInfo *info)
gi_object_info_get_get_value_function_pointer (GIObjectInfo *info)
{
g_return_val_if_fail (info != NULL, NULL);
g_return_val_if_fail (GI_IS_OBJECT_INFO (info), NULL);
return (GIObjectInfoGetValueFunction)_get_func(info, (SymbolGetter)g_object_info_get_get_value_function);
return (GIObjectInfoGetValueFunction)_get_func(info, (SymbolGetter)gi_object_info_get_get_value_function);
}

View File

@ -76,132 +76,132 @@ typedef void * (*GIObjectInfoGetValueFunction) (const GValue *value);
* Checks if @info is a #GIObjectInfo.
*/
#define GI_IS_OBJECT_INFO(info) \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_OBJECT)
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_OBJECT)
GI_AVAILABLE_IN_ALL
const gchar * g_object_info_get_type_name (GIObjectInfo *info);
const gchar * gi_object_info_get_type_name (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL
const gchar * g_object_info_get_type_init (GIObjectInfo *info);
const gchar * gi_object_info_get_type_init (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL
gboolean g_object_info_get_abstract (GIObjectInfo *info);
gboolean gi_object_info_get_abstract (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL
gboolean g_object_info_get_final (GIObjectInfo *info);
gboolean gi_object_info_get_final (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL
gboolean g_object_info_get_fundamental (GIObjectInfo *info);
gboolean gi_object_info_get_fundamental (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL
GIObjectInfo * g_object_info_get_parent (GIObjectInfo *info);
GIObjectInfo * gi_object_info_get_parent (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL
gint g_object_info_get_n_interfaces (GIObjectInfo *info);
gint gi_object_info_get_n_interfaces (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL
GIInterfaceInfo * g_object_info_get_interface (GIObjectInfo *info,
GIInterfaceInfo * gi_object_info_get_interface (GIObjectInfo *info,
gint n);
GI_AVAILABLE_IN_ALL
gint gi_object_info_get_n_fields (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL
GIFieldInfo * gi_object_info_get_field (GIObjectInfo *info,
gint n);
GI_AVAILABLE_IN_ALL
gint gi_object_info_get_n_properties (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL
GIPropertyInfo * gi_object_info_get_property (GIObjectInfo *info,
gint n);
GI_AVAILABLE_IN_ALL
gint g_object_info_get_n_fields (GIObjectInfo *info);
gint gi_object_info_get_n_methods (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL
GIFieldInfo * g_object_info_get_field (GIObjectInfo *info,
gint n);
GIFunctionInfo * gi_object_info_get_method (GIObjectInfo *info,
gint n);
GI_AVAILABLE_IN_ALL
gint g_object_info_get_n_properties (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL
GIPropertyInfo * g_object_info_get_property (GIObjectInfo *info,
gint n);
GI_AVAILABLE_IN_ALL
gint g_object_info_get_n_methods (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL
GIFunctionInfo * g_object_info_get_method (GIObjectInfo *info,
gint n);
GI_AVAILABLE_IN_ALL
GIFunctionInfo * g_object_info_find_method (GIObjectInfo *info,
GIFunctionInfo * gi_object_info_find_method (GIObjectInfo *info,
const gchar *name);
GI_AVAILABLE_IN_ALL
GIFunctionInfo * g_object_info_find_method_using_interfaces (GIObjectInfo *info,
const gchar *name,
GIObjectInfo **implementor);
GIFunctionInfo * gi_object_info_find_method_using_interfaces (GIObjectInfo *info,
const gchar *name,
GIObjectInfo **implementor);
GI_AVAILABLE_IN_ALL
gint g_object_info_get_n_signals (GIObjectInfo *info);
gint gi_object_info_get_n_signals (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL
GISignalInfo * g_object_info_get_signal (GIObjectInfo *info,
gint n);
GISignalInfo * gi_object_info_get_signal (GIObjectInfo *info,
gint n);
GI_AVAILABLE_IN_ALL
GISignalInfo * g_object_info_find_signal (GIObjectInfo *info,
const gchar *name);
GISignalInfo * gi_object_info_find_signal (GIObjectInfo *info,
const gchar *name);
GI_AVAILABLE_IN_ALL
gint g_object_info_get_n_vfuncs (GIObjectInfo *info);
gint gi_object_info_get_n_vfuncs (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL
GIVFuncInfo * g_object_info_get_vfunc (GIObjectInfo *info,
gint n);
GIVFuncInfo * gi_object_info_get_vfunc (GIObjectInfo *info,
gint n);
GI_AVAILABLE_IN_ALL
GIVFuncInfo * g_object_info_find_vfunc (GIObjectInfo *info,
const gchar *name);
GIVFuncInfo * gi_object_info_find_vfunc (GIObjectInfo *info,
const gchar *name);
GI_AVAILABLE_IN_ALL
GIVFuncInfo * g_object_info_find_vfunc_using_interfaces (GIObjectInfo *info,
const gchar *name,
GIObjectInfo **implementor);
GIVFuncInfo * gi_object_info_find_vfunc_using_interfaces (GIObjectInfo *info,
const gchar *name,
GIObjectInfo **implementor);
GI_AVAILABLE_IN_ALL
gint g_object_info_get_n_constants (GIObjectInfo *info);
gint gi_object_info_get_n_constants (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL
GIConstantInfo * g_object_info_get_constant (GIObjectInfo *info,
gint n);
GIConstantInfo * gi_object_info_get_constant (GIObjectInfo *info,
gint n);
GI_AVAILABLE_IN_ALL
GIStructInfo * g_object_info_get_class_struct (GIObjectInfo *info);
GIStructInfo * gi_object_info_get_class_struct (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL
const char * g_object_info_get_ref_function (GIObjectInfo *info);
const char * gi_object_info_get_ref_function (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL
GIObjectInfoRefFunction g_object_info_get_ref_function_pointer (GIObjectInfo *info);
GIObjectInfoRefFunction gi_object_info_get_ref_function_pointer (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL
const char * g_object_info_get_unref_function (GIObjectInfo *info);
const char * gi_object_info_get_unref_function (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL
GIObjectInfoUnrefFunction g_object_info_get_unref_function_pointer (GIObjectInfo *info);
GIObjectInfoUnrefFunction gi_object_info_get_unref_function_pointer (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL
const char * g_object_info_get_set_value_function (GIObjectInfo *info);
const char * gi_object_info_get_set_value_function (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL
GIObjectInfoSetValueFunction g_object_info_get_set_value_function_pointer (GIObjectInfo *info);
GIObjectInfoSetValueFunction gi_object_info_get_set_value_function_pointer (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL
const char * g_object_info_get_get_value_function (GIObjectInfo *info);
const char * gi_object_info_get_get_value_function (GIObjectInfo *info);
GI_AVAILABLE_IN_ALL
GIObjectInfoGetValueFunction g_object_info_get_get_value_function_pointer (GIObjectInfo *info);
GIObjectInfoGetValueFunction gi_object_info_get_get_value_function_pointer (GIObjectInfo *info);
G_END_DECLS

View File

@ -42,7 +42,7 @@
*/
/**
* g_property_info_get_flags:
* gi_property_info_get_flags:
* @info: a #GIPropertyInfo
*
* Obtain the flags for this property info. See #GParamFlags for
@ -51,7 +51,7 @@
* Returns: the flags
*/
GParamFlags
g_property_info_get_flags (GIPropertyInfo *info)
gi_property_info_get_flags (GIPropertyInfo *info)
{
GParamFlags flags;
GIRealInfo *rinfo = (GIRealInfo *)info;
@ -80,29 +80,29 @@ g_property_info_get_flags (GIPropertyInfo *info)
}
/**
* g_property_info_get_type:
* gi_property_info_get_type:
* @info: a #GIPropertyInfo
*
* Obtain the type information for the property @info.
*
* Returns: (transfer full): the #GITypeInfo, free it with
* g_base_info_unref() when done.
* gi_base_info_unref() when done.
*/
GITypeInfo *
g_property_info_get_type (GIPropertyInfo *info)
gi_property_info_get_type (GIPropertyInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
g_return_val_if_fail (info != NULL, NULL);
g_return_val_if_fail (GI_IS_PROPERTY_INFO (info), NULL);
return _g_type_info_new ((GIBaseInfo*)info,
rinfo->typelib,
rinfo->offset + G_STRUCT_OFFSET (PropertyBlob, type));
return _gi_type_info_new ((GIBaseInfo*)info,
rinfo->typelib,
rinfo->offset + G_STRUCT_OFFSET (PropertyBlob, type));
}
/**
* g_property_info_get_ownership_transfer:
* gi_property_info_get_ownership_transfer:
* @info: a #GIPropertyInfo
*
* Obtain the ownership transfer for this property. See #GITransfer for more
@ -111,7 +111,7 @@ g_property_info_get_type (GIPropertyInfo *info)
* Returns: the transfer
*/
GITransfer
g_property_info_get_ownership_transfer (GIPropertyInfo *info)
gi_property_info_get_ownership_transfer (GIPropertyInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
PropertyBlob *blob;
@ -130,7 +130,7 @@ g_property_info_get_ownership_transfer (GIPropertyInfo *info)
}
/**
* g_property_info_get_setter:
* gi_property_info_get_setter:
* @info: a #GIPropertyInfo
*
* Obtains the setter function associated with this #GIPropertyInfo.
@ -139,10 +139,10 @@ g_property_info_get_ownership_transfer (GIPropertyInfo *info)
* are also not %G_PARAM_CONSTRUCT_ONLY.
*
* Returns: (transfer full) (nullable): the function info or %NULL if not set.
* Free it with g_base_info_unref() when done.
* Free it with gi_base_info_unref() when done.
*/
GIFunctionInfo *
g_property_info_get_setter (GIPropertyInfo *info)
gi_property_info_get_setter (GIPropertyInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
PropertyBlob *blob;
@ -160,17 +160,17 @@ g_property_info_get_setter (GIPropertyInfo *info)
return NULL;
container = rinfo->container;
parent_type = g_base_info_get_type (container);
parent_type = gi_base_info_get_type (container);
if (parent_type == GI_INFO_TYPE_OBJECT)
return g_object_info_get_method ((GIObjectInfo *) container, blob->setter);
return gi_object_info_get_method ((GIObjectInfo *) container, blob->setter);
else if (parent_type == GI_INFO_TYPE_INTERFACE)
return g_interface_info_get_method ((GIInterfaceInfo *) container, blob->setter);
return gi_interface_info_get_method ((GIInterfaceInfo *) container, blob->setter);
else
return NULL;
}
/**
* g_property_info_get_getter:
* gi_property_info_get_getter:
* @info: a #GIPropertyInfo
*
* Obtains the getter function associated with this #GIPropertyInfo.
@ -178,10 +178,10 @@ g_property_info_get_setter (GIPropertyInfo *info)
* The setter is only available for %G_PARAM_READABLE properties.
*
* Returns: (transfer full) (nullable): the function info or %NULL if not set.
* Free it with g_base_info_unref() when done.
* Free it with gi_base_info_unref() when done.
*/
GIFunctionInfo *
g_property_info_get_getter (GIPropertyInfo *info)
gi_property_info_get_getter (GIPropertyInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
PropertyBlob *blob;
@ -199,11 +199,11 @@ g_property_info_get_getter (GIPropertyInfo *info)
return NULL;
container = rinfo->container;
parent_type = g_base_info_get_type (container);
parent_type = gi_base_info_get_type (container);
if (parent_type == GI_INFO_TYPE_OBJECT)
return g_object_info_get_method ((GIObjectInfo *) container, blob->getter);
return gi_object_info_get_method ((GIObjectInfo *) container, blob->getter);
else if (parent_type == GI_INFO_TYPE_INTERFACE)
return g_interface_info_get_method ((GIInterfaceInfo *) container, blob->getter);
return gi_interface_info_get_method ((GIInterfaceInfo *) container, blob->getter);
else
return NULL;
}

View File

@ -39,22 +39,22 @@ G_BEGIN_DECLS
* Checks if @info is a #GIPropertyInfo.
*/
#define GI_IS_PROPERTY_INFO(info) \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_PROPERTY)
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_PROPERTY)
GI_AVAILABLE_IN_ALL
GParamFlags g_property_info_get_flags (GIPropertyInfo *info);
GParamFlags gi_property_info_get_flags (GIPropertyInfo *info);
GI_AVAILABLE_IN_ALL
GITypeInfo * g_property_info_get_type (GIPropertyInfo *info);
GITypeInfo * gi_property_info_get_type (GIPropertyInfo *info);
GI_AVAILABLE_IN_ALL
GITransfer g_property_info_get_ownership_transfer (GIPropertyInfo *info);
GITransfer gi_property_info_get_ownership_transfer (GIPropertyInfo *info);
GI_AVAILABLE_IN_ALL
GIFunctionInfo *g_property_info_get_setter (GIPropertyInfo *info);
GIFunctionInfo *gi_property_info_get_setter (GIPropertyInfo *info);
GI_AVAILABLE_IN_ALL
GIFunctionInfo *g_property_info_get_getter (GIPropertyInfo *info);
GIFunctionInfo *gi_property_info_get_getter (GIPropertyInfo *info);
G_END_DECLS

View File

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

View File

@ -40,22 +40,22 @@ G_BEGIN_DECLS
* Checks if @info is a #GIRegisteredTypeInfo or derived from it.
*/
#define GI_IS_REGISTERED_TYPE_INFO(info) \
((g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_BOXED) || \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_ENUM) || \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_FLAGS) || \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_INTERFACE) || \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_OBJECT) || \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_STRUCT) || \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_UNION) || \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_BOXED))
((gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_BOXED) || \
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_ENUM) || \
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_FLAGS) || \
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_INTERFACE) || \
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_OBJECT) || \
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_STRUCT) || \
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_UNION) || \
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_BOXED))
GI_AVAILABLE_IN_ALL
const gchar * g_registered_type_info_get_type_name (GIRegisteredTypeInfo *info);
const gchar * gi_registered_type_info_get_type_name (GIRegisteredTypeInfo *info);
GI_AVAILABLE_IN_ALL
const gchar * g_registered_type_info_get_type_init (GIRegisteredTypeInfo *info);
const gchar * gi_registered_type_info_get_type_init (GIRegisteredTypeInfo *info);
GI_AVAILABLE_IN_ALL
GType g_registered_type_info_get_g_type (GIRegisteredTypeInfo *info);
GType gi_registered_type_info_get_g_type (GIRegisteredTypeInfo *info);
G_END_DECLS

View File

@ -78,38 +78,38 @@ struct _GIUnresolvedInfo
const gchar *namespace;
};
void _g_info_init (GIRealInfo *info,
GIInfoType type,
GIRepository *repository,
GIBaseInfo *container,
GITypelib *typelib,
guint32 offset);
void _gi_info_init (GIRealInfo *info,
GIInfoType type,
GIRepository *repository,
GIBaseInfo *container,
GITypelib *typelib,
guint32 offset);
GIBaseInfo * _g_info_from_entry (GIRepository *repository,
GITypelib *typelib,
guint16 index);
GIBaseInfo * _gi_info_from_entry (GIRepository *repository,
GITypelib *typelib,
guint16 index);
GIBaseInfo * _g_info_new_full (GIInfoType type,
GIRepository *repository,
GIBaseInfo *container,
GITypelib *typelib,
guint32 offset);
GIBaseInfo * _gi_info_new_full (GIInfoType type,
GIRepository *repository,
GIBaseInfo *container,
GITypelib *typelib,
guint32 offset);
GITypeInfo * _g_type_info_new (GIBaseInfo *container,
GITypelib *typelib,
guint32 offset);
GITypeInfo * _gi_type_info_new (GIBaseInfo *container,
GITypelib *typelib,
guint32 offset);
void _g_type_info_init (GIBaseInfo *info,
GIBaseInfo *container,
GITypelib *typelib,
guint32 offset);
void _gi_type_info_init (GIBaseInfo *info,
GIBaseInfo *container,
GITypelib *typelib,
guint32 offset);
GIFunctionInfo * _g_base_info_find_method (GIBaseInfo *base,
guint32 offset,
gint n_methods,
const gchar *name);
GIFunctionInfo * _gi_base_info_find_method (GIBaseInfo *base,
guint32 offset,
gint n_methods,
const gchar *name);
GIVFuncInfo * _g_base_info_find_vfunc (GIRealInfo *rinfo,
guint32 offset,
gint n_vfuncs,
const gchar *name);
GIVFuncInfo * _gi_base_info_find_vfunc (GIRealInfo *rinfo,
guint32 offset,
gint n_vfuncs,
const gchar *name);

View File

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

View File

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

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

View File

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

View File

@ -28,11 +28,11 @@
G_BEGIN_DECLS
typedef struct _GIrTypelibBuild GIrTypelibBuild;
typedef struct _GIrModule GIrModule;
typedef struct _GIIrTypelibBuild GIIrTypelibBuild;
typedef struct _GIIrModule GIIrModule;
struct _GIrTypelibBuild {
GIrModule *module;
struct _GIIrTypelibBuild {
GIIrModule *module;
GHashTable *strings;
GHashTable *types;
GList *nodes_with_attributes;
@ -41,7 +41,7 @@ struct _GIrTypelibBuild {
GList *stack;
};
struct _GIrModule
struct _GIIrModule
{
gchar *name;
gchar *version;
@ -66,20 +66,20 @@ struct _GIrModule
GHashTable *disguised_structures;
};
GIrModule *_g_ir_module_new (const gchar *name,
const gchar *nsversion,
const gchar *module_filename,
const gchar *c_prefix);
void _g_ir_module_free (GIrModule *module);
GIIrModule *_gi_ir_module_new (const gchar *name,
const gchar *nsversion,
const gchar *module_filename,
const gchar *c_prefix);
void _gi_ir_module_free (GIIrModule *module);
void _g_ir_module_add_include_module (GIrModule *module,
GIrModule *include_module);
void _gi_ir_module_add_include_module (GIIrModule *module,
GIIrModule *include_module);
GITypelib * _g_ir_module_build_typelib (GIrModule *module);
GITypelib * _gi_ir_module_build_typelib (GIIrModule *module);
void _g_ir_module_fatal (GIrTypelibBuild *build, guint line, const char *msg, ...) G_GNUC_PRINTF (3, 4) G_GNUC_NORETURN;
void _gi_ir_module_fatal (GIIrTypelibBuild *build, guint line, const char *msg, ...) G_GNUC_PRINTF (3, 4) G_GNUC_NORETURN;
void _g_irnode_init_stats (void);
void _g_irnode_dump_stats (void);
void _gi_ir_node_init_stats (void);
void _gi_ir_node_dump_stats (void);
G_END_DECLS

View File

@ -37,15 +37,15 @@
#define NUM_SECTIONS 2
GIrModule *
_g_ir_module_new (const gchar *name,
const gchar *version,
const gchar *shared_library,
const gchar *c_prefix)
GIIrModule *
_gi_ir_module_new (const gchar *name,
const gchar *version,
const gchar *shared_library,
const gchar *c_prefix)
{
GIrModule *module;
GIIrModule *module;
module = g_slice_new0 (GIrModule);
module = g_slice_new0 (GIIrModule);
module->name = g_strdup (name);
module->version = g_strdup (version);
@ -64,14 +64,14 @@ _g_ir_module_new (const gchar *name,
}
void
_g_ir_module_free (GIrModule *module)
_gi_ir_module_free (GIIrModule *module)
{
GList *e;
g_free (module->name);
for (e = module->entries; e; e = e->next)
_g_ir_node_free ((GIrNode *)e->data);
_gi_ir_node_free ((GIIrNode *)e->data);
g_list_free (module->entries);
/* Don't free dependencies, we inherit that from the parser */
@ -82,11 +82,11 @@ _g_ir_module_free (GIrModule *module)
g_hash_table_destroy (module->pointer_structures);
g_hash_table_destroy (module->disguised_structures);
g_slice_free (GIrModule, module);
g_slice_free (GIIrModule, module);
}
/**
* _g_ir_module_fatal:
* _gi_ir_module_fatal:
* @build: Current build
* @line: Origin line number, or 0 if unknown
* @msg: printf-format string
@ -95,10 +95,10 @@ _g_ir_module_free (GIrModule *module)
* Report a fatal error, then exit.
*/
void
_g_ir_module_fatal (GIrTypelibBuild *build,
guint line,
const char *msg,
...)
_gi_ir_module_fatal (GIIrTypelibBuild *build,
guint line,
const char *msg,
...)
{
GString *context;
char *formatted;
@ -117,7 +117,7 @@ _g_ir_module_fatal (GIrTypelibBuild *build,
g_string_append (context, "In ");
for (link = g_list_last (build->stack); link; link = link->prev)
{
GIrNode *node = link->data;
GIIrNode *node = link->data;
const char *name = node->name;
if (name)
g_string_append (context, name);
@ -142,7 +142,7 @@ add_alias_foreach (gpointer key,
gpointer value,
gpointer data)
{
GIrModule *module = data;
GIIrModule *module = data;
g_hash_table_replace (module->aliases, g_strdup (key), g_strdup (value));
}
@ -152,7 +152,7 @@ add_pointer_structure_foreach (gpointer key,
gpointer value,
gpointer data)
{
GIrModule *module = data;
GIIrModule *module = data;
g_hash_table_replace (module->pointer_structures, g_strdup (key), value);
}
@ -162,14 +162,14 @@ add_disguised_structure_foreach (gpointer key,
gpointer value,
gpointer data)
{
GIrModule *module = data;
GIIrModule *module = data;
g_hash_table_replace (module->disguised_structures, g_strdup (key), value);
}
void
_g_ir_module_add_include_module (GIrModule *module,
GIrModule *include_module)
_gi_ir_module_add_include_module (GIIrModule *module,
GIIrModule *include_module)
{
module->include_modules = g_list_prepend (module->include_modules,
include_module);
@ -190,7 +190,7 @@ struct AttributeWriteData
{
guint count;
guchar *databuf;
GIrNode *node;
GIIrNode *node;
GHashTable *strings;
guint32 *offset;
guint32 *offset2;
@ -206,19 +206,19 @@ write_attribute (gpointer key, gpointer value, gpointer datap)
*(data->offset) += sizeof (AttributeBlob);
blob->offset = data->node->offset;
blob->name = _g_ir_write_string ((const char*) key, data->strings, data->databuf, data->offset2);
blob->value = _g_ir_write_string ((const char*) value, data->strings, data->databuf, data->offset2);
blob->name = _gi_ir_write_string ((const char*) key, data->strings, data->databuf, data->offset2);
blob->value = _gi_ir_write_string ((const char*) value, data->strings, data->databuf, data->offset2);
data->count++;
}
static guint
write_attributes (GIrModule *module,
GIrNode *node,
GHashTable *strings,
guchar *data,
guint32 *offset,
guint32 *offset2)
write_attributes (GIIrModule *module,
GIIrNode *node,
GHashTable *strings,
guchar *data,
guint32 *offset,
guint32 *offset2)
{
struct AttributeWriteData wdata;
wdata.count = 0;
@ -237,8 +237,8 @@ static gint
node_cmp_offset_func (gconstpointer a,
gconstpointer b)
{
const GIrNode *na = a;
const GIrNode *nb = b;
const GIIrNode *na = a;
const GIIrNode *nb = b;
return na->offset - nb->offset;
}
@ -265,7 +265,7 @@ alloc_section (guint8 *data, SectionType section_id, guint32 offset)
}
static guint8*
add_directory_index_section (guint8 *data, GIrModule *module, guint32 *offset2)
add_directory_index_section (guint8 *data, GIIrModule *module, guint32 *offset2)
{
DirEntry *entry;
Header *header = (Header*)data;
@ -313,7 +313,7 @@ add_directory_index_section (guint8 *data, GIrModule *module, guint32 *offset2)
}
GITypelib *
_g_ir_module_build_typelib (GIrModule *module)
_gi_ir_module_build_typelib (GIIrModule *module)
{
GError *error = NULL;
GITypelib *typelib;
@ -360,7 +360,7 @@ _g_ir_module_build_typelib (GIrModule *module)
}
restart:
_g_irnode_init_stats ();
_gi_ir_node_init_stats ();
strings = g_hash_table_new (g_str_hash, g_str_equal);
types = g_hash_table_new (g_str_hash, g_str_equal);
nodes_with_attributes = NULL;
@ -376,9 +376,9 @@ _g_ir_module_build_typelib (GIrModule *module)
for (e = module->entries; e; e = e->next)
{
GIrNode *node = e->data;
GIIrNode *node = e->data;
size += _g_ir_node_get_full_size (node);
size += _gi_ir_node_get_full_size (node);
/* Also reset the offset here */
node->offset = 0;
@ -402,7 +402,7 @@ _g_ir_module_build_typelib (GIrModule *module)
/* fill in header */
header = (Header *)data;
memcpy (header, G_IR_MAGIC, 16);
memcpy (header, GI_IR_MAGIC, 16);
header->major_version = 4;
header->minor_version = 0;
header->reserved = 0;
@ -414,17 +414,17 @@ _g_ir_module_build_typelib (GIrModule *module)
* the size calculations above.
*/
if (dependencies != NULL)
header->dependencies = _g_ir_write_string (dependencies, strings, data, &header_size);
header->dependencies = _gi_ir_write_string (dependencies, strings, data, &header_size);
else
header->dependencies = 0;
header->size = 0; /* filled in later */
header->namespace = _g_ir_write_string (module->name, strings, data, &header_size);
header->nsversion = _g_ir_write_string (module->version, strings, data, &header_size);
header->namespace = _gi_ir_write_string (module->name, strings, data, &header_size);
header->nsversion = _gi_ir_write_string (module->version, strings, data, &header_size);
header->shared_library = (module->shared_library?
_g_ir_write_string (module->shared_library, strings, data, &header_size)
_gi_ir_write_string (module->shared_library, strings, data, &header_size)
: 0);
if (module->c_prefix != NULL)
header->c_prefix = _g_ir_write_string (module->c_prefix, strings, data, &header_size);
header->c_prefix = _gi_ir_write_string (module->c_prefix, strings, data, &header_size);
else
header->c_prefix = 0;
header->entry_blob_size = sizeof (DirEntry);
@ -469,8 +469,8 @@ _g_ir_module_build_typelib (GIrModule *module)
for (e = module->entries, i = 0; e; e = e->next, i++)
{
GIrTypelibBuild build;
GIrNode *node = e->data;
GIIrTypelibBuild build;
GIIrNode *node = e->data;
if (strchr (node->name, '.'))
{
@ -488,7 +488,7 @@ _g_ir_module_build_typelib (GIrModule *module)
/* Reset the cached offsets */
for (link = nodes_with_attributes; link; link = link->next)
((GIrNode *) link->data)->offset = 0;
((GIIrNode *) link->data)->offset = 0;
g_list_free (nodes_with_attributes);
strings = NULL;
@ -501,24 +501,24 @@ _g_ir_module_build_typelib (GIrModule *module)
offset = offset2;
if (node->type == G_IR_NODE_XREF)
if (node->type == GI_IR_NODE_XREF)
{
const char *namespace = ((GIrNodeXRef*)node)->namespace;
const char *namespace = ((GIIrNodeXRef*)node)->namespace;
entry->blob_type = 0;
entry->local = FALSE;
entry->offset = _g_ir_write_string (namespace, strings, data, &offset2);
entry->name = _g_ir_write_string (node->name, strings, data, &offset2);
entry->offset = _gi_ir_write_string (namespace, strings, data, &offset2);
entry->name = _gi_ir_write_string (node->name, strings, data, &offset2);
}
else
{
old_offset = offset;
offset2 = offset + _g_ir_node_get_size (node);
offset2 = offset + _gi_ir_node_get_size (node);
entry->blob_type = node->type;
entry->local = TRUE;
entry->offset = offset;
entry->name = _g_ir_write_string (node->name, strings, data, &offset2);
entry->name = _gi_ir_write_string (node->name, strings, data, &offset2);
memset (&build, 0, sizeof (build));
build.module = module;
@ -527,13 +527,13 @@ _g_ir_module_build_typelib (GIrModule *module)
build.nodes_with_attributes = nodes_with_attributes;
build.n_attributes = header->n_attributes;
build.data = data;
_g_ir_node_build_typelib (node, NULL, &build, &offset, &offset2, NULL);
_gi_ir_node_build_typelib (node, NULL, &build, &offset, &offset2, NULL);
nodes_with_attributes = build.nodes_with_attributes;
header->n_attributes = build.n_attributes;
if (offset2 > old_offset + _g_ir_node_get_full_size (node))
g_error ("left a hole of %d bytes\n", offset2 - old_offset - _g_ir_node_get_full_size (node));
if (offset2 > old_offset + _gi_ir_node_get_full_size (node))
g_error ("left a hole of %d bytes\n", offset2 - old_offset - _gi_ir_node_get_full_size (node));
}
entry++;
@ -544,7 +544,7 @@ _g_ir_module_build_typelib (GIrModule *module)
g_message ("header: %d entries, %d attributes", header->n_entries, header->n_attributes);
_g_irnode_dump_stats ();
_gi_ir_node_dump_stats ();
/* Write attributes after the blobs */
offset = offset2;
@ -553,7 +553,7 @@ _g_ir_module_build_typelib (GIrModule *module)
for (e = nodes_with_attributes; e; e = e->next)
{
GIrNode *node = e->data;
GIIrNode *node = e->data;
write_attributes (module, node, strings, data, &offset, &offset2);
}
@ -566,7 +566,7 @@ _g_ir_module_build_typelib (GIrModule *module)
header = (Header *)data;
length = header->size = offset2;
typelib = g_typelib_new_from_memory (data, length, &error);
typelib = gi_typelib_new_from_memory (data, length, &error);
if (!typelib)
{
g_error ("error building typelib: %s",

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

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

View File

@ -40,16 +40,16 @@ G_BEGIN_DECLS
* Checks if @info is a #GISignalInfo.
*/
#define GI_IS_SIGNAL_INFO(info) \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_SIGNAL)
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_SIGNAL)
GI_AVAILABLE_IN_ALL
GSignalFlags g_signal_info_get_flags (GISignalInfo *info);
GSignalFlags gi_signal_info_get_flags (GISignalInfo *info);
GI_AVAILABLE_IN_ALL
GIVFuncInfo * g_signal_info_get_class_closure (GISignalInfo *info);
GIVFuncInfo * gi_signal_info_get_class_closure (GISignalInfo *info);
GI_AVAILABLE_IN_ALL
gboolean g_signal_info_true_stops_emit (GISignalInfo *info);
gboolean gi_signal_info_true_stops_emit (GISignalInfo *info);
G_END_DECLS

View File

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

View File

@ -39,47 +39,47 @@ G_BEGIN_DECLS
* Checks if @info is a #GIStructInfo.
*/
#define GI_IS_STRUCT_INFO(info) \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_STRUCT)
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_STRUCT)
GI_AVAILABLE_IN_ALL
gint g_struct_info_get_n_fields (GIStructInfo *info);
gint gi_struct_info_get_n_fields (GIStructInfo *info);
GI_AVAILABLE_IN_ALL
GIFieldInfo * g_struct_info_get_field (GIStructInfo *info,
gint n);
GIFieldInfo * gi_struct_info_get_field (GIStructInfo *info,
gint n);
GI_AVAILABLE_IN_ALL
GIFieldInfo * g_struct_info_find_field (GIStructInfo *info,
const gchar *name);
GIFieldInfo * gi_struct_info_find_field (GIStructInfo *info,
const gchar *name);
GI_AVAILABLE_IN_ALL
gint g_struct_info_get_n_methods (GIStructInfo *info);
gint gi_struct_info_get_n_methods (GIStructInfo *info);
GI_AVAILABLE_IN_ALL
GIFunctionInfo * g_struct_info_get_method (GIStructInfo *info,
gint n);
GIFunctionInfo * gi_struct_info_get_method (GIStructInfo *info,
gint n);
GI_AVAILABLE_IN_ALL
GIFunctionInfo * g_struct_info_find_method (GIStructInfo *info,
const gchar *name);
GIFunctionInfo * gi_struct_info_find_method (GIStructInfo *info,
const gchar *name);
GI_AVAILABLE_IN_ALL
gsize g_struct_info_get_size (GIStructInfo *info);
gsize gi_struct_info_get_size (GIStructInfo *info);
GI_AVAILABLE_IN_ALL
gsize g_struct_info_get_alignment (GIStructInfo *info);
gsize gi_struct_info_get_alignment (GIStructInfo *info);
GI_AVAILABLE_IN_ALL
gboolean g_struct_info_is_gtype_struct (GIStructInfo *info);
gboolean gi_struct_info_is_gtype_struct (GIStructInfo *info);
GI_AVAILABLE_IN_ALL
gboolean g_struct_info_is_foreign (GIStructInfo *info);
gboolean gi_struct_info_is_foreign (GIStructInfo *info);
GI_AVAILABLE_IN_ALL
const char * g_struct_info_get_copy_function (GIStructInfo *info);
const char * gi_struct_info_get_copy_function (GIStructInfo *info);
GI_AVAILABLE_IN_ALL
const char * g_struct_info_get_free_function (GIStructInfo *info);
const char * gi_struct_info_get_free_function (GIStructInfo *info);
G_END_DECLS

View File

@ -45,12 +45,12 @@
*
* A type can either be a of a basic type which is a standard C primitive
* type or an interface type. For interface types you need to call
* g_type_info_get_interface() to get a reference to the base info for that
* gi_type_info_get_interface() to get a reference to the base info for that
* interface.
*/
/**
* g_type_info_is_pointer:
* gi_type_info_is_pointer:
* @info: a #GITypeInfo
*
* Obtain if the type is passed as a reference.
@ -63,7 +63,7 @@
* Returns: %TRUE if it is a pointer
*/
gboolean
g_type_info_is_pointer (GITypeInfo *info)
gi_type_info_is_pointer (GITypeInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
SimpleTypeBlob *type;
@ -84,7 +84,7 @@ g_type_info_is_pointer (GITypeInfo *info)
}
/**
* g_type_info_get_tag:
* gi_type_info_get_tag:
* @info: a #GITypeInfo
*
* Obtain the type tag for the type. See #GITypeTag for a list
@ -93,7 +93,7 @@ g_type_info_is_pointer (GITypeInfo *info)
* Returns: the type tag
*/
GITypeTag
g_type_info_get_tag (GITypeInfo *info)
gi_type_info_get_tag (GITypeInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
SimpleTypeBlob *type;
@ -116,7 +116,7 @@ g_type_info_get_tag (GITypeInfo *info)
}
/**
* g_type_info_get_param_type:
* gi_type_info_get_param_type:
* @info: a #GITypeInfo
* @n: index of the parameter
*
@ -125,8 +125,8 @@ g_type_info_get_tag (GITypeInfo *info)
* Returns: (transfer full): the param type info
*/
GITypeInfo *
g_type_info_get_param_type (GITypeInfo *info,
gint n)
gi_type_info_get_param_type (GITypeInfo *info,
gint n)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
SimpleTypeBlob *type;
@ -146,9 +146,9 @@ g_type_info_get_param_type (GITypeInfo *info,
case GI_TYPE_TAG_GLIST:
case GI_TYPE_TAG_GSLIST:
case GI_TYPE_TAG_GHASH:
return _g_type_info_new ((GIBaseInfo*)info, rinfo->typelib,
rinfo->offset + sizeof (ParamTypeBlob)
+ sizeof (SimpleTypeBlob) * n);
return _gi_type_info_new ((GIBaseInfo*)info, rinfo->typelib,
rinfo->offset + sizeof (ParamTypeBlob)
+ sizeof (SimpleTypeBlob) * n);
break;
default:
break;
@ -159,19 +159,19 @@ g_type_info_get_param_type (GITypeInfo *info,
}
/**
* g_type_info_get_interface:
* gi_type_info_get_interface:
* @info: a #GITypeInfo
*
* For types which have #GI_TYPE_TAG_INTERFACE such as GObjects and boxed values,
* this function returns full information about the referenced type. You can then
* inspect the type of the returned #GIBaseInfo to further query whether it is
* a concrete GObject, a GInterface, a structure, etc. using g_base_info_get_type().
* a concrete GObject, a GInterface, a structure, etc. using gi_base_info_get_type().
*
* Returns: (transfer full): the #GIBaseInfo, or %NULL. Free it with
* g_base_info_unref() when done.
* gi_base_info_unref() when done.
*/
GIBaseInfo *
g_type_info_get_interface (GITypeInfo *info)
gi_type_info_get_interface (GITypeInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
@ -196,8 +196,8 @@ g_type_info_get_interface (GITypeInfo *info)
g_assert_not_reached ();
return NULL;
}
return (GIBaseInfo *) g_info_new (info_type, (GIBaseInfo*)info, rinfo->typelib,
rinfo->offset);
return (GIBaseInfo *) gi_info_new (info_type, (GIBaseInfo*)info, rinfo->typelib,
rinfo->offset);
}
else
{
@ -207,7 +207,7 @@ g_type_info_get_interface (GITypeInfo *info)
InterfaceTypeBlob *blob = (InterfaceTypeBlob *)&rinfo->typelib->data[rinfo->offset];
if (blob->tag == GI_TYPE_TAG_INTERFACE)
return _g_info_from_entry (rinfo->repository, rinfo->typelib, blob->interface);
return _gi_info_from_entry (rinfo->repository, rinfo->typelib, blob->interface);
}
}
@ -215,7 +215,7 @@ g_type_info_get_interface (GITypeInfo *info)
}
/**
* g_type_info_get_array_length:
* gi_type_info_get_array_length:
* @info: a #GITypeInfo
*
* Obtain the position of the argument which gives the array length of the type.
@ -224,7 +224,7 @@ g_type_info_get_interface (GITypeInfo *info)
* Returns: the array length, or -1 if the type is not an array
*/
gint
g_type_info_get_array_length (GITypeInfo *info)
gi_type_info_get_array_length (GITypeInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
SimpleTypeBlob *type;
@ -249,7 +249,7 @@ g_type_info_get_array_length (GITypeInfo *info)
}
/**
* g_type_info_get_array_fixed_size:
* gi_type_info_get_array_fixed_size:
* @info: a #GITypeInfo
*
* Obtain the fixed array size of the type. The type tag must be a
@ -258,7 +258,7 @@ g_type_info_get_array_length (GITypeInfo *info)
* Returns: the size or -1 if it's not an array
*/
gint
g_type_info_get_array_fixed_size (GITypeInfo *info)
gi_type_info_get_array_fixed_size (GITypeInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
SimpleTypeBlob *type;
@ -283,7 +283,7 @@ g_type_info_get_array_fixed_size (GITypeInfo *info)
}
/**
* g_type_info_is_zero_terminated:
* gi_type_info_is_zero_terminated:
* @info: a #GITypeInfo
*
* Obtain if the last element of the array is %NULL. The type tag must be a
@ -292,7 +292,7 @@ g_type_info_get_array_fixed_size (GITypeInfo *info)
* Returns: %TRUE if zero terminated
*/
gboolean
g_type_info_is_zero_terminated (GITypeInfo *info)
gi_type_info_is_zero_terminated (GITypeInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
SimpleTypeBlob *type;
@ -314,7 +314,7 @@ g_type_info_is_zero_terminated (GITypeInfo *info)
}
/**
* g_type_info_get_array_type:
* gi_type_info_get_array_type:
* @info: a #GITypeInfo
*
* Obtain the array type for this type. See #GIArrayType for a list of
@ -324,7 +324,7 @@ g_type_info_is_zero_terminated (GITypeInfo *info)
* Returns: the array type or -1
*/
GIArrayType
g_type_info_get_array_type (GITypeInfo *info)
gi_type_info_get_array_type (GITypeInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo *)info;
SimpleTypeBlob *type;
@ -346,7 +346,7 @@ g_type_info_get_array_type (GITypeInfo *info)
}
/**
* g_type_info_get_storage_type:
* gi_type_info_get_storage_type:
* @info: a #GITypeInfo
*
* Obtain the type tag corresponding to the underlying storage type in C for
@ -358,17 +358,17 @@ g_type_info_get_array_type (GITypeInfo *info)
* Since: 1.66
*/
GITypeTag
g_type_info_get_storage_type (GITypeInfo *info)
gi_type_info_get_storage_type (GITypeInfo *info)
{
GITypeTag type_tag = g_type_info_get_tag (info);
GITypeTag type_tag = gi_type_info_get_tag (info);
if (type_tag == GI_TYPE_TAG_INTERFACE)
{
GIBaseInfo *interface = g_type_info_get_interface (info);
GIInfoType info_type = g_base_info_get_type (interface);
GIBaseInfo *interface = gi_type_info_get_interface (info);
GIInfoType info_type = gi_base_info_get_type (interface);
if (info_type == GI_INFO_TYPE_ENUM || info_type == GI_INFO_TYPE_FLAGS)
type_tag = g_enum_info_get_storage_type (interface);
g_base_info_unref (interface);
type_tag = gi_enum_info_get_storage_type (interface);
gi_base_info_unref (interface);
}
return type_tag;
@ -376,7 +376,7 @@ g_type_info_get_storage_type (GITypeInfo *info)
/**
* gi_type_tag_argument_from_hash_pointer:
* @storage_type: a #GITypeTag obtained from g_type_info_get_storage_type()
* @storage_type: a #GITypeTag obtained from gi_type_info_get_storage_type()
* @hash_pointer: A pointer, such as a #GHashTable data pointer
* @arg: A #GIArgument to fill in
*
@ -442,13 +442,13 @@ gi_type_tag_argument_from_hash_pointer (GITypeTag storage_type,
case GI_TYPE_TAG_DOUBLE:
default:
g_critical ("Unsupported storage type for pointer-stuffing: %s",
g_type_tag_to_string (storage_type));
gi_type_tag_to_string (storage_type));
arg->v_pointer = hash_pointer;
}
}
/**
* g_type_info_argument_from_hash_pointer:
* gi_type_info_argument_from_hash_pointer:
* @info: a #GITypeInfo
* @hash_pointer: A pointer, such as a #GHashTable data pointer
* @arg: A #GIArgument to fill in
@ -468,18 +468,18 @@ gi_type_tag_argument_from_hash_pointer (GITypeTag storage_type,
* Since: 1.66
*/
void
g_type_info_argument_from_hash_pointer (GITypeInfo *info,
gpointer hash_pointer,
GIArgument *arg)
gi_type_info_argument_from_hash_pointer (GITypeInfo *info,
gpointer hash_pointer,
GIArgument *arg)
{
GITypeTag storage_type = g_type_info_get_storage_type (info);
GITypeTag storage_type = gi_type_info_get_storage_type (info);
gi_type_tag_argument_from_hash_pointer (storage_type, hash_pointer,
arg);
}
/**
* gi_type_tag_hash_pointer_from_argument:
* @storage_type: a #GITypeTag obtained from g_type_info_get_storage_type()
* @storage_type: a #GITypeTag obtained from gi_get_storage_type()
* @arg: A #GIArgument with the value to stuff into a pointer
*
* GLib data structures, such as #GList, #GSList, and #GHashTable, all store
@ -536,13 +536,13 @@ gi_type_tag_hash_pointer_from_argument (GITypeTag storage_type,
case GI_TYPE_TAG_DOUBLE:
default:
g_critical ("Unsupported storage type for pointer-stuffing: %s",
g_type_tag_to_string (storage_type));
gi_type_tag_to_string (storage_type));
return arg->v_pointer;
}
}
/**
* g_type_info_hash_pointer_from_argument:
* gi_type_info_hash_pointer_from_argument:
* @info: a #GITypeInfo
* @arg: A #GIArgument with the value to stuff into a pointer
*
@ -563,9 +563,9 @@ gi_type_tag_hash_pointer_from_argument (GITypeTag storage_type,
* Since: 1.66
*/
gpointer
g_type_info_hash_pointer_from_argument (GITypeInfo *info,
GIArgument *arg)
gi_type_info_hash_pointer_from_argument (GITypeInfo *info,
GIArgument *arg)
{
GITypeTag storage_type = g_type_info_get_storage_type (info);
GITypeTag storage_type = gi_type_info_get_storage_type (info);
return gi_type_tag_hash_pointer_from_argument (storage_type, arg);
}

View File

@ -39,7 +39,7 @@ G_BEGIN_DECLS
* Checks if @info is a #GITypeInfo.
*/
#define GI_IS_TYPE_INFO(info) \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_TYPE)
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_TYPE)
/**
* GI_TYPE_TAG_IS_BASIC
@ -86,7 +86,7 @@ G_BEGIN_DECLS
* @tag: a type tag
*
* Checks if @tag is a container type. That is, a type which may have a nonnull
* return from g_type_info_get_param_type().
* return from gi_type_info_get_param_type().
*
* Since: 1.72
*/
@ -94,48 +94,48 @@ G_BEGIN_DECLS
((tag) >= GI_TYPE_TAG_GLIST && (tag) <= GI_TYPE_TAG_GHASH))
GI_AVAILABLE_IN_ALL
const gchar* g_type_tag_to_string (GITypeTag type);
const gchar* gi_type_tag_to_string (GITypeTag type);
GI_AVAILABLE_IN_ALL
const gchar* g_info_type_to_string (GIInfoType type);
const gchar* gi_info_type_to_string (GIInfoType type);
GI_AVAILABLE_IN_ALL
gboolean g_type_info_is_pointer (GITypeInfo *info);
gboolean gi_type_info_is_pointer (GITypeInfo *info);
GI_AVAILABLE_IN_ALL
GITypeTag g_type_info_get_tag (GITypeInfo *info);
GITypeTag gi_type_info_get_tag (GITypeInfo *info);
GI_AVAILABLE_IN_ALL
GITypeInfo * g_type_info_get_param_type (GITypeInfo *info,
gint n);
GITypeInfo * gi_type_info_get_param_type (GITypeInfo *info,
gint n);
GI_AVAILABLE_IN_ALL
GIBaseInfo * g_type_info_get_interface (GITypeInfo *info);
GIBaseInfo * gi_type_info_get_interface (GITypeInfo *info);
GI_AVAILABLE_IN_ALL
gint g_type_info_get_array_length (GITypeInfo *info);
gint gi_type_info_get_array_length (GITypeInfo *info);
GI_AVAILABLE_IN_ALL
gint g_type_info_get_array_fixed_size(GITypeInfo *info);
gint gi_type_info_get_array_fixed_size(GITypeInfo *info);
GI_AVAILABLE_IN_ALL
gboolean g_type_info_is_zero_terminated (GITypeInfo *info);
gboolean gi_type_info_is_zero_terminated (GITypeInfo *info);
GI_AVAILABLE_IN_ALL
GIArrayType g_type_info_get_array_type (GITypeInfo *info);
GIArrayType gi_type_info_get_array_type (GITypeInfo *info);
GI_AVAILABLE_IN_ALL
GITypeTag g_type_info_get_storage_type (GITypeInfo *info);
GITypeTag gi_type_info_get_storage_type (GITypeInfo *info);
GI_AVAILABLE_IN_ALL
void g_type_info_argument_from_hash_pointer (GITypeInfo *info,
gpointer hash_pointer,
GIArgument *arg);
void gi_type_info_argument_from_hash_pointer (GITypeInfo *info,
gpointer hash_pointer,
GIArgument *arg);
GI_AVAILABLE_IN_ALL
gpointer g_type_info_hash_pointer_from_argument (GITypeInfo *info,
GIArgument *arg);
gpointer gi_type_info_hash_pointer_from_argument (GITypeInfo *info,
GIArgument *arg);
GI_AVAILABLE_IN_ALL
void gi_type_tag_argument_from_hash_pointer (GITypeTag storage_type,

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

@ -39,49 +39,49 @@ G_BEGIN_DECLS
* Checks if @info is a #GIUnionInfo.
*/
#define GI_IS_UNION_INFO(info) \
(g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_UNION)
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_UNION)
GI_AVAILABLE_IN_ALL
gint g_union_info_get_n_fields (GIUnionInfo *info);
gint gi_union_info_get_n_fields (GIUnionInfo *info);
GI_AVAILABLE_IN_ALL
GIFieldInfo * g_union_info_get_field (GIUnionInfo *info,
gint n);
GIFieldInfo * gi_union_info_get_field (GIUnionInfo *info,
gint n);
GI_AVAILABLE_IN_ALL
gint g_union_info_get_n_methods (GIUnionInfo *info);
gint gi_union_info_get_n_methods (GIUnionInfo *info);
GI_AVAILABLE_IN_ALL
GIFunctionInfo * g_union_info_get_method (GIUnionInfo *info,
gint n);
GIFunctionInfo * gi_union_info_get_method (GIUnionInfo *info,
gint n);
GI_AVAILABLE_IN_ALL
gboolean g_union_info_is_discriminated (GIUnionInfo *info);
gboolean gi_union_info_is_discriminated (GIUnionInfo *info);
GI_AVAILABLE_IN_ALL
gint g_union_info_get_discriminator_offset (GIUnionInfo *info);
gint gi_union_info_get_discriminator_offset (GIUnionInfo *info);
GI_AVAILABLE_IN_ALL
GITypeInfo * g_union_info_get_discriminator_type (GIUnionInfo *info);
GITypeInfo * gi_union_info_get_discriminator_type (GIUnionInfo *info);
GI_AVAILABLE_IN_ALL
GIConstantInfo * g_union_info_get_discriminator (GIUnionInfo *info,
gint n);
GIConstantInfo * gi_union_info_get_discriminator (GIUnionInfo *info,
gint n);
GI_AVAILABLE_IN_ALL
GIFunctionInfo * g_union_info_find_method (GIUnionInfo *info,
GIFunctionInfo * gi_union_info_find_method (GIUnionInfo *info,
const gchar *name);
GI_AVAILABLE_IN_ALL
gsize g_union_info_get_size (GIUnionInfo *info);
gsize gi_union_info_get_size (GIUnionInfo *info);
GI_AVAILABLE_IN_ALL
gsize g_union_info_get_alignment (GIUnionInfo *info);
gsize gi_union_info_get_alignment (GIUnionInfo *info);
GI_AVAILABLE_IN_ALL
const char * g_union_info_get_copy_function (GIUnionInfo *info);
const char * gi_union_info_get_copy_function (GIUnionInfo *info);
GI_AVAILABLE_IN_ALL
const char * g_union_info_get_free_function (GIUnionInfo *info);
const char * gi_union_info_get_free_function (GIUnionInfo *info);
G_END_DECLS

View File

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

View File

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