mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-21 16:50:43 +01:00
shared: add nm_utils_dbus_path_get_last_component() helper
This commit is contained in:
parent
bb649fc3cd
commit
3b0d50475b
2 changed files with 17 additions and 0 deletions
|
|
@ -549,6 +549,19 @@ nm_cmp_int2ptr_p_with_data (gconstpointer p_a, gconstpointer p_b, gpointer user_
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
const char *
|
||||
nm_utils_dbus_path_get_last_component (const char *dbus_path)
|
||||
{
|
||||
if (dbus_path) {
|
||||
dbus_path = strrchr (dbus_path, '/');
|
||||
if (dbus_path)
|
||||
return dbus_path + 1;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* nm_utils_strsplit_set:
|
||||
* @str: the string to split.
|
||||
|
|
|
|||
|
|
@ -202,6 +202,10 @@ nm_utils_is_separator (const char c)
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
const char *nm_utils_dbus_path_get_last_component (const char *dbus_path);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
const char **nm_utils_strsplit_set (const char *str, const char *delimiters);
|
||||
|
||||
gssize nm_utils_strv_find_first (char **list, gssize len, const char *needle);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue