diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/nvim/api/private/defs.h | 20 |
2 files changed, 15 insertions, 9 deletions
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index 83de3347bd..405cd20486 100644 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -3,6 +3,7 @@ include(CheckLibraryExists) set(GENERATED_DIR ${PROJECT_BINARY_DIR}/src/nvim/auto) set(DISPATCH_GENERATOR ${PROJECT_SOURCE_DIR}/scripts/msgpack-gen.lua) file(GLOB API_HEADERS api/*.h) +file(GLOB API_DEFS api/private/defs.h) set(MSGPACK_RPC_HEADER ${PROJECT_SOURCE_DIR}/src/nvim/os/msgpack_rpc.h) set(MSGPACK_DISPATCH ${GENERATED_DIR}/msgpack_dispatch.c) set(HEADER_GENERATOR ${PROJECT_SOURCE_DIR}/scripts/gendeclarations.lua) @@ -123,9 +124,10 @@ foreach(sfile ${NEOVIM_SOURCES} endforeach() add_custom_command(OUTPUT ${MSGPACK_DISPATCH} - COMMAND ${LUA_PRG} ${DISPATCH_GENERATOR} ${API_HEADERS} ${MSGPACK_DISPATCH} + COMMAND ${LUA_PRG} ${DISPATCH_GENERATOR} ${API_DEFS} ${API_HEADERS} ${MSGPACK_DISPATCH} DEPENDS ${API_HEADERS} + ${API_DEFS} ${MSGPACK_RPC_HEADER} ${DISPATCH_GENERATOR} ) diff --git a/src/nvim/api/private/defs.h b/src/nvim/api/private/defs.h index 071563a628..689594f231 100644 --- a/src/nvim/api/private/defs.h +++ b/src/nvim/api/private/defs.h @@ -49,32 +49,36 @@ typedef struct { } Dictionary; typedef enum { +// The following comments are markers that msgpack-gen.lua uses to extract +// types, don't remove! +// start custom types + kObjectTypePosition, + kObjectTypeBuffer, + kObjectTypeWindow, + kObjectTypeTabpage, +// end custom types kObjectTypeNil, kObjectTypeBoolean, kObjectTypeInteger, kObjectTypeFloat, kObjectTypeString, - kObjectTypeBuffer, - kObjectTypeWindow, - kObjectTypeTabpage, kObjectTypeArray, kObjectTypeDictionary, - kObjectTypePosition, } ObjectType; struct object { ObjectType type; union { + Position position; + Buffer buffer; + Window window; + Tabpage tabpage; Boolean boolean; Integer integer; Float floating; String string; - Buffer buffer; - Window window; - Tabpage tabpage; Array array; Dictionary dictionary; - Position position; } data; }; |