2 * Sherlock: Processing of tagged characters
4 * (c) 2001--2003 Martin Mares <mj@ucw.cz>
7 #ifndef _SHERLOCK_TAGGED_TEXT_H
8 #define _SHERLOCK_TAGGED_TEXT_H
10 #include "lib/fastbuf.h"
11 #include "lib/ff-utf8.h"
13 /* Reading of tagged text (Unicode values, tags mapped to 0x80000000 and higher) */
15 #define GET_TAGGED_CHAR(p,u) do { \
29 ASSERT(*p >= 0x80 && *p <= 0xbf); \
30 u = 0x80010000 + ((u & 0x0f) << 6) + (*p++ & 0x3f); \
39 #define SKIP_TAGGED_CHAR(p) do { \
40 if (*p >= 0x80 && *p < 0xc0) \
43 if (u >= 0xa0 && u < 0xb0 && *p >= 0x80 && *p < 0xc0) \
51 bget_tagged_char(struct fastbuf *f)
66 ASSERT(v >= 0x80 && v <= 0xbf);
67 u = 0x80010000 + ((u & 0x0f) << 6) + (v & 0x3f);