aboutsummaryrefslogtreecommitdiff
path: root/text-objects.h
diff options
context:
space:
mode:
authorRandy Palamar <randy@rnpnr.xyz>2025-12-05 12:05:32 -0700
committerRandy Palamar <randy@rnpnr.xyz>2025-12-16 11:28:44 -0700
commit1d1d19ed30309b39fc5e43c830cabb4cdd004d07 (patch)
tree56bb7c09d3b07118e39e7fc6174403b0235d56a7 /text-objects.h
parent65dd46e0bba74948c824370a06e509cba462cd72 (diff)
downloadvis-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-objects.h')
-rw-r--r--text-objects.h54
1 files changed, 27 insertions, 27 deletions
diff --git a/text-objects.h b/text-objects.h
index 3fb829e..d9ea218 100644
--- a/text-objects.h
+++ b/text-objects.h
@@ -10,48 +10,48 @@
#include "text.h"
/* return range covering the entire text */
-Filerange text_object_entire(Text*, size_t pos);
+VIS_INTERNAL Filerange text_object_entire(Text*, size_t pos);
/* word which happens to be at pos without any neighbouring white spaces */
-Filerange text_object_word(Text*, size_t pos);
+VIS_INTERNAL Filerange text_object_word(Text*, size_t pos);
/* includes trailing white spaces. If at pos happens to be a white space
* include all neighbouring leading white spaces and the following word. */
-Filerange text_object_word_outer(Text*, size_t pos);
+VIS_INTERNAL Filerange text_object_word_outer(Text*, size_t pos);
/* find next occurrence of `word' (as word not substring) in forward/backward direction */
-Filerange text_object_word_find_next(Text*, size_t pos, const char *word);
-Filerange text_object_word_find_prev(Text*, size_t pos, const char *word);
+VIS_INTERNAL Filerange text_object_word_find_next(Text*, size_t pos, const char *word);
+VIS_INTERNAL Filerange text_object_word_find_prev(Text*, size_t pos, const char *word);
/* find next occurrence of a literal string (not regex) in forward/backward direction */
-Filerange text_object_find_next(Text *txt, size_t pos, const char *search);
-Filerange text_object_find_prev(Text *txt, size_t pos, const char *search);
+VIS_INTERNAL Filerange text_object_find_next(Text *txt, size_t pos, const char *search);
+VIS_INTERNAL Filerange text_object_find_prev(Text *txt, size_t pos, const char *search);
/* same semantics as above but for a longword (i.e. delimited by white spaces) */
-Filerange text_object_longword(Text*, size_t pos);
-Filerange text_object_longword_outer(Text*, size_t pos);
+VIS_INTERNAL Filerange text_object_longword(Text*, size_t pos);
+VIS_INTERNAL Filerange text_object_longword_outer(Text*, size_t pos);
-Filerange text_object_line(Text*, size_t pos);
-Filerange text_object_line_inner(Text*, size_t pos);
-Filerange text_object_sentence(Text*, size_t pos);
-Filerange text_object_paragraph(Text*, size_t pos);
-Filerange text_object_paragraph_outer(Text*, size_t pos);
+VIS_INTERNAL Filerange text_object_line(Text*, size_t pos);
+VIS_INTERNAL Filerange text_object_line_inner(Text*, size_t pos);
+VIS_INTERNAL Filerange text_object_sentence(Text*, size_t pos);
+VIS_INTERNAL Filerange text_object_paragraph(Text*, size_t pos);
+VIS_INTERNAL Filerange text_object_paragraph_outer(Text*, size_t pos);
/* these are inner text objects i.e. the delimiters themself are not
* included in the range */
-Filerange text_object_square_bracket(Text*, size_t pos);
-Filerange text_object_curly_bracket(Text*, size_t pos);
-Filerange text_object_angle_bracket(Text*, size_t pos);
-Filerange text_object_parenthesis(Text*, size_t pos);
-Filerange text_object_quote(Text*, size_t pos);
-Filerange text_object_single_quote(Text*, size_t pos);
-Filerange text_object_backtick(Text*, size_t pos);
+VIS_INTERNAL Filerange text_object_square_bracket(Text*, size_t pos);
+VIS_INTERNAL Filerange text_object_curly_bracket(Text*, size_t pos);
+VIS_INTERNAL Filerange text_object_angle_bracket(Text*, size_t pos);
+VIS_INTERNAL Filerange text_object_parenthesis(Text*, size_t pos);
+VIS_INTERNAL Filerange text_object_quote(Text*, size_t pos);
+VIS_INTERNAL Filerange text_object_single_quote(Text*, size_t pos);
+VIS_INTERNAL Filerange text_object_backtick(Text*, size_t pos);
/* match a search term in either forward or backward direction */
-Filerange text_object_search_forward(Text*, size_t pos, Regex*);
-Filerange text_object_search_backward(Text*, size_t pos, Regex*);
+VIS_INTERNAL Filerange text_object_search_forward(Text*, size_t pos, Regex*);
+VIS_INTERNAL Filerange text_object_search_backward(Text*, size_t pos, Regex*);
/* match all lines with same indentation level as the current one */
-Filerange text_object_indentation(Text*, size_t pos);
+VIS_INTERNAL Filerange text_object_indentation(Text*, size_t pos);
/* extend a range to cover whole lines */
-Filerange text_range_linewise(Text*, Filerange*);
+VIS_INTERNAL Filerange text_range_linewise(Text*, Filerange*);
/* trim leading and trailing white spaces from range */
-Filerange text_range_inner(Text*, Filerange*);
+VIS_INTERNAL Filerange text_range_inner(Text*, Filerange*);
/* test whether a given range covers whole lines */
-bool text_range_is_linewise(Text*, Filerange*);
+VIS_INTERNAL bool text_range_is_linewise(Text*, Filerange*);
#endif