summaryrefslogtreecommitdiff
path: root/xs_unicode.h
diff options
context:
space:
mode:
Diffstat (limited to 'xs_unicode.h')
-rw-r--r--xs_unicode.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/xs_unicode.h b/xs_unicode.h
index 1799d89..2e9a754 100644
--- a/xs_unicode.h
+++ b/xs_unicode.h
@@ -4,7 +4,7 @@
4 4
5#define _XS_UNICODE_H 5#define _XS_UNICODE_H
6 6
7 int _xs_utf8_enc(char buf[4], unsigned int cpoint); 7 int xs_utf8_enc(char buf[4], unsigned int cpoint);
8 int xs_is_utf8_cont_byte(char c); 8 int xs_is_utf8_cont_byte(char c);
9 unsigned int xs_utf8_dec(const char **str); 9 unsigned int xs_utf8_dec(const char **str);
10 int xs_unicode_width(unsigned int cpoint); 10 int xs_unicode_width(unsigned int cpoint);
@@ -22,7 +22,7 @@
22 int xs_unicode_is_alpha(unsigned int cpoint); 22 int xs_unicode_is_alpha(unsigned int cpoint);
23 23
24#ifdef _XS_H 24#ifdef _XS_H
25 xs_str *xs_utf8_enc(xs_str *str, unsigned int cpoint); 25 xs_str *xs_utf8_cat(xs_str *str, unsigned int cpoint);
26#endif 26#endif
27 27
28#ifdef XS_IMPLEMENTATION 28#ifdef XS_IMPLEMENTATION
@@ -31,7 +31,7 @@
31#define xs_countof(a) (sizeof((a)) / sizeof((*a))) 31#define xs_countof(a) (sizeof((a)) / sizeof((*a)))
32#endif 32#endif
33 33
34int _xs_utf8_enc(char buf[4], unsigned int cpoint) 34int xs_utf8_enc(char buf[4], unsigned int cpoint)
35/* encodes an Unicode codepoint to utf-8 into buf and returns the size in bytes */ 35/* encodes an Unicode codepoint to utf-8 into buf and returns the size in bytes */
36{ 36{
37 char *p = buf; 37 char *p = buf;
@@ -172,12 +172,12 @@ unsigned int xs_surrogate_enc(unsigned int cpoint)
172 172
173#ifdef _XS_H 173#ifdef _XS_H
174 174
175xs_str *xs_utf8_enc(xs_str *str, unsigned int cpoint) 175xs_str *xs_utf8_cat(xs_str *str, unsigned int cpoint)
176/* encodes an Unicode codepoint to utf-8 into str */ 176/* encodes an Unicode codepoint to utf-8 into str */
177{ 177{
178 char tmp[4]; 178 char tmp[4];
179 179
180 int c = _xs_utf8_enc(tmp, cpoint); 180 int c = xs_utf8_enc(tmp, cpoint);
181 181
182 return xs_append_m(str, tmp, c); 182 return xs_append_m(str, tmp, c);
183} 183}