auxunistring.h /size: 796 b    last modification: 2024-01-16 10:22
1/*
2    See license.txt in the root of this project.
3*/
4
5# ifndef LMT_UTILITIES_UNISTRING_H
6# define LMT_UTILITIES_UNISTRING_H
7
8extern unsigned char *aux_uni2str      (unsigned);
9extern unsigned       aux_str2uni      (const unsigned char *text);
10extern unsigned       aux_str2uni_len  (const unsigned char *text, int *len);
11extern char          *aux_uni2string   (char *utf8_text, unsigned ch);
12extern unsigned       aux_splitutf2uni (unsigned int *ubuf, const char *utf8buf);
13extern size_t         aux_utf8len      (const char *text, size_t size);
14
15# define is_utf8_follow(a)    (a >= 0x80 && a < 0xC0)
16# define utf8_size(a)         (a > 0xFFFF ? 4 : (a > 0x7FF ? 3 : (a > 0x7F ? 2 : 1)))
17# define buffer_to_unichar(k) aux_str2uni((const unsigned char *)(lmt_fileio_state.io_buffer+k))
18
19# endif
20