girepository: Rename gi_base_info_get_type() to get_info_type()

This method doesn’t return a `GType`, so when the code gets ported to
`GTypeInstance` in an upcoming commit, that will become quite confusing.

Rename it to `gi_base_info_get_info_type()` instead.

This introduces no functional changes, but it is an API break.

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

Helps: #3155
This commit is contained in:
Philip Withnall 2023-12-12 16:16:30 +00:00
parent aa50e6fd9d
commit 64ad0ecebc
26 changed files with 59 additions and 59 deletions

View File

@ -39,7 +39,7 @@ G_BEGIN_DECLS
* Checks if @info is a GIArgInfo.
*/
#define GI_IS_ARG_INFO(info) \
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_ARG)
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_ARG)
GI_AVAILABLE_IN_ALL

View File

@ -278,7 +278,7 @@ gi_base_info_unref (GIBaseInfo *info)
}
/**
* gi_base_info_get_type:
* gi_base_info_get_info_type:
* @info: a #GIBaseInfo
*
* Obtain the info type of the GIBaseInfo.
@ -286,7 +286,7 @@ gi_base_info_unref (GIBaseInfo *info)
* Returns: the info type of @info
*/
GIInfoType
gi_base_info_get_type (GIBaseInfo *info)
gi_base_info_get_info_type (GIBaseInfo *info)
{
return ((GIRealInfo*)info)->type;
@ -307,7 +307,7 @@ gi_base_info_get_name (GIBaseInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo*)info;
g_assert (rinfo->ref_count > 0);
switch (gi_base_info_get_type ((GIBaseInfo *) info))
switch (gi_base_info_get_info_type ((GIBaseInfo *) info))
{
case GI_INFO_TYPE_FUNCTION:
case GI_INFO_TYPE_CALLBACK:
@ -407,7 +407,7 @@ gi_base_info_get_namespace (GIBaseInfo *info)
g_assert (rinfo->ref_count > 0);
if (gi_base_info_get_type (info) == GI_INFO_TYPE_UNRESOLVED)
if (gi_base_info_get_info_type (info) == GI_INFO_TYPE_UNRESOLVED)
{
GIUnresolvedInfo *unresolved = (GIUnresolvedInfo *)info;
@ -430,7 +430,7 @@ gboolean
gi_base_info_is_deprecated (GIBaseInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo*) info;
switch (gi_base_info_get_type ((GIBaseInfo *) info))
switch (gi_base_info_get_info_type ((GIBaseInfo *) info))
{
case GI_INFO_TYPE_FUNCTION:
case GI_INFO_TYPE_CALLBACK:

View File

@ -61,7 +61,7 @@ GI_AVAILABLE_IN_ALL
void gi_base_info_unref (GIBaseInfo *info);
GI_AVAILABLE_IN_ALL
GIInfoType gi_base_info_get_type (GIBaseInfo *info);
GIInfoType gi_base_info_get_info_type (GIBaseInfo *info);
GI_AVAILABLE_IN_ALL
const gchar * gi_base_info_get_name (GIBaseInfo *info);

View File

@ -59,7 +59,7 @@ signature_offset (GICallableInfo *info)
GIRealInfo *rinfo = (GIRealInfo*)info;
int sigoff = -1;
switch (gi_base_info_get_type ((GIBaseInfo *) info))
switch (gi_base_info_get_info_type ((GIBaseInfo *) info))
{
case GI_INFO_TYPE_FUNCTION:
sigoff = G_STRUCT_OFFSET (FunctionBlob, signature);
@ -105,7 +105,7 @@ gi_callable_info_can_throw_gerror (GICallableInfo *info)
* to support the other callables. For Functions and VFuncs,
* also check their legacy flag for compatibility.
*/
switch (gi_base_info_get_type ((GIBaseInfo *) info)) {
switch (gi_base_info_get_info_type ((GIBaseInfo *) info)) {
case GI_INFO_TYPE_FUNCTION:
{
FunctionBlob *blob;
@ -147,7 +147,7 @@ gboolean
gi_callable_info_is_method (GICallableInfo *info)
{
GIRealInfo *rinfo = (GIRealInfo*)info;
switch (gi_base_info_get_type ((GIBaseInfo *) info)) {
switch (gi_base_info_get_info_type ((GIBaseInfo *) info)) {
case GI_INFO_TYPE_FUNCTION:
{
FunctionBlob *blob;
@ -573,7 +573,7 @@ gi_type_info_extract_ffi_return_value (GITypeInfo *return_info,
if (return_tag == GI_TYPE_TAG_INTERFACE)
{
GIBaseInfo *interface_info = gi_type_info_get_interface (return_info);
interface_type = gi_base_info_get_type (interface_info);
interface_type = gi_base_info_get_info_type (interface_info);
gi_base_info_unref (interface_info);
}

View File

@ -39,10 +39,10 @@ G_BEGIN_DECLS
* Checks if @info is a #GICallableInfo or derived from it.
*/
#define GI_IS_CALLABLE_INFO(info) \
((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_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_FUNCTION) || \
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_CALLBACK) || \
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_SIGNAL) || \
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_VFUNC))
GI_AVAILABLE_IN_ALL

View File

@ -39,7 +39,7 @@ G_BEGIN_DECLS
* Checks if @info is a #GIConstantInfo.
*/
#define GI_IS_CONSTANT_INFO(info) \
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_CONSTANT)
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_CONSTANT)
GI_AVAILABLE_IN_ALL

View File

@ -39,8 +39,8 @@ G_BEGIN_DECLS
* Checks if @info is a #GIEnumInfo.
*/
#define GI_IS_ENUM_INFO(info) \
((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_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_ENUM) || \
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_FLAGS))
/**
* GI_IS_VALUE_INFO
@ -49,7 +49,7 @@ G_BEGIN_DECLS
* Checks if @info is a #GIValueInfo.
*/
#define GI_IS_VALUE_INFO(info) \
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_VALUE)
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_VALUE)
GI_AVAILABLE_IN_ALL

View File

@ -263,7 +263,7 @@ gi_field_info_get_field (GIFieldInfo *field_info,
case GI_TYPE_TAG_INTERFACE:
{
GIBaseInfo *interface = gi_type_info_get_interface (type_info);
switch (gi_base_info_get_type (interface))
switch (gi_base_info_get_info_type (interface))
{
case GI_INFO_TYPE_STRUCT:
case GI_INFO_TYPE_UNION:
@ -317,7 +317,7 @@ gi_field_info_get_field (GIFieldInfo *field_info,
case GI_INFO_TYPE_CALLBACK:
g_warning("Field %s: Interface type %d should have is_pointer set",
gi_base_info_get_name ((GIBaseInfo *)field_info),
gi_base_info_get_type (interface));
gi_base_info_get_info_type (interface));
break;
case GI_INFO_TYPE_INVALID:
case GI_INFO_TYPE_INTERFACE:
@ -333,7 +333,7 @@ gi_field_info_get_field (GIFieldInfo *field_info,
case GI_INFO_TYPE_UNRESOLVED:
g_warning("Field %s: Interface type %d not expected",
gi_base_info_get_name ((GIBaseInfo *)field_info),
gi_base_info_get_type (interface));
gi_base_info_get_info_type (interface));
break;
default:
break;
@ -447,7 +447,7 @@ gi_field_info_set_field (GIFieldInfo *field_info,
case GI_TYPE_TAG_INTERFACE:
{
GIBaseInfo *interface = gi_type_info_get_interface (type_info);
switch (gi_base_info_get_type (interface))
switch (gi_base_info_get_info_type (interface))
{
case GI_INFO_TYPE_STRUCT:
case GI_INFO_TYPE_UNION:
@ -497,7 +497,7 @@ gi_field_info_set_field (GIFieldInfo *field_info,
case GI_INFO_TYPE_CALLBACK:
g_warning("Field%s: Interface type %d should have is_pointer set",
gi_base_info_get_name ((GIBaseInfo *)field_info),
gi_base_info_get_type (interface));
gi_base_info_get_info_type (interface));
break;
case GI_INFO_TYPE_INVALID:
case GI_INFO_TYPE_INTERFACE:
@ -513,7 +513,7 @@ gi_field_info_set_field (GIFieldInfo *field_info,
case GI_INFO_TYPE_UNRESOLVED:
g_warning("Field %s: Interface type %d not expected",
gi_base_info_get_name ((GIBaseInfo *)field_info),
gi_base_info_get_type (interface));
gi_base_info_get_info_type (interface));
break;
default:
break;
@ -532,7 +532,7 @@ gi_field_info_set_field (GIFieldInfo *field_info,
case GI_TYPE_TAG_INTERFACE:
{
GIBaseInfo *interface = gi_type_info_get_interface (type_info);
switch (gi_base_info_get_type (interface))
switch (gi_base_info_get_info_type (interface))
{
case GI_INFO_TYPE_OBJECT:
case GI_INFO_TYPE_INTERFACE:

View File

@ -40,7 +40,7 @@ G_BEGIN_DECLS
*
*/
#define GI_IS_FIELD_INFO(info) \
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_FIELD)
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_FIELD)
GI_AVAILABLE_IN_ALL

View File

@ -167,13 +167,13 @@ gi_function_info_get_property (GIFunctionInfo *info)
rinfo = (GIRealInfo *)info;
blob = (FunctionBlob *)&rinfo->typelib->data[rinfo->offset];
if (gi_base_info_get_type ((GIBaseInfo *) rinfo->container) == GI_INFO_TYPE_INTERFACE)
if (gi_base_info_get_info_type ((GIBaseInfo *) rinfo->container) == GI_INFO_TYPE_INTERFACE)
{
GIInterfaceInfo *container = (GIInterfaceInfo *)rinfo->container;
return gi_interface_info_get_property (container, blob->index);
}
else if (gi_base_info_get_type ((GIBaseInfo *) rinfo->container) == GI_INFO_TYPE_OBJECT)
else if (gi_base_info_get_info_type ((GIBaseInfo *) rinfo->container) == GI_INFO_TYPE_OBJECT)
{
GIObjectInfo *container = (GIObjectInfo *)rinfo->container;

View File

@ -39,7 +39,7 @@ G_BEGIN_DECLS
* Checks if @info is a #GIFunctionInfo.
*/
#define GI_IS_FUNCTION_INFO(info) \
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_FUNCTION)
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_FUNCTION)
GI_AVAILABLE_IN_ALL

View File

@ -39,7 +39,7 @@ G_BEGIN_DECLS
* Checks if @info is a #GIInterfaceInfo.
*/
#define GI_IS_INTERFACE_INFO(info) \
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_INTERFACE)
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_INTERFACE)
GI_AVAILABLE_IN_ALL

View File

@ -76,7 +76,7 @@ typedef void * (*GIObjectInfoGetValueFunction) (const GValue *value);
* Checks if @info is a #GIObjectInfo.
*/
#define GI_IS_OBJECT_INFO(info) \
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_OBJECT)
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_OBJECT)
GI_AVAILABLE_IN_ALL

View File

@ -160,7 +160,7 @@ gi_property_info_get_setter (GIPropertyInfo *info)
return NULL;
container = rinfo->container;
parent_type = gi_base_info_get_type (container);
parent_type = gi_base_info_get_info_type (container);
if (parent_type == GI_INFO_TYPE_OBJECT)
return gi_object_info_get_method ((GIObjectInfo *) container, blob->setter);
else if (parent_type == GI_INFO_TYPE_INTERFACE)
@ -199,7 +199,7 @@ gi_property_info_get_getter (GIPropertyInfo *info)
return NULL;
container = rinfo->container;
parent_type = gi_base_info_get_type (container);
parent_type = gi_base_info_get_info_type (container);
if (parent_type == GI_INFO_TYPE_OBJECT)
return gi_object_info_get_method ((GIObjectInfo *) container, blob->getter);
else if (parent_type == GI_INFO_TYPE_INTERFACE)

View File

@ -39,7 +39,7 @@ G_BEGIN_DECLS
* Checks if @info is a #GIPropertyInfo.
*/
#define GI_IS_PROPERTY_INFO(info) \
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_PROPERTY)
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_PROPERTY)
GI_AVAILABLE_IN_ALL

View File

@ -40,14 +40,14 @@ G_BEGIN_DECLS
* Checks if @info is a #GIRegisteredTypeInfo or derived from it.
*/
#define GI_IS_REGISTERED_TYPE_INFO(info) \
((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_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_BOXED) || \
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_ENUM) || \
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_FLAGS) || \
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_INTERFACE) || \
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_OBJECT) || \
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_STRUCT) || \
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_UNION) || \
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_BOXED))
GI_AVAILABLE_IN_ALL
const gchar * gi_registered_type_info_get_type_name (GIRegisteredTypeInfo *info);

View File

@ -1034,7 +1034,7 @@ gi_repository_get_object_gtype_interfaces (GIRepository *repository,
if (base_info == NULL)
continue;
if (gi_base_info_get_type (base_info) != GI_INFO_TYPE_INTERFACE)
if (gi_base_info_get_info_type (base_info) != GI_INFO_TYPE_INTERFACE)
{
/* FIXME - could this really happen? */
gi_base_info_unref (base_info);

View File

@ -146,7 +146,7 @@ gi_type_info_get_ffi_type (GITypeInfo *info)
if (gi_type_info_get_tag (info) == GI_TYPE_TAG_INTERFACE)
{
iinfo = gi_type_info_get_interface (info);
switch (gi_base_info_get_type (iinfo))
switch (gi_base_info_get_info_type (iinfo))
{
case GI_INFO_TYPE_ENUM:
case GI_INFO_TYPE_FLAGS:

View File

@ -165,7 +165,7 @@ xml_free (Xml *xml)
static void
check_unresolved (GIBaseInfo *info)
{
if (gi_base_info_get_type (info) != GI_INFO_TYPE_UNRESOLVED)
if (gi_base_info_get_info_type (info) != GI_INFO_TYPE_UNRESOLVED)
return;
g_critical ("Found unresolved type '%s' '%s'\n",
@ -442,7 +442,7 @@ write_field_info (const gchar *ns,
}
interface = gi_type_info_get_interface (type);
if (interface && gi_base_info_get_type(interface) == GI_INFO_TYPE_CALLBACK)
if (interface && gi_base_info_get_info_type (interface) == GI_INFO_TYPE_CALLBACK)
write_callback_info (ns, (GICallbackInfo *)interface, file);
else
write_type_info (ns, type, file);
@ -661,7 +661,7 @@ write_struct_info (const gchar *ns,
type_name = gi_registered_type_info_get_type_name ((GIRegisteredTypeInfo*)info);
type_init = gi_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info);
if (gi_base_info_get_type ((GIBaseInfo *)info) == GI_INFO_TYPE_BOXED)
if (gi_base_info_get_info_type ((GIBaseInfo *) info) == GI_INFO_TYPE_BOXED)
{
xml_start_element (file, "glib:boxed");
xml_printf (file, " glib:name=\"%s\"", name);
@ -849,7 +849,7 @@ write_enum_info (const gchar *ns,
type_init = gi_registered_type_info_get_type_init ((GIRegisteredTypeInfo*)info);
error_domain = gi_enum_info_get_error_domain (info);
if (gi_base_info_get_type ((GIBaseInfo *)info) == GI_INFO_TYPE_ENUM)
if (gi_base_info_get_info_type ((GIBaseInfo *) info) == GI_INFO_TYPE_ENUM)
xml_start_element (file, "enumeration");
else
xml_start_element (file, "bitfield");
@ -1414,7 +1414,7 @@ gi_ir_writer_write (const char *filename,
for (j = 0; j < n_infos; j++)
{
GIBaseInfo *info = gi_repository_get_info (repository, cur_ns, j);
switch (gi_base_info_get_type (info))
switch (gi_base_info_get_info_type (info))
{
case GI_INFO_TYPE_FUNCTION:
write_function_info (ns, (GIFunctionInfo *)info, xml);
@ -1451,7 +1451,7 @@ gi_ir_writer_write (const char *filename,
break;
default:
g_error ("unknown info type %d\n", gi_base_info_get_type (info));
g_error ("unknown info type %d\n", gi_base_info_get_info_type (info));
}
gi_base_info_unref (info);

View File

@ -40,7 +40,7 @@ G_BEGIN_DECLS
* Checks if @info is a #GISignalInfo.
*/
#define GI_IS_SIGNAL_INFO(info) \
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_SIGNAL)
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_SIGNAL)
GI_AVAILABLE_IN_ALL

View File

@ -39,7 +39,7 @@ G_BEGIN_DECLS
* Checks if @info is a #GIStructInfo.
*/
#define GI_IS_STRUCT_INFO(info) \
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_STRUCT)
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_STRUCT)
GI_AVAILABLE_IN_ALL

View File

@ -365,7 +365,7 @@ gi_type_info_get_storage_type (GITypeInfo *info)
if (type_tag == GI_TYPE_TAG_INTERFACE)
{
GIBaseInfo *interface = gi_type_info_get_interface (info);
GIInfoType info_type = gi_base_info_get_type (interface);
GIInfoType info_type = gi_base_info_get_info_type (interface);
if (info_type == GI_INFO_TYPE_ENUM || info_type == GI_INFO_TYPE_FLAGS)
type_tag = gi_enum_info_get_storage_type ((GIEnumInfo *) interface);
gi_base_info_unref (interface);

View File

@ -39,7 +39,7 @@ G_BEGIN_DECLS
* Checks if @info is a #GITypeInfo.
*/
#define GI_IS_TYPE_INFO(info) \
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_TYPE)
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_TYPE)
/**
* GI_TYPE_TAG_IS_BASIC

View File

@ -41,7 +41,7 @@ G_BEGIN_DECLS
* Since: 2.80
*/
#define GI_IS_UNION_INFO(info) \
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_UNION)
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_UNION)
GI_AVAILABLE_IN_ALL
gint gi_union_info_get_n_fields (GIUnionInfo *info);

View File

@ -194,7 +194,7 @@ gi_vfunc_info_get_invoker (GIVFuncInfo *info)
return NULL;
container = rinfo->container;
parent_type = gi_base_info_get_type (container);
parent_type = gi_base_info_get_info_type (container);
if (parent_type == GI_INFO_TYPE_OBJECT)
return gi_object_info_get_method ((GIObjectInfo*)container, blob->invoker);
else if (parent_type == GI_INFO_TYPE_INTERFACE)
@ -234,7 +234,7 @@ gi_vfunc_info_get_address (GIVFuncInfo *vfunc_info,
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
container_info = gi_base_info_get_container ((GIBaseInfo *) vfunc_info);
if (gi_base_info_get_type (container_info) == GI_INFO_TYPE_OBJECT)
if (gi_base_info_get_info_type (container_info) == GI_INFO_TYPE_OBJECT)
{
object_info = (GIObjectInfo*) container_info;
interface_info = NULL;

View File

@ -41,7 +41,7 @@ G_BEGIN_DECLS
* Since: 2.80
*/
#define GI_IS_VFUNC_INFO(info) \
(gi_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_VFUNC)
(gi_base_info_get_info_type ((GIBaseInfo*) info) == GI_INFO_TYPE_VFUNC)
GI_AVAILABLE_IN_ALL
GIVFuncInfoFlags gi_vfunc_info_get_flags (GIVFuncInfo *info);