glib-aux: add nm_strv_contains() helper

(cherry picked from commit ee0f3f6242)
This commit is contained in:
Thomas Haller 2022-09-23 15:54:59 +02:00
parent 65d31a11f8
commit aed57e8acc
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -809,6 +809,8 @@ gssize _nm_strv_find_first(const char *const *list, gssize len, const char *need
#define nm_strv_find_first(list, len, needle) \
_nm_strv_find_first(NM_CAST_STRV_CC(list), (len), (needle))
#define nm_strv_contains(list, len, needle) (nm_strv_find_first((list), (len), (needle)) >= 0)
gboolean nm_strv_has_duplicate(const char *const *list, gssize len, gboolean is_sorted);
const char **nm_strv_cleanup_const(const char **strv, gboolean skip_empty, gboolean skip_repeated);