mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 05:58:33 +00:00
refactor(api): use typed keysets
Initially this is just for geting rid of boilerplate, but eventually the types could get exposed as metadata
This commit is contained in:
@@ -124,10 +124,20 @@ 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;
|
||||
|
||||
typedef KeySetLink *(*FieldHashfn)(const char *str, size_t len);
|
||||
|
||||
#endif // NVIM_API_PRIVATE_DEFS_H
|
||||
|
Reference in New Issue
Block a user