summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-07-19 10:07:52 +0200
committerThomas Haller <thaller@redhat.com>2019-07-25 10:43:44 +0200
commit29a7bffecf0c8a5a0b62b8831c695d3cf534537d (patch)
treee3cb52c42688edcdcfcf446ad864f6f96d09e1bc
parenta78ba1c33a40358ca52c91fc0163b7b6f898da41 (diff)
downloadNetworkManager-29a7bffecf0c8a5a0b62b8831c695d3cf534537d.tar.gz
shared: add nm_strcmp0_p_with_data() helper
-rw-r--r--shared/nm-glib-aux/nm-shared-utils.c9
-rw-r--r--shared/nm-glib-aux/nm-shared-utils.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/shared/nm-glib-aux/nm-shared-utils.c b/shared/nm-glib-aux/nm-shared-utils.c
index 74f8a9b3f5..171e661a95 100644
--- a/shared/nm-glib-aux/nm-shared-utils.c
+++ b/shared/nm-glib-aux/nm-shared-utils.c
@@ -832,6 +832,15 @@ nm_strcmp_p_with_data (gconstpointer a, gconstpointer b, gpointer user_data)
}
int
+nm_strcmp0_p_with_data (gconstpointer a, gconstpointer b, gpointer user_data)
+{
+ const char *s1 = *((const char **) a);
+ const char *s2 = *((const char **) b);
+
+ return nm_strcmp0 (s1, s2);
+}
+
+int
nm_cmp_uint32_p_with_data (gconstpointer p_a, gconstpointer p_b, gpointer user_data)
{
const guint32 a = *((const guint32 *) p_a);
diff --git a/shared/nm-glib-aux/nm-shared-utils.h b/shared/nm-glib-aux/nm-shared-utils.h
index d1090af397..d9c430d495 100644
--- a/shared/nm-glib-aux/nm-shared-utils.h
+++ b/shared/nm-glib-aux/nm-shared-utils.h
@@ -920,6 +920,7 @@ nm_utf8_collate0 (const char *a, const char *b)
int nm_strcmp_with_data (gconstpointer a, gconstpointer b, gpointer user_data);
int nm_strcmp_p_with_data (gconstpointer a, gconstpointer b, gpointer user_data);
+int nm_strcmp0_p_with_data (gconstpointer a, gconstpointer b, gpointer user_data);
int nm_cmp_uint32_p_with_data (gconstpointer p_a, gconstpointer p_b, gpointer user_data);
int nm_cmp_int2ptr_p_with_data (gconstpointer p_a, gconstpointer p_b, gpointer user_data);