mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-21 16:38:54 +02:00
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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user