From c48bfdf584e81a52e254c32d13d775e6ccfdc44c Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 20 May 2020 15:20:21 +0200 Subject: [PATCH] libnm: add NMUtilsPredicateStr typedef This will be used for nm_setting_option_clear_by_name(), to filter based on a name. But it is a general purpose typedef for a predicate, not tied to NMSetting or option. --- libnm-core/nm-core-types.h | 3 +++ libnm-core/nm-utils.c | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/libnm-core/nm-core-types.h b/libnm-core/nm-core-types.h index d1ce6310cd..ce59ec036e 100644 --- a/libnm-core/nm-core-types.h +++ b/libnm-core/nm-core-types.h @@ -65,4 +65,7 @@ typedef struct _NMSettingWirelessSecurity NMSettingWirelessSecurity; typedef struct _NMSettingWpan NMSettingWpan; typedef struct _NMSimpleConnection NMSimpleConnection; +NM_AVAILABLE_IN_1_26 +typedef gboolean (*NMUtilsPredicateStr) (const char *str); + #endif /* __NM_CORE_TYPES_H__ */ diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c index be76ead592..bc00516821 100644 --- a/libnm-core/nm-utils.c +++ b/libnm-core/nm-utils.c @@ -48,6 +48,20 @@ /*****************************************************************************/ +/** + * NMUtilsPredicateStr: + * @str: the name to check. + * + * This function takes a string argument and returns either %TRUE or %FALSE. + * It is a general purpose predicate, for example used by nm_setting_option_clear_by_name(). + * + * Returns: %TRUE if the predicate function matches. + * + * Since: 1.26 + */ + +/*****************************************************************************/ + struct _NMSockAddrEndpoint { const char *host; guint16 port;