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 /text-util.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 'text-util.h')
| -rw-r--r-- | text-util.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/text-util.h b/text-util.h index 85bfa04..922bab3 100644 --- a/text-util.h +++ b/text-util.h @@ -12,20 +12,20 @@ /* create an empty / invalid range of size zero */ #define text_range_empty() (Filerange){.start = EPOS, .end = EPOS} /* merge two ranges into a new one which contains both of them */ -Filerange text_range_union(const Filerange*, const Filerange*); +VIS_INTERNAL Filerange text_range_union(const Filerange*, const Filerange*); /* get intersection of two ranges */ -Filerange text_range_intersect(const Filerange*, const Filerange*); +VIS_INTERNAL Filerange text_range_intersect(const Filerange*, const Filerange*); /* create new range [min(a,b), max(a,b)] */ -Filerange text_range_new(size_t a, size_t b); +VIS_INTERNAL Filerange text_range_new(size_t a, size_t b); /* test whether two ranges are equal */ -bool text_range_equal(const Filerange*, const Filerange*); +VIS_INTERNAL bool text_range_equal(const Filerange*, const Filerange*); /* test whether two ranges overlap */ -bool text_range_overlap(const Filerange*, const Filerange*); +VIS_INTERNAL bool text_range_overlap(const Filerange*, const Filerange*); /* test whether a given position is within a certain range */ -bool text_range_contains(const Filerange*, size_t pos); +VIS_INTERNAL bool text_range_contains(const Filerange*, size_t pos); /* count the number of graphemes in data */ -int text_char_count(const char *data, size_t len); +VIS_INTERNAL int text_char_count(const char *data, size_t len); /* get the approximate display width of data */ -int text_string_width(const char *data, size_t len); +VIS_INTERNAL int text_string_width(const char *data, size_t len); #endif |
