diff options
| author | Randy Palamar <randy@rnpnr.xyz> | 2025-12-05 12:05:32 -0700 |
|---|---|---|
| committer | Randy Palamar <randy@rnpnr.xyz> | 2025-12-16 11:28:44 -0700 |
| commit | 1d1d19ed30309b39fc5e43c830cabb4cdd004d07 (patch) | |
| tree | 56bb7c09d3b07118e39e7fc6174403b0235d56a7 /ui.h | |
| parent | 65dd46e0bba74948c824370a06e509cba462cd72 (diff) | |
| download | vis-1d1d19ed30309b39fc5e43c830cabb4cdd004d07.tar.gz vis-1d1d19ed30309b39fc5e43c830cabb4cdd004d07.tar.xz | |
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
Diffstat (limited to 'ui.h')
| -rw-r--r-- | ui.h | 54 |
1 files changed, 27 insertions, 27 deletions
@@ -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 |
