aboutsummaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-05-28 01:56:13 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-05-28 01:56:13 -0400
commit59c5470adeb99da30dfd9d45a6035ec0936b29f3 (patch)
tree314e509827ba62e579fb4f62526b9953c158545c /utf8.c
parent1dd05d2d18f30f1ee921386f50cc1b63f32a09e2 (diff)
Tweak default visibility settings
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/utf8.c b/utf8.c
index 08e8932..c5fc14b 100644
--- a/utf8.c
+++ b/utf8.c
@@ -7,6 +7,7 @@
#include <unistd.h>
#include "utf8.h"
+#include "utils.h"
#define ARRAY_LEN(a) (sizeof(a)/sizeof((a)[0]))
#define likely(x) __builtin_expect((x), 1)
@@ -182,7 +183,7 @@ static const uint32_t XID_Continue_only[][2] = {
// Return the location of the next character or UTF8 codepoint.
// (i.e. skip forward one codepoint at a time, not one byte at a time)
//
-const char *next_char(const char *str, const char *end)
+public const char *next_char(const char *str, const char *end)
{
if (likely(str+1 <= end) && likely((str[0] & 0x80) == 0x0))
return str+1;
@@ -199,7 +200,7 @@ const char *next_char(const char *str, const char *end)
// Return the location of the previous character or UTF8 codepoint.
// (i.e. skip backwards one codepoint at a time, not one byte at a time)
//
-const char *prev_char(const char *start, const char *str)
+public const char *prev_char(const char *start, const char *str)
{
if (likely(str-1 >= start) && likely((str[-1] & 0x80) == 0x0))
return str-1;
@@ -260,7 +261,7 @@ static bool find_in_ranges(uint32_t codepoint, const uint32_t ranges[][2], size_
return false;
}
-bool isidstart(const char *str, const char *end)
+public bool isidstart(const char *str, const char *end)
{
if (unlikely(str >= end)) return false;
else if (isalpha(*str) || *str == '_') return true;
@@ -270,7 +271,7 @@ bool isidstart(const char *str, const char *end)
&& find_in_ranges(codepoint, XID_Start, ARRAY_LEN(XID_Start));
}
-bool isidcontinue(const char *str, const char *end)
+public bool isidcontinue(const char *str, const char *end)
{
if (unlikely(str >= end)) return false;
else if (isalnum(*str) || *str == '_') return true;