mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 00:08:19 +00:00
API: Context
This commit is contained in:
42
src/nvim/context.h
Normal file
42
src/nvim/context.h
Normal file
@@ -0,0 +1,42 @@
|
||||
#ifndef NVIM_CONTEXT_H
|
||||
#define NVIM_CONTEXT_H
|
||||
|
||||
#include <msgpack.h>
|
||||
#include "nvim/api/private/defs.h"
|
||||
#include "nvim/lib/kvec.h"
|
||||
|
||||
typedef struct {
|
||||
msgpack_sbuffer regs; ///< Registers.
|
||||
msgpack_sbuffer jumps; ///< Jumplist.
|
||||
msgpack_sbuffer buflist; ///< Buffer list.
|
||||
msgpack_sbuffer gvars; ///< Global variables.
|
||||
} Context;
|
||||
typedef kvec_t(Context) ContextVec;
|
||||
|
||||
#define MSGPACK_SBUFFER_INIT (msgpack_sbuffer) { \
|
||||
.size = 0, \
|
||||
.data = NULL, \
|
||||
.alloc = 0, \
|
||||
}
|
||||
|
||||
#define CONTEXT_INIT (Context) { \
|
||||
.regs = MSGPACK_SBUFFER_INIT, \
|
||||
.jumps = MSGPACK_SBUFFER_INIT, \
|
||||
.buflist = MSGPACK_SBUFFER_INIT, \
|
||||
.gvars = MSGPACK_SBUFFER_INIT, \
|
||||
}
|
||||
|
||||
typedef enum {
|
||||
kCtxRegs = 1, ///< Registers
|
||||
kCtxJumps = 2, ///< Jumplist
|
||||
kCtxBuflist = 4, ///< Buffer list
|
||||
kCtxGVars = 8, ///< Global variables
|
||||
} ContextTypeFlags;
|
||||
|
||||
extern int kCtxAll;
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "context.h.generated.h"
|
||||
#endif
|
||||
|
||||
#endif // NVIM_CONTEXT_H
|
Reference in New Issue
Block a user