lib/remote: Add a getter for OstreeRemote.name
Now that we’ve got a public, sealed OstreeRemote structure, we can start carefully exposing members of it as API. Signed-off-by: Philip Withnall <withnall@endlessm.com> Closes: #875 Approved by: cgwalters
This commit is contained in:
parent
a8fd37b6a0
commit
d2eaded90d
|
|
@ -3,4 +3,5 @@
|
|||
OstreeRemote
|
||||
ostree_remote_ref
|
||||
ostree_remote_unref
|
||||
ostree_remote_get_name
|
||||
</SECTION>
|
||||
|
|
|
|||
|
|
@ -29,3 +29,8 @@ global:
|
|||
ostree_remote_ref;
|
||||
ostree_remote_unref;
|
||||
} LIBOSTREE_2017.6;
|
||||
|
||||
LIBOSTREE_2016.7_EXPERIMENTAL {
|
||||
global:
|
||||
ostree_remote_get_name;
|
||||
} LIBOSTREE_2017.6_EXPERIMENTAL;
|
||||
|
|
|
|||
|
|
@ -148,3 +148,23 @@ G_DEFINE_BOXED_TYPE(OstreeRemote, ostree_remote,
|
|||
ostree_remote_ref,
|
||||
ostree_remote_unref);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* ostree_remote_get_name:
|
||||
* @remote: an #OstreeRemote
|
||||
*
|
||||
* Get the human-readable name of the remote. This is what the user configured,
|
||||
* if the remote was explicitly configured; and will otherwise be a stable,
|
||||
* arbitrary, string.
|
||||
*
|
||||
* Returns: remote’s name
|
||||
* Since: 2017.7
|
||||
*/
|
||||
const gchar *
|
||||
ostree_remote_get_name (OstreeRemote *remote)
|
||||
{
|
||||
g_return_val_if_fail (remote != NULL, NULL);
|
||||
g_return_val_if_fail (remote->ref_count > 0, NULL);
|
||||
|
||||
return remote->name;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,4 +60,7 @@ void ostree_remote_unref (OstreeRemote *remote);
|
|||
#endif /* GI_SCANNER */
|
||||
#endif
|
||||
|
||||
_OSTREE_PUBLIC
|
||||
const gchar *ostree_remote_get_name (OstreeRemote *remote);
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
|||
Loading…
Reference in New Issue