diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-09-22 21:02:15 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-09-22 21:02:15 +0000 |
commit | 604c11affe988bab23c87598c02248fff1d73f43 (patch) | |
tree | 6252cbbfd3cf703691a8ddbf1fdee5c1246b5faa /libwc/hkscs.h | |
parent | * version.c.in: cvs version (diff) | |
download | w3m-604c11affe988bab23c87598c02248fff1d73f43.tar.gz w3m-604c11affe988bab23c87598c02248fff1d73f43.zip |
merge m17n patch
add libwc
Diffstat (limited to '')
-rw-r--r-- | libwc/hkscs.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/libwc/hkscs.h b/libwc/hkscs.h new file mode 100644 index 0000000..bc7ff94 --- /dev/null +++ b/libwc/hkscs.h @@ -0,0 +1,38 @@ + +#ifndef _WC_HKSCS_H +#define _WC_HKSCS_H + +#define WC_HKSCS_NOSTATE 0 +#define WC_HKSCS_MBYTE1 1 /* 0x88 - 0xFE */ + +#define WC_HKSCS_MAP_C0 0x0 +#define WC_HKSCS_MAP_GL 0x1 +#define WC_HKSCS_MAP_C1 0x2 +#define WC_HKSCS_MAP_LB 0x4 +#define WC_HKSCS_MAP_UB (0x8 | WC_HKSCS_MAP_LB) +#define WC_HKSCS_MAP_UH 0x10 + +#define WC_HKSCSUL_N(U,L) (((U) - 0x88) * 0x9D \ + + (L) - (((L) < 0xA1) ? 0x40 : 0x62)) +#define WC_HKSCS_N(c) WC_HKSCSUL_N(((c) >> 8) & 0xFF, (c) & 0xFF) +#define WC_N_HKSCSU(c) ((c) / 0x9D + 0x88) +#define WC_N_HKSCSL(c) ((c) % 0x9D + (((c) % 0x9D < 0x3F) ? 0x40 : 0x62)) +#define WC_N_HKSCS(c) ((WC_N_HKSCSU(c) << 8) + WC_N_HKSCSL(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_HKSCS_MAP[]; + +extern wc_wchar_t wc_hkscs_to_cs128w(wc_wchar_t cc); +extern wc_wchar_t wc_cs128w_to_hkscs(wc_wchar_t cc); +extern wc_uint32 wc_hkscs_to_N(wc_uint32 c); +extern Str wc_conv_from_hkscs(Str is, wc_ces ces); +extern void wc_push_to_hkscs(Str os, wc_wchar_t cc, wc_status *st); +extern Str wc_char_conv_from_hkscs(wc_uchar c, wc_status *st); + +#endif |