summaryrefslogtreecommitdiffstats
path: root/src/structs.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/structs.h')
-rw-r--r--src/structs.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/structs.h b/src/structs.h
index 2218de7037..3ce13ff0fb 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -5060,3 +5060,18 @@ typedef struct {
linenr_T spv_capcol_lnum; // line number for "cap_col"
#endif
} spellvars_T;
+
+// Return the length of a string literal
+#define STRLEN_LITERAL(s) (sizeof(s) - 1)
+
+// Store a key/value pair
+typedef struct
+{
+ int key; // the key
+ char *value; // the value string
+ size_t length; // length of the value string
+} keyvalue_T;
+
+#define KEYVALUE_ENTRY(k, v) \
+ {(k), (v), STRLEN_LITERAL(v)}
+