about summary refs log tree commit diff
path: root/shared/nm-glib-aux/nm-ref-string.h
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2020-04-11 21:30:33 +0200
committerMichael Biebl <biebl@debian.org>2020-04-11 21:30:33 +0200
commitf914c41532a9e4f2bb44be074466b62e4cac8db3 (patch)
tree046e8e7a186afecf299cd80d62fa1c93903dbecf /shared/nm-glib-aux/nm-ref-string.h
parent19e73abd360f0198f94ce49f36ddf009056f6324 (diff)
parent1e5977b62f896e844b548c3007ace9e1dfa7f9ed (diff)
Update upstream source from tag 'upstream/1.23.90'
Update to upstream version '1.23.90'
with Debian dir 38c3873648b51c73a9e448ccb2ac18152c2b3f85
Diffstat (limited to 'shared/nm-glib-aux/nm-ref-string.h')
-rw-r--r--shared/nm-glib-aux/nm-ref-string.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/shared/nm-glib-aux/nm-ref-string.h b/shared/nm-glib-aux/nm-ref-string.h
index c80b75ea..60052c45 100644
--- a/shared/nm-glib-aux/nm-ref-string.h
+++ b/shared/nm-glib-aux/nm-ref-string.h
@@ -50,6 +50,18 @@ nm_ref_string_get_len (NMRefString *rstr)
 }
 
 static inline gboolean
+nm_ref_string_equals_str (NMRefString *rstr, const char *s)
+{
+	/* Note that rstr->len might be greater than strlen(rstr->str). This function does
+	 * not cover that and would ignore everything after the first NUL byte. If you need
+	 * that distinction, this function is not for you. */
+
+	return   rstr
+	       ? (s && nm_streq (rstr->str, s))
+	       : (s == NULL);
+}
+
+static inline gboolean
 NM_IS_REF_STRING (const NMRefString *rstr)
 {
 #if NM_MORE_ASSERTS > 10