w3m

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/w3m.git/
Log | Files | Refs | README

wtf.h (2631B)


      1 
      2 #ifndef _WC_WTF_H
      3 #define _WC_WTF_H
      4 
      5 #define WTF_C_CS94	0x80
      6 #define WTF_C_CS94W	0x81
      7 #define WTF_C_CS96	0x82
      8 #define WTF_C_CS96W	0x83	/* reserved */
      9 #define WTF_C_CS942	0x84
     10 #define WTF_C_UNKNOWN	0x85
     11 #define WTF_C_PCS	0x86
     12 #define WTF_C_PCSW	0x87
     13 #define WTF_C_WCS16	0x88
     14 #define WTF_C_WCS16W	0x89
     15 #define WTF_C_WCS32	0x8A
     16 #define WTF_C_WCS32W	0x8B
     17 
     18 #define WTF_C_COMB	0x10
     19 #define WTF_C_CS94_C	(WTF_C_CS94|WTF_C_COMB)		/* reserved */
     20 #define WTF_C_CS94W_C	(WTF_C_CS94W|WTF_C_COMB)	/* reserved */
     21 #define WTF_C_CS96_C	(WTF_C_CS96|WTF_C_COMB)		/* reserved */
     22 #define WTF_C_CS96W_C	(WTF_C_CS96W|WTF_C_COMB)	/* reserved */
     23 #define WTF_C_CS942_C	(WTF_C_CS942|WTF_C_COMB)	/* reserved */
     24 #define WTF_C_PCS_C	(WTF_C_PCS|WTF_C_COMB)
     25 #define WTF_C_PCSW_C	(WTF_C_PCSW|WTF_C_COMB)		/* reserved */
     26 #define WTF_C_WCS16_C	(WTF_C_WCS16|WTF_C_COMB)
     27 #define WTF_C_WCS16W_C	(WTF_C_WCS16W|WTF_C_COMB)	/* reserved */
     28 #define WTF_C_WCS32_C	(WTF_C_WCS32|WTF_C_COMB)	/* reserved */
     29 #define WTF_C_WCS32W_C	(WTF_C_WCS32W|WTF_C_COMB)	/* reserved */
     30 
     31 #define WTF_C_UNDEF0	0x8C
     32 #define WTF_C_UNDEF1	0x8D
     33 #define WTF_C_UNDEF2	0x8E
     34 #define WTF_C_UNDEF3	0x8F
     35 #define WTF_C_UNDEF4	0x9C
     36 #define WTF_C_UNDEF5	0x9D
     37 #define WTF_C_UNDEF6	0x9E
     38 #define WTF_C_UNDEF7	0x9F
     39 #define WTF_C_NBSP	0xA0
     40 
     41 #define WTF_TYPE_ASCII		0x0
     42 #define WTF_TYPE_CTRL		0x1
     43 #define WTF_TYPE_WCHAR1		0x2
     44 #define WTF_TYPE_WCHAR2		0x4
     45 #define WTF_TYPE_WIDE		0x8
     46 #define WTF_TYPE_UNKNOWN	0x10
     47 #define WTF_TYPE_UNDEF		0x20
     48 #define WTF_TYPE_WCHAR1W	(WTF_TYPE_WCHAR1|WTF_TYPE_WIDE)
     49 #define WTF_TYPE_WCHAR2W	(WTF_TYPE_WCHAR2|WTF_TYPE_WIDE)
     50 
     51 extern wc_uint8 WTF_WIDTH_MAP[];
     52 extern wc_uint8 WTF_LEN_MAP[];
     53 extern wc_uint8 WTF_TYPE_MAP[];
     54 extern wc_ccs   wtf_gr_ccs;
     55 
     56 extern void       wtf_init(wc_ces ces1, wc_ces ces2);
     57 
     58 /* extern int     wtf_width(wc_uchar *p); */
     59 #define wtf_width(p) (WcOption.use_wide ? (int)WTF_WIDTH_MAP[(wc_uchar)*(p)] \
     60 		      : ((int)WTF_WIDTH_MAP[(wc_uchar)*(p)] ? 1 : 0))
     61 extern int        wtf_strwidth(wc_uchar *p);
     62 /* extern size_t  wtf_len1(wc_uchar *p); */
     63 #define wtf_len1(p) ((int)WTF_LEN_MAP[(wc_uchar)*(p)])
     64 extern size_t     wtf_len(wc_uchar *p);
     65 /* extern int     wtf_type(wc_uchar *p); */
     66 #define wtf_type(p) WTF_TYPE_MAP[(wc_uchar)*(p)]
     67 
     68 extern void       wtf_push(Str os, wc_ccs ccs, wc_uint32 code);
     69 extern void       wtf_push_unknown(Str os, wc_uchar *p, size_t len);
     70 extern wc_wchar_t wtf_parse(wc_uchar **p);
     71 extern wc_wchar_t wtf_parse1(wc_uchar **p);
     72 
     73 extern wc_ccs     wtf_get_ccs(wc_uchar *p);
     74 extern wc_uint32  wtf_get_code(wc_uchar *p);
     75 
     76 extern wc_bool    wtf_is_hangul(wc_uchar *p);
     77 
     78 extern char      *wtf_conv_fit(char *s, wc_ces ces);
     79 
     80 #endif