aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/private/helpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/api/private/helpers.h')
-rw-r--r--src/nvim/api/private/helpers.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/api/private/helpers.h b/src/nvim/api/private/helpers.h
index 271fd5b485..055abb797f 100644
--- a/src/nvim/api/private/helpers.h
+++ b/src/nvim/api/private/helpers.h
@@ -16,6 +16,7 @@
#define BOOLEAN_OBJ(b) ((Object) { \
.type = kObjectTypeBoolean, \
.data.boolean = b })
+#define BOOL(b) BOOLEAN_OBJ(b)
#define INTEGER_OBJ(i) ((Object) { \
.type = kObjectTypeInteger, \
@@ -29,6 +30,8 @@
.type = kObjectTypeString, \
.data.string = s })
+#define CSTR_TO_OBJ(s) STRING_OBJ(cstr_to_string(s))
+
#define BUFFER_OBJ(s) ((Object) { \
.type = kObjectTypeBuffer, \
.data.integer = s })
@@ -59,6 +62,8 @@
#define PUT(dict, k, v) \
kv_push(dict, ((KeyValuePair) { .key = cstr_to_string(k), .value = v }))
+#define PUT_BOOL(dict, name, condition) PUT(dict, name, BOOLEAN_OBJ(condition));
+
#define ADD(array, item) \
kv_push(array, item)