14 #ifndef RUBY_TRANSCODE_DATA_H 15 #define RUBY_TRANSCODE_DATA_H 1 19 #define WORDINDEX_SHIFT_BITS 2 20 #define WORDINDEX2INFO(widx) ((widx) << WORDINDEX_SHIFT_BITS) 21 #define INFO2WORDINDEX(info) ((info) >> WORDINDEX_SHIFT_BITS) 22 #define BYTE_LOOKUP_BASE(bl) ((bl)[0]) 23 #define BYTE_LOOKUP_INFO(bl) ((bl)[1]) 25 #define PType (unsigned int) 27 #define NOMAP (PType 0x01) 30 #define THREEbt (0x05) 32 #define INVALID (PType 0x07) 33 #define UNDEF (PType 0x09) 34 #define ZERObt (PType 0x0A) 35 #define FUNii (PType 0x0B) 36 #define FUNsi (PType 0x0D) 37 #define FUNio (PType 0x0E) 38 #define FUNso (PType 0x0F) 39 #define STR1 (PType 0x11) 40 #define GB4bt (PType 0x12) 41 #define FUNsio (PType 0x13) 43 #define STR1_LENGTH(byte_addr) (unsigned int)(*(byte_addr) + 4) 44 #define STR1_BYTEINDEX(w) ((w) >> 6) 45 #define makeSTR1(bi) (((bi) << 6) | STR1) 46 #define makeSTR1LEN(len) ((len)-4) 48 #define o1(b1) (PType((((unsigned char)(b1))<<8)|ONEbt)) 49 #define o2(b1,b2) (PType((((unsigned char)(b1))<<8)|\ 50 (((unsigned char)(b2))<<16)|\ 52 #define o3(b1,b2,b3) (PType(((((unsigned char)(b1))<<8)|\ 53 (((unsigned char)(b2))<<16)|\ 54 (((unsigned int)(unsigned char)(b3))<<24)|\ 57 #define o4(b0,b1,b2,b3) (PType(((((unsigned char)(b1))<<8)|\ 58 (((unsigned char)(b2))<<16)|\ 59 (((unsigned int)(unsigned char)(b3))<<24)|\ 60 ((((unsigned char)(b0))&0x07)<<5)|\ 63 #define g4(b0,b1,b2,b3) (PType(((((unsigned char)(b0))<<8)|\ 64 (((unsigned char)(b2))<<16)|\ 65 ((((unsigned char)(b1))&0x0f)<<24)|\ 66 ((((unsigned int)(unsigned char)(b3))&0x0f)<<28)|\ 69 #define funsio(diff) (PType((((unsigned int)(diff))<<8)|FUNsio)) 71 #define getBT1(a) ((unsigned char)((a)>> 8)) 72 #define getBT2(a) ((unsigned char)((a)>>16)) 73 #define getBT3(a) ((unsigned char)((a)>>24)) 74 #define getBT0(a) (((unsigned char)((a)>> 5)&0x07)|0xF0) 76 #define getGB4bt0(a) ((unsigned char)((a)>> 8)) 77 #define getGB4bt1(a) (((unsigned char)((a)>>24)&0x0F)|0x30) 78 #define getGB4bt2(a) ((unsigned char)((a)>>16)) 79 #define getGB4bt3(a) (((unsigned char)((a)>>28)&0x0F)|0x30) 81 #define o2FUNii(b1,b2) (PType((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|FUNii)) 117 ssize_t (*
func_so)(
void*,
const unsigned char*, size_t,
unsigned char*, size_t);
121 ssize_t (*
func_sio)(
void*,
const unsigned char*, size_t,
VALUE,
unsigned char*, size_t);
131 #if defined(EXTSTATIC) && EXTSTATIC 132 # define TRANS_INIT(name) void Init_trans_ ## name(void) 134 # define TRANS_INIT(name) void Init_ ## name(void) const unsigned char * byte_array
const char * dst_encoding
void rb_declare_transcoder(const char *enc1, const char *enc2, const char *lib)
ssize_t(* func_sio)(void *, const unsigned char *, size_t, VALUE, unsigned char *, size_t)
unsigned int conv_tree_start
VALUE(* func_ii)(void *, VALUE)
int(* state_init_func)(void *)
ssize_t(* func_so)(void *, const unsigned char *, size_t, unsigned char *, size_t)
VALUE(* func_si)(void *, const unsigned char *, size_t)
ssize_t(* finish_func)(void *, unsigned char *, size_t)
void rb_register_transcoder(const rb_transcoder *)
ssize_t(* resetsize_func)(void *)
const unsigned int * word_array
int(* state_fini_func)(void *)
ssize_t(* func_io)(void *, VALUE, const unsigned char *, size_t)
rb_transcoder_asciicompat_type_t asciicompat_type
ssize_t(* resetstate_func)(void *, unsigned char *, size_t)
#define RUBY_SYMBOL_EXPORT_END
unsigned int byte_array_length
#define RUBY_SYMBOL_EXPORT_BEGIN
const char * src_encoding
unsigned int word_array_length
rb_transcoder_asciicompat_type_t