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 --- text-internal.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'text-internal.h') diff --git a/text-internal.h b/text-internal.h index 5ed84ae..3f9052f 100644 --- a/text-internal.h +++ b/text-internal.h @@ -19,17 +19,17 @@ typedef struct { } type; } Block; -Block *block_alloc(size_t size); -Block *block_read(size_t size, int fd); -Block *block_mmap(size_t size, int fd, off_t offset); -Block *block_load(int dirfd, const char *filename, enum TextLoadMethod method, struct stat *info); -void block_free(Block*); -bool block_capacity(Block*, size_t len); -const char *block_append(Block*, const char *data, size_t len); -bool block_insert(Block*, size_t pos, const char *data, size_t len); -bool block_delete(Block*, size_t pos, size_t len); +VIS_INTERNAL Block *block_alloc(size_t size); +VIS_INTERNAL Block *block_read(size_t size, int fd); +VIS_INTERNAL Block *block_mmap(size_t size, int fd, off_t offset); +VIS_INTERNAL Block *block_load(int dirfd, const char *filename, enum TextLoadMethod method, struct stat *info); +VIS_INTERNAL void block_free(Block*); +VIS_INTERNAL bool block_capacity(Block*, size_t len); +VIS_INTERNAL const char *block_append(Block*, const char *data, size_t len); +VIS_INTERNAL bool block_insert(Block*, size_t pos, const char *data, size_t len); +VIS_INTERNAL bool block_delete(Block*, size_t pos, size_t len); -Block *text_block_mmaped(Text*); -void text_saved(Text*, struct stat *meta); +VIS_INTERNAL Block *text_block_mmaped(Text*); +VIS_INTERNAL void text_saved(Text*, struct stat *meta); #endif -- cgit v1.2.3