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 --- ui.h | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'ui.h') diff --git a/ui.h b/ui.h index c4d81db..6ed0587 100644 --- a/ui.h +++ b/ui.h @@ -103,36 +103,36 @@ typedef struct { #include "vis.h" #include "text.h" -bool ui_terminal_init(Ui*); -int ui_terminal_colors(void); -void ui_terminal_free(Ui*); -void ui_terminal_restore(Ui*); -void ui_terminal_resume(Ui*); -void ui_terminal_save(Ui*, bool fscr); -void ui_terminal_suspend(Ui*); - -__attribute__((noreturn)) void ui_die(Ui *, const char *, va_list); -bool ui_init(Ui *, Vis *); -void ui_arrange(Ui*, enum UiLayout); -void ui_draw(Ui*); -void ui_info_hide(Ui *); -void ui_info_show(Ui *, const char *, va_list); -void ui_redraw(Ui*); -void ui_resize(Ui*); - -bool ui_window_init(Ui *, Win *, enum UiOption); -void ui_window_focus(Win *); +VIS_INTERNAL bool ui_terminal_init(Ui*); +VIS_INTERNAL int ui_terminal_colors(void); +VIS_INTERNAL void ui_terminal_free(Ui*); +VIS_INTERNAL void ui_terminal_restore(Ui*); +VIS_INTERNAL void ui_terminal_resume(Ui*); +VIS_INTERNAL void ui_terminal_save(Ui*, bool fscr); +VIS_INTERNAL void ui_terminal_suspend(Ui*); + +VIS_INTERNAL __attribute__((noreturn)) void ui_die(Ui *, const char *, va_list); +VIS_INTERNAL bool ui_init(Ui *, Vis *); +VIS_INTERNAL void ui_arrange(Ui*, enum UiLayout); +VIS_INTERNAL void ui_draw(Ui*); +VIS_INTERNAL void ui_info_hide(Ui *); +VIS_INTERNAL void ui_info_show(Ui *, const char *, va_list); +VIS_INTERNAL void ui_redraw(Ui*); +VIS_INTERNAL void ui_resize(Ui*); + +VIS_INTERNAL bool ui_window_init(Ui *, Win *, enum UiOption); +VIS_INTERNAL void ui_window_focus(Win *); /* removes a window from the list of open windows */ -void ui_window_release(Ui *, Win *); -void ui_window_swap(Win *, Win *); +VIS_INTERNAL void ui_window_release(Ui *, Win *); +VIS_INTERNAL void ui_window_swap(Win *, Win *); -bool ui_getkey(Ui *, TermKeyKey *); +VIS_INTERNAL bool ui_getkey(Ui *, TermKeyKey *); -bool ui_style_define(Win *win, int id, const char *style); -void ui_window_style_set(Ui *ui, int win_id, Cell *cell, enum UiStyle id, bool keep_non_default); -bool ui_window_style_set_pos(Win *win, int x, int y, enum UiStyle id, bool keep_non_default); +VIS_INTERNAL bool ui_style_define(Win *win, int id, const char *style); +VIS_INTERNAL void ui_window_style_set(Ui *ui, int win_id, Cell *cell, enum UiStyle id, bool keep_non_default); +VIS_INTERNAL bool ui_window_style_set_pos(Win *win, int x, int y, enum UiStyle id, bool keep_non_default); -void ui_window_options_set(Win *win, enum UiOption options); -void ui_window_status(Win *win, const char *status); +VIS_INTERNAL void ui_window_options_set(Win *win, enum UiOption options); +VIS_INTERNAL void ui_window_status(Win *win, const char *status); #endif -- cgit v1.2.3