glib-aux: add nm_strvarray_get_idx() helper

This commit is contained in:
Thomas Haller 2021-06-02 13:43:34 +02:00
parent a266bc15b2
commit b0acbe504f
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -2747,6 +2747,15 @@ nm_strvarray_add(GArray *array, const char *str)
g_array_append_val(array, s);
}
static inline const char *
nm_strvarray_get_idx(GArray *array, guint idx)
{
nm_assert(array);
nm_assert(idx < array->len);
return g_array_index(array, const char *, idx);
}
static inline const char *const *
nm_strvarray_get_strv_non_empty(GArray *arr, guint *length)
{