mirror of
https://github.com/neovim/neovim.git
synced 2025-10-09 19:36:40 +00:00

This avoids generating khash tables at runtime, and is consistent with how evalfuncs lookup work.
27 lines
957 B
C
27 lines
957 B
C
#ifndef NVIM_API_PRIVATE_DISPATCH_H
|
|
#define NVIM_API_PRIVATE_DISPATCH_H
|
|
|
|
#include "nvim/api/private/defs.h"
|
|
|
|
typedef Object (*ApiDispatchWrapper)(uint64_t channel_id,
|
|
Array args,
|
|
Error *error);
|
|
|
|
/// The rpc_method_handlers table, used in msgpack_rpc_dispatch(), stores
|
|
/// functions of this type.
|
|
typedef struct {
|
|
const char *name;
|
|
ApiDispatchWrapper fn;
|
|
bool fast; // Function is safe to be executed immediately while running the
|
|
// uv loop (the loop is run very frequently due to breakcheck).
|
|
// If "fast" is false, the function is deferred, i e the call will
|
|
// be put in the event queue, for safe handling later.
|
|
} MsgpackRpcRequestHandler;
|
|
|
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
|
# include "api/private/dispatch.h.generated.h"
|
|
# include "api/private/dispatch_wrappers.h.generated.h"
|
|
#endif
|
|
|
|
#endif // NVIM_API_PRIVATE_DISPATCH_H
|