aboutsummaryrefslogtreecommitdiffstats
path: root/libwc/uhc.h
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@vega.ocn.ne.jp>2011-05-04 07:05:14 +0000
committerTatsuya Kinoshita <tats@vega.ocn.ne.jp>2011-05-04 07:05:14 +0000
commit72f72d64a422d6628c4796f5c0bf2e508f134214 (patch)
tree0c9ea90cc53310832c977265521fb44db24a515e /libwc/uhc.h
parentAdding upstream version 0.3 (diff)
downloadw3m-72f72d64a422d6628c4796f5c0bf2e508f134214.tar.gz
w3m-72f72d64a422d6628c4796f5c0bf2e508f134214.zip
Adding upstream version 0.5.1upstream/0.5.1
Diffstat (limited to 'libwc/uhc.h')
-rw-r--r--libwc/uhc.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/libwc/uhc.h b/libwc/uhc.h
new file mode 100644
index 0000000..5d7a078
--- /dev/null
+++ b/libwc/uhc.h
@@ -0,0 +1,38 @@
+
+#ifndef _WC_UHC_H
+#define _WC_UHC_H
+
+#define WC_C_UHC_END 0xC6FE
+
+#define WC_UHC_NOSTATE 0
+#define WC_UHC_MBYTE1 1 /* 0x81 - 0xA0, 0xA1 - 0xFE */
+
+#define WC_UHC_MAP_C0 0x0
+#define WC_UHC_MAP_GL 0x1
+#define WC_UHC_MAP_C1 0x2
+#define WC_UHC_MAP_LB 0x4
+#define WC_UHC_MAP_UB (0x8 | WC_UHC_MAP_LB)
+
+#define WC_UHCUL_N(U,L) (((U) - 0x81) * 0xB2 + (L) - (((L) < 0x61) ? 0x41 : (((L) < 0x81) ? 0x47 : 0x4D)))
+#define WC_UHC_N(c) WC_UHCUL_N(((c) >> 8) & 0xFF, (c) & 0xFF)
+#define WC_N_UHCU(c) ((c) / 0xB2 + 0x81)
+#define WC_N_UHCL(c) ((c) % 0xB2 + (((c) % 0xB2 < 0x1A) ? 0x41 : (((c) % 0xB2 < 0x34) ? 0x47 : 0x4D)))
+#define WC_N_UHC(c) ((WC_N_UHCU(c) << 8) + WC_N_UHCL(c))
+#ifndef WC_CS128W_N
+#define WC_CS128WUL_N(U,L) ((U) * 0x80 + (L))
+#define WC_CS128W_N(c) WC_CS128WUL_N(((c) >> 8) & 0x7F, (c) & 0x7F)
+#define WC_N_CS128WU(c) ((c) / 0x80)
+#define WC_N_CS128WL(c) ((c) % 0x80)
+#define WC_N_CS128W(c) ((WC_N_CS128WU(c) << 8) + WC_N_CS128WL(c))
+#endif
+
+extern wc_uchar WC_UHC_MAP[];
+
+extern wc_wchar_t wc_uhc_to_cs128w(wc_wchar_t cc);
+extern wc_wchar_t wc_cs128w_to_uhc(wc_wchar_t cc);
+extern wc_uint32 wc_uhc_to_N(wc_uint32 c);
+extern Str wc_conv_from_uhc(Str is, wc_ces ces);
+extern void wc_push_to_uhc(Str os, wc_wchar_t cc, wc_status *st);
+extern Str wc_char_conv_from_uhc(wc_uchar c, wc_status *st);
+
+#endif