6 #include "yacjs_name.h"
8 #define U8S_NAME(n) YACJS_NAME(u8s_ ## n)
10 typedef char * U8S_NAME(ptr);
11 typedef const char * U8S_NAME(cptr);
13 /* Get beginning of next UTF-8 character. */
14 U8S_NAME(cptr) U8S_NAME(next)(U8S_NAME(cptr) str);
15 /* Get length of UTF-8 string in characters. */
16 size_t U8S_NAME(strlen)(U8S_NAME(cptr) str);
17 /* Get length of UTF-8 string in bytes. */
18 size_t U8S_NAME(strlenb)(U8S_NAME(cptr) str);
19 /* Get length of UTF-8 string in bytes. */
20 size_t U8S_NAME(strnlenb)(U8S_NAME(cptr) str, size_t bufsiz);
21 /* Copy UTF-8 string into target. */
22 U8S_NAME(ptr) U8S_NAME(strcpy)(U8S_NAME(ptr) target, U8S_NAME(cptr) src);
23 /* Copy at most bufsiz bytes of the source UTF-8 string into target, respecting
24 UTF-8 character boundaries, and ensuring that the target is
26 U8S_NAME(ptr) U8S_NAME(strncpy)(U8S_NAME(ptr) target, U8S_NAME(cptr) src,
28 /* Compare two NULL-terminated UTF-8 strings. */
29 int U8S_NAME(strcmp)(U8S_NAME(cptr) a, U8S_NAME(cptr) b);
30 /* Compare at most the first bufsiz bytes of two possibly non-NULL-terminated
32 int U8S_NAME(strncmp)(U8S_NAME(cptr) a, U8S_NAME(cptr) b, size_t bufsiz);
33 /* Create a copy of a NULL-terminated UTF-8 string with memory allocated via
35 U8S_NAME(ptr) U8S_NAME(strdup)(U8S_NAME(cptr) s);
36 /* Create a copy of a NULL-terminated UTF-8 string with memory allocated via
38 U8S_NAME(ptr) U8S_NAME(strndup)(U8S_NAME(cptr) s, size_t bufsiz);