summaryrefslogtreecommitdiffstats
path: root/src/misc2.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 02:10:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 02:10:58 +0000
commit08f9ab81d4c476bdca6e23aba00f615eb811d929 (patch)
treece8796843acf3fd4f1ab43490d74f56131772037 /src/misc2.c
parentAdding debian version 2:9.1.0199-1. (diff)
downloadvim-08f9ab81d4c476bdca6e23aba00f615eb811d929.tar.xz
vim-08f9ab81d4c476bdca6e23aba00f615eb811d929.zip
Merging upstream version 2:9.1.0374.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/misc2.c')
-rw-r--r--src/misc2.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/misc2.c b/src/misc2.c
index 6df0d39..c07ed80 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -3069,3 +3069,45 @@ get_special_pty_type(void)
return 0;
#endif
}
+
+// compare two keyvalue_T structs by case sensitive value
+ int
+cmp_keyvalue_value(const void *a, const void *b)
+{
+ keyvalue_T *kv1 = (keyvalue_T *)a;
+ keyvalue_T *kv2 = (keyvalue_T *)b;
+
+ return STRCMP(kv1->value, kv2->value);
+}
+
+// compare two keyvalue_T structs by value with length
+ int
+cmp_keyvalue_value_n(const void *a, const void *b)
+{
+ keyvalue_T *kv1 = (keyvalue_T *)a;
+ keyvalue_T *kv2 = (keyvalue_T *)b;
+
+ return STRNCMP(kv1->value, kv2->value, MAX(kv1->length, kv2->length));
+}
+
+// compare two keyvalue_T structs by case insensitive value
+ int
+cmp_keyvalue_value_i(const void *a, const void *b)
+{
+ keyvalue_T *kv1 = (keyvalue_T *)a;
+ keyvalue_T *kv2 = (keyvalue_T *)b;
+
+ return STRICMP(kv1->value, kv2->value);
+}
+
+// compare two keyvalue_T structs by case insensitive value
+// with length
+ int
+cmp_keyvalue_value_ni(const void *a, const void *b)
+{
+ keyvalue_T *kv1 = (keyvalue_T *)a;
+ keyvalue_T *kv2 = (keyvalue_T *)b;
+
+ return STRNICMP(kv1->value, kv2->value, MAX(kv1->length, kv2->length));
+}
+