girepository: Rename GIArgInfo methods to be clearer

Indicate that they return an argument index, not the argument itself.

This is an API break, but libgirepository has not been in a stable GLib
release yet, so that’s fine.

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

Helps: #3155
This commit is contained in:
Philip Withnall
2023-12-12 17:33:49 +00:00
parent 9eee19b7ed
commit 5fa28d1b7e
3 changed files with 10 additions and 10 deletions

View File

@@ -246,7 +246,7 @@ gi_arg_info_get_scope (GIArgInfo *info)
} }
/** /**
* gi_arg_info_get_closure: * gi_arg_info_get_closure_index:
* @info: a #GIArgInfo * @info: a #GIArgInfo
* *
* Obtain the index of the user data argument. This is only valid * Obtain the index of the user data argument. This is only valid
@@ -255,7 +255,7 @@ gi_arg_info_get_scope (GIArgInfo *info)
* Returns: index of the user data argument or -1 if there is none * Returns: index of the user data argument or -1 if there is none
*/ */
gint gint
gi_arg_info_get_closure (GIArgInfo *info) gi_arg_info_get_closure_index (GIArgInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ArgBlob *blob; ArgBlob *blob;
@@ -269,7 +269,7 @@ gi_arg_info_get_closure (GIArgInfo *info)
} }
/** /**
* gi_arg_info_get_destroy: * gi_arg_info_get_destroy_index:
* @info: a #GIArgInfo * @info: a #GIArgInfo
* *
* Obtains the index of the #GDestroyNotify argument. This is only valid * Obtains the index of the #GDestroyNotify argument. This is only valid
@@ -278,7 +278,7 @@ gi_arg_info_get_closure (GIArgInfo *info)
* Returns: index of the #GDestroyNotify argument or -1 if there is none * Returns: index of the #GDestroyNotify argument or -1 if there is none
*/ */
gint gint
gi_arg_info_get_destroy (GIArgInfo *info) gi_arg_info_get_destroy_index (GIArgInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
ArgBlob *blob; ArgBlob *blob;

View File

@@ -67,10 +67,10 @@ GI_AVAILABLE_IN_ALL
GIScopeType gi_arg_info_get_scope (GIArgInfo *info); GIScopeType gi_arg_info_get_scope (GIArgInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_arg_info_get_closure (GIArgInfo *info); gint gi_arg_info_get_closure_index (GIArgInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_arg_info_get_destroy (GIArgInfo *info); gint gi_arg_info_get_destroy_index (GIArgInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GITypeInfo * gi_arg_info_get_type_info (GIArgInfo *info); GITypeInfo * gi_arg_info_get_type_info (GIArgInfo *info);

View File

@@ -544,11 +544,11 @@ write_callable_info (const gchar *ns,
g_assert_not_reached (); g_assert_not_reached ();
} }
if (gi_arg_info_get_closure (arg) >= 0) if (gi_arg_info_get_closure_index (arg) >= 0)
xml_printf (file, " closure=\"%d\"", gi_arg_info_get_closure (arg)); xml_printf (file, " closure=\"%d\"", gi_arg_info_get_closure_index (arg));
if (gi_arg_info_get_destroy (arg) >= 0) if (gi_arg_info_get_destroy_index (arg) >= 0)
xml_printf (file, " destroy=\"%d\"", gi_arg_info_get_destroy (arg)); xml_printf (file, " destroy=\"%d\"", gi_arg_info_get_destroy_index (arg));
if (gi_arg_info_is_skip (arg)) if (gi_arg_info_is_skip (arg))
xml_printf (file, " skip=\"1\""); xml_printf (file, " skip=\"1\"");