aboutsummaryrefslogtreecommitdiffstats
path: root/libwc/wc_types.h
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@vega.ocn.ne.jp>2011-05-04 07:18:09 +0000
committerTatsuya Kinoshita <tats@vega.ocn.ne.jp>2011-05-04 07:18:09 +0000
commit5f8e0f8ef9a422691dd72e8a953a42a41478fcb4 (patch)
tree4b2df4796a534793648b3c4fc532fc36bd0cd525 /libwc/wc_types.h
parentReleasing debian version 0.3-2.4 (diff)
downloadw3m-debian/0.5.1-1.tar.gz
w3m-debian/0.5.1-1.zip
Releasing debian version 0.5.1-1debian/0.5.1-1
Diffstat (limited to 'libwc/wc_types.h')
-rw-r--r--libwc/wc_types.h117
1 files changed, 117 insertions, 0 deletions
diff --git a/libwc/wc_types.h b/libwc/wc_types.h
new file mode 100644
index 0000000..845bf2f
--- /dev/null
+++ b/libwc/wc_types.h
@@ -0,0 +1,117 @@
+
+#ifndef _WC_TYPES_H
+#define _WC_TYPES_H
+
+#include <Str.h>
+#include <config.h>
+#if defined(HAVE_STDINT_H)
+# include <stdint.h>
+#elif defined(HAVE_INTTYPES_H)
+# include <inttypes.h>
+#endif
+
+typedef unsigned char wc_uchar;
+#if defined(HAVE_STDINT_H) || defined(HAVE_INTTYPES_H)
+typedef uint8_t wc_uint8;
+typedef uint16_t wc_uint16;
+typedef uint32_t wc_uint32;
+#else
+typedef unsigned char wc_uint8;
+typedef unsigned short wc_uint16;
+typedef unsigned long wc_uint32;
+#endif
+
+typedef wc_uint32 wc_ccs;
+typedef wc_uint32 wc_ces;
+typedef wc_uint32 wc_locale;
+typedef wc_uchar wc_bool;
+
+typedef struct {
+ wc_ccs ccs;
+ wc_uint32 code;
+} wc_wchar_t;
+
+typedef struct {
+ wc_uint16 code;
+ wc_uint16 code2;
+} wc_map;
+
+typedef struct {
+ wc_uint16 code;
+ wc_uint16 code2;
+ wc_uint16 code3;
+} wc_map3;
+
+typedef struct {
+ wc_ccs ccs;
+ size_t n;
+ wc_map *map;
+ wc_wchar_t (*conv)();
+} wc_table;
+
+typedef struct {
+ wc_ccs ccs;
+ wc_uchar g;
+ wc_bool init;
+} wc_gset;
+
+typedef struct {
+ wc_ces id;
+ char *name;
+ char *desc;
+ wc_gset *gset;
+ wc_uchar *gset_ext;
+ Str (*conv_from)();
+ void (*push_to)();
+ Str (*char_conv)();
+} wc_ces_info;
+
+typedef struct {
+ wc_ces id;
+ char *name;
+ char *desc;
+} wc_ces_list;
+
+typedef struct {
+ wc_uint8 auto_detect; /* automatically charset detect */
+ wc_bool use_combining; /* use combining characters */
+ wc_bool use_language_tag; /* use language_tags */
+ wc_bool ucs_conv; /* charset conversion using Unicode */
+ wc_bool pre_conv; /* previously charset conversion */
+ wc_bool fix_width_conv; /* not allowed conversion between different
+ width charsets */
+ wc_bool use_gb12345_map; /* use GB 12345 Unicode map instead of
+ GB 2312 Unicode map */
+ wc_bool use_jisx0201; /* use JIS X 0201 Roman instead of US_ASCII */
+ wc_bool use_jisc6226; /* use JIS C 6226:1978 instead of JIS X 0208 */
+ wc_bool use_jisx0201k; /* use JIS X 0201 Katakana */
+ wc_bool use_jisx0212; /* use JIS X 0212 */
+ wc_bool use_jisx0213; /* use JIS X 0213 */
+ wc_bool strict_iso2022; /* strict ISO 2022 */
+ wc_bool gb18030_as_ucs; /* treat 4 bytes char. of GB18030 as Unicode */
+ wc_bool no_replace; /* don't output replace character */
+ wc_bool use_wide; /* use wide characters */
+} wc_option;
+
+typedef struct {
+ wc_ces_info *ces_info;
+ wc_uint8 gr;
+ wc_uint8 gl;
+ wc_uint8 ss;
+ wc_ccs g0_ccs;
+ wc_ccs g1_ccs;
+ wc_ccs design[4];
+#ifdef USE_UNICODE
+ wc_table **tlist;
+ wc_table **tlistw;
+#endif
+ int state;
+#ifdef USE_UNICODE
+ Str tag;
+ int ntag;
+ wc_uint32 base;
+ int shift;
+#endif
+} wc_status;
+
+#endif