mirror of
https://github.com/neovim/neovim.git
synced 2026-08-22 07:11:12 +00:00
We already have an extensive suite of static analysis tools we use, which causes a fair bit of redundancy as we get duplicate warnings. PVS is also prone to give false warnings which creates a lot of work to identify and disable.
26 lines
839 B
C
26 lines
839 B
C
#include <stddef.h>
|
|
|
|
#include "nvim/api/private/defs.h"
|
|
#include "nvim/api/private/dispatch.h"
|
|
#include "nvim/api/private/helpers.h"
|
|
|
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
|
# include "api/private/dispatch_wrappers.generated.h"
|
|
#endif
|
|
|
|
/// @param name API method name
|
|
/// @param name_len name size (includes terminating NUL)
|
|
MsgpackRpcRequestHandler msgpack_rpc_get_handler_for(const char *name, size_t name_len,
|
|
Error *error)
|
|
{
|
|
int hash = msgpack_rpc_get_handler_for_hash(name, name_len);
|
|
|
|
if (hash < 0) {
|
|
api_set_error(error, kErrorTypeException, "Invalid method: %.*s",
|
|
name_len > 0 ? (int)name_len : (int)sizeof("<empty>"),
|
|
name_len > 0 ? name : "<empty>");
|
|
return (MsgpackRpcRequestHandler){ 0 };
|
|
}
|
|
return method_handlers[hash];
|
|
}
|