aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lua/api_wrappers.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2024-04-27 09:21:46 +0200
committerbfredl <bjorn.linse@gmail.com>2024-04-27 18:59:48 +0200
commit3711a0387a96d6531f3ae07a9b18fb8e2afc2e41 (patch)
tree091b6e0ba6baed32d421fbd46846c8661da64132 /src/nvim/lua/api_wrappers.c
parent435dee74bb3593b778328138dac054f26e2d7396 (diff)
downloadrneovim-3711a0387a96d6531f3ae07a9b18fb8e2afc2e41.tar.gz
rneovim-3711a0387a96d6531f3ae07a9b18fb8e2afc2e41.tar.bz2
rneovim-3711a0387a96d6531f3ae07a9b18fb8e2afc2e41.zip
refactor(build): make all generated c files headers
There's no "rule" or bad practice or whatever that says we cannot generate c files. it is is just that we have ~20 generated headers and ~2 generated sources and there is nothing in these two generated source files which sets them aparts. Lua bindings are not different from rpc bindings, and pathdef is not different from versiondef. So to simplify build logic and ease the future port to build.zig, streamline the build to only have generated headers, no direct generated .c files. Also "nlua_add_api_functions" had its prototype duplicated twice which defeated the point of having mandatory prototypes (one source of truth).
Diffstat (limited to 'src/nvim/lua/api_wrappers.c')
-rw-r--r--src/nvim/lua/api_wrappers.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/nvim/lua/api_wrappers.c b/src/nvim/lua/api_wrappers.c
new file mode 100644
index 0000000000..2b7b0c6471
--- /dev/null
+++ b/src/nvim/lua/api_wrappers.c
@@ -0,0 +1,18 @@
+#include <lauxlib.h>
+#include <lua.h>
+#include <lualib.h>
+
+#include "nvim/api/private/defs.h"
+#include "nvim/api/private/dispatch.h"
+#include "nvim/api/private/helpers.h"
+#include "nvim/ex_docmd.h"
+#include "nvim/ex_getln.h"
+#include "nvim/func_attr.h"
+#include "nvim/globals.h"
+#include "nvim/lua/converter.h"
+#include "nvim/lua/executor.h"
+#include "nvim/memory.h"
+
+#ifdef INCLUDE_GENERATED_DECLARATIONS
+# include "lua_api_c_bindings.generated.h"
+#endif