mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
API: Refactor: Move non-public files to private subdirectory
This commit is contained in:
parent
399a0e3740
commit
72e3125f45
@ -6,17 +6,6 @@ file(GLOB API_HEADERS api/*.h)
|
|||||||
set(MSGPACK_RPC_HEADER ${PROJECT_SOURCE_DIR}/src/nvim/os/msgpack_rpc.h)
|
set(MSGPACK_RPC_HEADER ${PROJECT_SOURCE_DIR}/src/nvim/os/msgpack_rpc.h)
|
||||||
set(MSGPACK_DISPATCH ${GENERATED_DIR}/msgpack_dispatch.c)
|
set(MSGPACK_DISPATCH ${GENERATED_DIR}/msgpack_dispatch.c)
|
||||||
|
|
||||||
# Remove helpers.h from API_HEADERS since it doesn't contain public API
|
|
||||||
# functions
|
|
||||||
foreach(sfile ${API_HEADERS})
|
|
||||||
get_filename_component(f ${sfile} NAME)
|
|
||||||
if(${f} MATCHES "^(helpers.h)$")
|
|
||||||
list(APPEND to_remove ${sfile})
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
list(REMOVE_ITEM API_HEADERS ${to_remove})
|
|
||||||
set(to_remove)
|
|
||||||
|
|
||||||
file(MAKE_DIRECTORY ${GENERATED_DIR})
|
file(MAKE_DIRECTORY ${GENERATED_DIR})
|
||||||
|
|
||||||
add_custom_command(OUTPUT ${MSGPACK_DISPATCH}
|
add_custom_command(OUTPUT ${MSGPACK_DISPATCH}
|
||||||
@ -42,6 +31,7 @@ list(APPEND NEOVIM_SOURCES "${MSGPACK_DISPATCH}")
|
|||||||
|
|
||||||
file( GLOB OS_SOURCES os/*.c )
|
file( GLOB OS_SOURCES os/*.c )
|
||||||
file( GLOB API_SOURCES api/*.c )
|
file( GLOB API_SOURCES api/*.c )
|
||||||
|
file( GLOB API_PRIV_SOURCES api/private/*.c )
|
||||||
|
|
||||||
set(CONV_SRCS
|
set(CONV_SRCS
|
||||||
api.c
|
api.c
|
||||||
@ -110,13 +100,14 @@ list(APPEND NVIM_LINK_LIBRARIES
|
|||||||
${CMAKE_THREAD_LIBS_INIT})
|
${CMAKE_THREAD_LIBS_INIT})
|
||||||
|
|
||||||
if(NOT DEFINED ENV{SKIP_EXEC})
|
if(NOT DEFINED ENV{SKIP_EXEC})
|
||||||
add_executable(nvim ${NEOVIM_SOURCES} ${OS_SOURCES} ${API_SOURCES})
|
add_executable(nvim ${NEOVIM_SOURCES} ${OS_SOURCES} ${API_SOURCES}
|
||||||
|
${API_PRIV_SOURCES})
|
||||||
target_link_libraries(nvim ${NVIM_LINK_LIBRARIES})
|
target_link_libraries(nvim ${NVIM_LINK_LIBRARIES})
|
||||||
install(TARGETS nvim RUNTIME DESTINATION bin)
|
install(TARGETS nvim RUNTIME DESTINATION bin)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT DEFINED ENV{SKIP_UNITTEST})
|
if(NOT DEFINED ENV{SKIP_UNITTEST})
|
||||||
add_library(nvim-test MODULE EXCLUDE_FROM_ALL ${NEOVIM_SOURCES}
|
add_library(nvim-test MODULE EXCLUDE_FROM_ALL ${NEOVIM_SOURCES}
|
||||||
${OS_SOURCES} ${API_SOURCES})
|
${OS_SOURCES} ${API_SOURCES} ${API_PRIV_SOURCES})
|
||||||
target_link_libraries(nvim-test ${NVIM_LINK_LIBRARIES})
|
target_link_libraries(nvim-test ${NVIM_LINK_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "nvim/api/buffer.h"
|
#include "nvim/api/buffer.h"
|
||||||
#include "nvim/api/helpers.h"
|
#include "nvim/api/private/helpers.h"
|
||||||
#include "nvim/api/defs.h"
|
#include "nvim/api/private/defs.h"
|
||||||
#include "nvim/vim.h"
|
#include "nvim/vim.h"
|
||||||
#include "nvim/buffer.h"
|
#include "nvim/buffer.h"
|
||||||
#include "nvim/memline.h"
|
#include "nvim/memline.h"
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "nvim/api/defs.h"
|
#include "nvim/api/private/defs.h"
|
||||||
|
|
||||||
/// Gets the buffer line count
|
/// Gets the buffer line count
|
||||||
///
|
///
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "nvim/api/helpers.h"
|
#include "nvim/api/private/helpers.h"
|
||||||
#include "nvim/api/defs.h"
|
#include "nvim/api/private/defs.h"
|
||||||
#include "nvim/vim.h"
|
#include "nvim/vim.h"
|
||||||
#include "nvim/buffer.h"
|
#include "nvim/buffer.h"
|
||||||
#include "nvim/window.h"
|
#include "nvim/window.h"
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "nvim/api/defs.h"
|
#include "nvim/api/private/defs.h"
|
||||||
#include "nvim/vim.h"
|
#include "nvim/vim.h"
|
||||||
|
|
||||||
#define set_api_error(message, err) \
|
#define set_api_error(message, err) \
|
@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
#include "nvim/api/tabpage.h"
|
#include "nvim/api/tabpage.h"
|
||||||
#include "nvim/api/vim.h"
|
#include "nvim/api/vim.h"
|
||||||
#include "nvim/api/defs.h"
|
#include "nvim/api/private/defs.h"
|
||||||
#include "nvim/api/helpers.h"
|
#include "nvim/api/private/helpers.h"
|
||||||
|
|
||||||
Integer tabpage_get_window_count(Tabpage tabpage, Error *err)
|
Integer tabpage_get_window_count(Tabpage tabpage, Error *err)
|
||||||
{
|
{
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "nvim/api/defs.h"
|
#include "nvim/api/private/defs.h"
|
||||||
|
|
||||||
/// Gets the number of windows in a tabpage
|
/// Gets the number of windows in a tabpage
|
||||||
///
|
///
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "nvim/api/vim.h"
|
#include "nvim/api/vim.h"
|
||||||
#include "nvim/api/helpers.h"
|
#include "nvim/api/private/helpers.h"
|
||||||
#include "nvim/api/defs.h"
|
#include "nvim/api/private/defs.h"
|
||||||
#include "nvim/api/buffer.h"
|
#include "nvim/api/buffer.h"
|
||||||
#include "nvim/vim.h"
|
#include "nvim/vim.h"
|
||||||
#include "nvim/buffer.h"
|
#include "nvim/buffer.h"
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "nvim/api/defs.h"
|
#include "nvim/api/private/defs.h"
|
||||||
|
|
||||||
/// Send keys to vim input buffer, simulating user input.
|
/// Send keys to vim input buffer, simulating user input.
|
||||||
///
|
///
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "nvim/api/window.h"
|
#include "nvim/api/window.h"
|
||||||
#include "nvim/api/defs.h"
|
#include "nvim/api/private/defs.h"
|
||||||
#include "nvim/api/helpers.h"
|
#include "nvim/api/private/helpers.h"
|
||||||
#include "nvim/vim.h"
|
#include "nvim/vim.h"
|
||||||
#include "nvim/window.h"
|
#include "nvim/window.h"
|
||||||
#include "nvim/screen.h"
|
#include "nvim/screen.h"
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "nvim/api/defs.h"
|
#include "nvim/api/private/defs.h"
|
||||||
|
|
||||||
/// Gets the current buffer in a window
|
/// Gets the current buffer in a window
|
||||||
///
|
///
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#include <msgpack.h>
|
#include <msgpack.h>
|
||||||
|
|
||||||
#include "nvim/api/defs.h"
|
#include "nvim/api/private/defs.h"
|
||||||
|
|
||||||
/// Validates the basic structure of the msgpack-rpc call and fills `res`
|
/// Validates the basic structure of the msgpack-rpc call and fills `res`
|
||||||
/// with the basic response structure.
|
/// with the basic response structure.
|
||||||
|
Loading…
Reference in New Issue
Block a user