From 1d1d19ed30309b39fc5e43c830cabb4cdd004d07 Mon Sep 17 00:00:00 2001 From: Randy Palamar Date: Fri, 5 Dec 2025 12:05:32 -0700 Subject: mark all functions in headers with VIS_EXPORT or VIS_INTERNAL if vis actually wants to be a library exported symbols may need mark up depending on the platform (eg. __declspec(dllexport)). This needs to be hidden behind a macro because the way you export is not the same on every platform. I did this based on the assumption that vis.h was supposed to be the only interface to the "vis" library. Since nobody actually uses vis as a library I have no idea if this is actually correct. Anyway marking up all prototypes like this allows for one to convert all functions to static if a single translation unit is used by inserting at the start: #define VIS_INTERNAL static #define VIS_EXPORT static --- vis-lua.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'vis-lua.h') diff --git a/vis-lua.h b/vis-lua.h index 76e7029..db969de 100644 --- a/vis-lua.h +++ b/vis-lua.h @@ -15,20 +15,20 @@ typedef void* lua_CFunction; #include "vis-subprocess.h" /* add a directory to consider when loading lua files */ -bool vis_lua_path_add(Vis*, const char *path); +VIS_INTERNAL bool vis_lua_path_add(Vis*, const char *path); /* get semicolon separated list of paths to load lua files * (*lpath = package.path) and Lua C modules (*cpath = package.cpath) * both these pointers need to be free(3)-ed by the caller */ -bool vis_lua_paths_get(Vis*, char **lpath, char **cpath); +VIS_INTERNAL bool vis_lua_paths_get(Vis*, char **lpath, char **cpath); /* various event handlers, triggered by the vis core */ #if !CONFIG_LUA #define vis_event_mode_insert_input vis_insert_key #define vis_event_mode_replace_input vis_replace_key #else -void vis_event_mode_insert_input(Vis*, const char *key, size_t len); -void vis_event_mode_replace_input(Vis*, const char *key, size_t len); +VIS_INTERNAL void vis_event_mode_insert_input(Vis*, const char *key, size_t len); +VIS_INTERNAL void vis_event_mode_replace_input(Vis*, const char *key, size_t len); #endif -void vis_lua_process_response(Vis *, const char *, char *, size_t, ResponseType); +VIS_INTERNAL void vis_lua_process_response(Vis *, const char *, char *, size_t, ResponseType); #endif -- cgit v1.2.3