mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 10:30:13 +01:00
shared: add nm_strvarray_get_strv_non_empty() helper
(cherry picked from commit d69f057a65)
This commit is contained in:
parent
3951396de7
commit
092ab227d5
1 changed files with 12 additions and 0 deletions
|
|
@ -2023,6 +2023,18 @@ nm_strvarray_add (GArray *array, const char *str)
|
|||
g_array_append_val (array, s);
|
||||
}
|
||||
|
||||
static inline const char *const*
|
||||
nm_strvarray_get_strv_non_empty (GArray *arr, guint *length)
|
||||
{
|
||||
if (!arr || arr->len == 0) {
|
||||
NM_SET_OUT (length, 0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
NM_SET_OUT (length, arr->len);
|
||||
return &g_array_index (arr, const char *, 0);
|
||||
}
|
||||
|
||||
static inline const char *const*
|
||||
nm_strvarray_get_strv (GArray **arr, guint *length)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue