aboutsummaryrefslogtreecommitdiffstats
path: root/libcharconv_latin.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcharconv_latin.c')
-rw-r--r--libcharconv_latin.c70
1 files changed, 70 insertions, 0 deletions
diff --git a/libcharconv_latin.c b/libcharconv_latin.c
index 1961b18..d8c27d0 100644
--- a/libcharconv_latin.c
+++ b/libcharconv_latin.c
@@ -20,6 +20,7 @@ libcharconv_latin(const char *s, size_t slen, size_t *n, uint_least32_t *cp, siz
enum libcharconv_result ret = LIBCHARCONV_CONVERTED;
uint_least32_t c;
char c1, c2, c3, c4, c5, c6;
+ const char *cs;
size_t i, clen;
unsigned num;
@@ -669,6 +670,64 @@ libcharconv_latin(const char *s, size_t slen, size_t *n, uint_least32_t *cp, siz
case UINT32_C(0x13D75): c1 = '4'; goto conv1;
case UINT32_C(0x13D76): c1 = '5'; goto conv1;
+ /* symbols */
+ case UINT32_C(0x269E): c1 = '-'; c2 = '>'; goto conv2;
+ case UINT32_C(0x269F): c1 = '<'; c2 = '-'; goto conv2;
+ case UINT32_C(0x2120): c1 = 'S'; c2 = 'M'; goto conv2;
+ case UINT32_C(0x2122): c1 = 'T'; c2 = 'M'; goto conv2;
+ case UINT32_C(0x00A9): c1 = '('; c2 = 'C'; c3 = ')'; goto conv3;
+ case UINT32_C(0x1F1AD): c1 = '('; c2 = 'M'; c3 = ')'; goto conv3;
+ case UINT32_C(0x2117): c1 = '('; c2 = 'P'; c3 = ')'; goto conv3;
+ case UINT32_C(0x00AE): c1 = '('; c2 = 'R'; c3 = ')'; goto conv3;
+ case UINT32_C(0x1F10D): c1 = '('; c2 = '0'; c3 = ')'; goto conv3;
+ case UINT32_C(0x1F10F): c1 = '\\'; c2 = '('; c3 = '$'; c4 = ')'; goto conv4;
+ case UINT32_C(0x1F16E): c1 = '\\'; c2 = '('; c3 = 'C'; c4 = ')'; goto conv4;
+ case UINT32_C(0x1F16D): c1 = '('; c2 = 'C'; c3 = 'C'; c4 = ')'; goto conv4;
+ case UINT32_C(0x212E): c1 = 'e'; goto conv1;
+ case UINT32_C(0x2139): c1 = 'i'; goto conv1;
+ case UINT32_C(0x212A): c1 = 'K'; goto conv1;
+ case UINT32_C(0x213B): c1 = 'F'; c2 = 'A'; c3 = 'X'; goto conv3;
+ case UINT32_C(0x2121): c1 = 'T'; c2 = 'E'; c3 = 'L'; goto conv3;
+ case UINT32_C(0x2100): c1 = 'a'; c2 = '/'; c3 = 'c'; goto conv3;
+ case UINT32_C(0x214D): c1 = 'A'; c2 = '/'; c3 = 'S'; goto conv3;
+ case UINT32_C(0x2101): c1 = 'a'; c2 = '/'; c3 = 's'; goto conv3;
+ case UINT32_C(0x00AA): c1 = 'a'; goto conv1;
+ case UINT32_C(0x00BA): c1 = 'o'; goto conv1;
+ case UINT32_C(0x2300): c1 = '/'; c2 = 'o'; goto conv2;
+ case UINT32_C(0x2116): c1 = 'N'; c2 = 'o'; goto conv2;
+ case UINT32_C(0x2118): c1 = 'P'; goto conv1;
+ case UINT32_C(0x214A): c1 = 'P'; c2 = 'L'; goto conv2;
+ case UINT32_C(0x211E): c1 = 'P'; c2 = 'x'; goto conv2;
+ case UINT32_C(0x211F): c1 = 'R'; c2 = '/'; goto conv2;
+ case UINT32_C(0x2123): c1 = 'V'; c2 = '/'; goto conv2;
+ case UINT32_C(0x2125): c1 = 'z'; goto conv1;
+ case UINT32_C(0x23E8): c1 = '1'; c2 = '0'; goto conv2;
+ case UINT32_C(0x2104): c1 = 'C'; c2 = 'L'; goto conv2;
+ case UINT32_C(0x2105): c1 = 'c'; c2 = '/'; c3 = 'o'; goto conv3;
+ case UINT32_C(0x2106): c1 = 'c'; c2 = '/'; c3 = 'u'; goto conv3;
+ case UINT32_C(0x2113): c1 = 'l'; goto conv1;
+ case UINT32_C(0x2114): c1 = 'l'; c2 = 'b'; goto conv2;
+ case UINT32_C(0x1F19B): c1 = '['; c2 = '3'; c3 = 'D'; c4 = ']'; goto conv4;
+ case UINT32_C(0x1F19C): cs = "[2ND SCR]"; goto conv_str;
+ case UINT32_C(0x1F1A7): c1 = '['; c2 = 'H'; c3 = 'D'; c4 = 'R'; c5 = ']'; goto conv5;
+ case UINT32_C(0x1F1A6): c1 = '['; c2 = 'H'; c3 = 'C'; c4 = ']'; goto conv4;
+ case UINT32_C(0x1F1AC): c1 = '['; c2 = 'V'; c3 = 'O'; c4 = 'D'; c5 = ']'; goto conv5;
+ case UINT32_C(0x1F1A3): c1 = '['; c2 = '6'; c3 = '0'; c4 = 'P'; c5 = ']'; goto conv5;
+ case UINT32_C(0x1F1A8): cs = "[HI-RES]"; goto conv_str;
+ case UINT32_C(0x1F1A4): c1 = '['; c2 = '1'; c3 = '2'; c4 = '0'; c5 = 'P'; c6 = ']'; goto conv6;
+ case UINT32_C(0x1F19D): c1 = '['; c2 = '2'; c3 = 'K'; c4 = ']'; goto conv4;
+ case UINT32_C(0x1F19E): c1 = '['; c2 = '4'; c3 = 'K'; c4 = ']'; goto conv4;
+ case UINT32_C(0x1F19F): c1 = '['; c2 = '8'; c3 = 'K'; c4 = ']'; goto conv4;
+ case UINT32_C(0x1F1AB): c1 = '['; c2 = 'U'; c3 = 'H'; c4 = 'D'; c5 = ']'; goto conv5;
+ case UINT32_C(0x1F1AA): c1 = '['; c2 = 'S'; c3 = 'H'; c4 = 'V'; c5 = ']'; goto conv5;
+ case UINT32_C(0x1F1A9): cs = "[LOSSLESS]"; goto conv_str;
+ case UINT32_C(0x1F1A0): c1 = '['; c2 = '5'; c3 = '.'; c4 = '1'; c5 = ']'; goto conv5;
+ case UINT32_C(0x1F1A1): c1 = '['; c2 = '7'; c3 = '.'; c4 = '1'; c5 = ']'; goto conv5;
+ case UINT32_C(0x1F1A2): c1 = '['; c2 = '2'; c3 = '2'; c4 = '.'; c5 = '2'; c6 = ']'; goto conv6;
+ case UINT32_C(0x2141): c1 = 'G'; goto conv1;
+ case UINT32_C(0x2142): c1 = 'L'; goto conv1;
+ case UINT32_C(0x2144): c1 = 'Y'; goto conv1;
+
default:
no_match:
*n += clen;
@@ -767,4 +826,15 @@ conv6:
cp[5] = (uint_least32_t)c6;
*ncp = 6u;
return ret;
+
+conv_str:
+ if (*n)
+ goto no_conv;
+ *n += clen;
+ i = 0u;
+ for (; cs[i]; i++)
+ if (*ncp > i)
+ cp[i] = (uint_least32_t)cs[i];
+ *ncp = i;
+ return ret;
}