aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/private/defs.h
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-29 21:52:58 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-29 21:52:58 +0000
commit931bffbda3668ddc609fc1da8f9eb576b170aa52 (patch)
treed8c1843a95da5ea0bb4acc09f7e37843d9995c86 /src/nvim/api/private/defs.h
parent142d9041391780ac15b89886a54015fdc5c73995 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-userreg.tar.gz
rneovim-userreg.tar.bz2
rneovim-userreg.zip
Merge remote-tracking branch 'upstream/master' into userreguserreg
Diffstat (limited to 'src/nvim/api/private/defs.h')
-rw-r--r--src/nvim/api/private/defs.h25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/nvim/api/private/defs.h b/src/nvim/api/private/defs.h
index 8acbf0d9de..25c8377518 100644
--- a/src/nvim/api/private/defs.h
+++ b/src/nvim/api/private/defs.h
@@ -1,5 +1,4 @@
-#ifndef NVIM_API_PRIVATE_DEFS_H
-#define NVIM_API_PRIVATE_DEFS_H
+#pragma once
#include <stdbool.h>
#include <stdint.h>
@@ -7,7 +6,7 @@
#include "klib/kvec.h"
#include "nvim/func_attr.h"
-#include "nvim/types.h"
+#include "nvim/types_defs.h"
#define ARRAY_DICT_INIT KV_INITIAL_VALUE
#define STRING_INIT { .data = NULL, .size = 0 }
@@ -42,10 +41,10 @@ typedef enum {
/// Mask for all internal calls
#define INTERNAL_CALL_MASK (((uint64_t)1) << (sizeof(uint64_t) * 8 - 1))
-/// Internal call from VimL code
+/// Internal call from Vimscript code
#define VIML_INTERNAL_CALL INTERNAL_CALL_MASK
-/// Internal call from lua code
+/// Internal call from Lua code
#define LUA_INTERNAL_CALL (VIML_INTERNAL_CALL + 1)
static inline bool is_internal_call(uint64_t channel_id)
@@ -124,14 +123,18 @@ struct key_value_pair {
Object value;
};
-typedef Object *(*field_hash)(void *retval, const char *str, size_t len);
+typedef uint64_t OptionalKeys;
+
+// this is the prefix of all keysets with optional keys
+typedef struct {
+ OptionalKeys is_set_;
+} OptKeySet;
+
typedef struct {
char *str;
size_t ptr_off;
+ ObjectType type; // kObjectTypeNil == untyped
+ int opt_index;
} KeySetLink;
-#ifdef INCLUDE_GENERATED_DECLARATIONS
-# include "keysets_defs.generated.h"
-#endif
-
-#endif // NVIM_API_PRIVATE_DEFS_H
+typedef KeySetLink *(*FieldHashfn)(const char *str, size_t len);