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 /vis-core.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 'vis-core.h')
| -rw-r--r-- | vis-core.h | 64 |
1 files changed, 33 insertions, 31 deletions
@@ -2,6 +2,9 @@ #define VIS_CORE_H #include <setjmp.h> + +#include "util.h" + #include "vis.h" #include "sam.h" #include "vis-lua.h" @@ -10,7 +13,6 @@ #include "map.h" #include "array.h" #include "buffer.h" -#include "util.h" /* a mode contains a set of key bindings which are currently valid. * @@ -239,7 +241,7 @@ enum VisEvents { VIS_EVENT_UI_DRAW, }; -bool vis_event_emit(Vis*, enum VisEvents, ...); +VIS_INTERNAL bool vis_event_emit(Vis*, enum VisEvents, ...); typedef struct { char name; @@ -257,46 +259,46 @@ extern const TextObject vis_textobjects[VIS_TEXTOBJECT_INVALID]; extern const MarkDef vis_marks[VIS_MARK_a]; extern const RegisterDef vis_registers[VIS_REG_a]; -void macro_operator_stop(Vis *vis); -void macro_operator_record(Vis *vis); +VIS_INTERNAL void macro_operator_stop(Vis *vis); +VIS_INTERNAL void macro_operator_record(Vis *vis); -void vis_do(Vis *vis); -void action_reset(Action*); -size_t vis_text_insert_nl(Vis*, Text*, size_t pos); +VIS_INTERNAL void vis_do(Vis *vis); +VIS_INTERNAL void action_reset(Action*); +VIS_INTERNAL size_t vis_text_insert_nl(Vis*, Text*, size_t pos); -Mode *mode_get(Vis*, enum VisMode); -void mode_set(Vis *vis, Mode *new_mode); -Macro *macro_get(Vis *vis, enum VisRegister); +VIS_INTERNAL Mode *mode_get(Vis*, enum VisMode); +VIS_INTERNAL void mode_set(Vis *vis, Mode *new_mode); +VIS_INTERNAL Macro *macro_get(Vis *vis, enum VisRegister); -Win *window_new_file(Vis*, File*, enum UiOption); -void window_selection_save(Win *win); -void window_status_update(Vis *vis, Win *win); +VIS_INTERNAL Win *window_new_file(Vis*, File*, enum UiOption); +VIS_INTERNAL void window_selection_save(Win *win); +VIS_INTERNAL void window_status_update(Vis *vis, Win *win); -char *absolute_path(const char *path); +VIS_INTERNAL char *absolute_path(const char *path); -const char *file_name_get(File*); -void file_name_set(File*, const char *name); +VIS_INTERNAL const char *file_name_get(File*); +VIS_INTERNAL void file_name_set(File*, const char *name); -bool register_init(Register*); -void register_release(Register*); +VIS_INTERNAL bool register_init(Register*); +VIS_INTERNAL void register_release(Register*); -void mark_init(Array*); -void mark_release(Array*); +VIS_INTERNAL void mark_init(Array*); +VIS_INTERNAL void mark_release(Array*); -void marklist_init(MarkList*, size_t max); -void marklist_release(MarkList*); +VIS_INTERNAL void marklist_init(MarkList*, size_t max); +VIS_INTERNAL void marklist_release(MarkList*); -const char *register_get(Vis*, Register*, size_t *len); -const char *register_slot_get(Vis*, Register*, size_t slot, size_t *len); +VIS_INTERNAL const char *register_get(Vis*, Register*, size_t *len); +VIS_INTERNAL const char *register_slot_get(Vis*, Register*, size_t slot, size_t *len); -bool register_put0(Vis*, Register*, const char *data); -bool register_put(Vis*, Register*, const char *data, size_t len); -bool register_slot_put(Vis*, Register*, size_t slot, const char *data, size_t len); +VIS_INTERNAL bool register_put0(Vis*, Register*, const char *data); +VIS_INTERNAL bool register_put(Vis*, Register*, const char *data, size_t len); +VIS_INTERNAL bool register_slot_put(Vis*, Register*, size_t slot, const char *data, size_t len); -bool register_put_range(Vis*, Register*, Text*, Filerange*); -bool register_slot_put_range(Vis*, Register*, size_t slot, Text*, Filerange*); +VIS_INTERNAL bool register_put_range(Vis*, Register*, Text*, Filerange*); +VIS_INTERNAL bool register_slot_put_range(Vis*, Register*, size_t slot, Text*, Filerange*); -size_t vis_register_count(Vis*, Register*); -bool register_resize(Register*, size_t count); +VIS_INTERNAL size_t vis_register_count(Vis*, Register*); +VIS_INTERNAL bool register_resize(Register*, size_t count); #endif |
