aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/private/defs.h
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2024-07-02 13:45:50 +0200
committerbfredl <bjorn.linse@gmail.com>2024-08-05 11:12:44 +0200
commitf926cc32c9262b6254e2843276b951cef9da1afe (patch)
tree56f13240abae6ec0f3b13022b011da84948788c0 /src/nvim/api/private/defs.h
parent0c2860d9e5ec5417a94db6e3edd237578b76d418 (diff)
downloadrneovim-f926cc32c9262b6254e2843276b951cef9da1afe.tar.gz
rneovim-f926cc32c9262b6254e2843276b951cef9da1afe.tar.bz2
rneovim-f926cc32c9262b6254e2843276b951cef9da1afe.zip
refactor(shada): rework msgpack decoding without msgpack-c
This also makes shada reading slightly faster due to avoiding some copying and allocation. Use keysets to drive decoding of msgpack maps for shada entries.
Diffstat (limited to 'src/nvim/api/private/defs.h')
-rw-r--r--src/nvim/api/private/defs.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/nvim/api/private/defs.h b/src/nvim/api/private/defs.h
index 94e2d76cbe..ac3404cf86 100644
--- a/src/nvim/api/private/defs.h
+++ b/src/nvim/api/private/defs.h
@@ -19,6 +19,8 @@
# define ArrayOf(...) Array
# define DictionaryOf(...) Dictionary
# define Dict(name) KeyDict_##name
+# define DictHash(name) KeyDict_##name##_get_field
+# define DictKey(name)
# include "api/private/defs.h.inline.generated.h"
#endif
@@ -88,6 +90,8 @@ typedef kvec_t(Object) Array;
typedef struct key_value_pair KeyValuePair;
typedef kvec_t(KeyValuePair) Dictionary;
+typedef kvec_t(String) StringArray;
+
typedef enum {
kObjectTypeNil = 0,
kObjectTypeBoolean,
@@ -103,6 +107,10 @@ typedef enum {
kObjectTypeTabpage,
} ObjectType;
+typedef enum {
+ kUnpackTypeStringArray = -1,
+} UnpackType;
+
/// Value by which objects represented as EXT type are shifted
///
/// Subtracted when packing, added when unpacking. Used to allow moving
@@ -140,7 +148,7 @@ typedef struct {
typedef struct {
char *str;
size_t ptr_off;
- ObjectType type; // kObjectTypeNil == untyped
+ int type; // ObjectType or UnpackType. kObjectTypeNil == untyped
int opt_index;
bool is_hlgroup;
} KeySetLink;