neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

dispatch.h (1129B)


      1 #pragma once
      2 
      3 #include <stdbool.h>
      4 #include <stdint.h>
      5 
      6 #include "nvim/api/private/defs.h"  // IWYU pragma: keep
      7 #include "nvim/memory_defs.h"
      8 #include "nvim/types_defs.h"
      9 
     10 typedef Object (*ApiDispatchWrapper)(uint64_t channel_id, Array args, Arena *arena, Error *error);
     11 
     12 /// The rpc_method_handlers table, used in msgpack_rpc_dispatch(), stores
     13 /// functions of this type.
     14 struct MsgpackRpcRequestHandler {
     15  const char *name;
     16  ApiDispatchWrapper fn;
     17  bool fast;  ///< Function is safe to be executed immediately while running the
     18              ///< uv loop (the loop is run very frequently due to breakcheck).
     19              ///< If "fast" is false, the function is deferred, i e the call will
     20              ///< be put in the event queue, for safe handling later.
     21  bool ret_alloc;  ///< return value is allocated and should be freed using api_free_object
     22                   ///< otherwise it uses arena and/or static memory
     23 };
     24 
     25 extern const MsgpackRpcRequestHandler method_handlers[];
     26 
     27 #include "api/private/dispatch.h.generated.h"
     28 #include "api/private/dispatch_wrappers.h.generated.h"
     29 #include "keysets_defs.generated.h"