summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-05-20 15:20:21 +0200
committerThomas Haller <thaller@redhat.com>2020-05-22 15:58:01 +0200
commitc48bfdf584e81a52e254c32d13d775e6ccfdc44c (patch)
treec29979d38c721c68666300b9682e066b41248000
parent332cf1ad9ddb440a9424283b5dfd695150b79a58 (diff)
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.
-rw-r--r--libnm-core/nm-core-types.h3
-rw-r--r--libnm-core/nm-utils.c14
2 files changed, 17 insertions, 0 deletions
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;