Add lasso_is_in_list_of_strings macro to utils.h

Add macro that tests to see if a string is a member in a list of
strings.

Signed-off-by: John Dennis <jdennis@redhat.com>
License: MIT
This commit is contained in:
John Dennis 2015-05-25 11:19:53 -04:00 committed by Benjamin Dauvergne
parent f3849b2664
commit a6014fc51b
1 changed files with 5 additions and 0 deletions

View File

@ -442,6 +442,11 @@
*__tmp_list = g_list_remove(*__tmp_list, __tmp); \
lasso_unref(__tmp); } while(0)
/* List element membership */
#define lasso_is_in_list_of_strings(list, item) \
g_list_find_custom(list, item, (GCompareFunc)g_strcmp0) == NULL ? FALSE : TRUE
/* Pointer ownership transfer */
/* lasso_transfer_xxx macros are like lasso_assign_xxx but they do not increment reference count or