did_you_mean 0.9.0 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.travis.yml +1 -1
- data/CHANGELOG.md +150 -0
- data/README.md +14 -1
- data/did_you_mean.gemspec +0 -1
- data/ext/did_you_mean/extconf.rb +14 -11
- data/ext/did_you_mean/ruby_headers/215/id.h +173 -0
- data/ext/did_you_mean/ruby_headers/215/internal.h +892 -0
- data/ext/did_you_mean/ruby_headers/215/method.h +142 -0
- data/ext/did_you_mean/ruby_headers/215/node.h +543 -0
- data/ext/did_you_mean/ruby_headers/215/ruby_atomic.h +170 -0
- data/ext/did_you_mean/ruby_headers/215/thread_native.h +23 -0
- data/ext/did_you_mean/ruby_headers/215/thread_pthread.h +56 -0
- data/ext/did_you_mean/ruby_headers/215/thread_win32.h +45 -0
- data/ext/did_you_mean/ruby_headers/215/vm_core.h +1055 -0
- data/ext/did_you_mean/ruby_headers/215/vm_debug.h +37 -0
- data/ext/did_you_mean/ruby_headers/215/vm_opts.h +56 -0
- data/ext/did_you_mean/ruby_headers/220/internal.h +11 -6
- data/ext/did_you_mean/ruby_headers/220/vm_core.h +1 -0
- data/lib/did_you_mean/finders.rb +1 -1
- data/lib/did_you_mean/test_helper.rb +0 -4
- data/lib/did_you_mean/version.rb +1 -1
- data/test/no_method_error_extension_test.rb +0 -6
- data/test/test_helper.rb +0 -1
- metadata +18 -196
- data/docs/did_you_mean_example.png +0 -0
- data/ext/did_you_mean/ruby_headers/193/addr2line.h +0 -21
- data/ext/did_you_mean/ruby_headers/193/constant.h +0 -34
- data/ext/did_you_mean/ruby_headers/193/dln.h +0 -50
- data/ext/did_you_mean/ruby_headers/193/encdb.h +0 -170
- data/ext/did_you_mean/ruby_headers/193/eval_intern.h +0 -234
- data/ext/did_you_mean/ruby_headers/193/gc.h +0 -99
- data/ext/did_you_mean/ruby_headers/193/iseq.h +0 -126
- data/ext/did_you_mean/ruby_headers/193/parse.h +0 -183
- data/ext/did_you_mean/ruby_headers/193/probes.h +0 -83
- data/ext/did_you_mean/ruby_headers/193/regenc.h +0 -219
- data/ext/did_you_mean/ruby_headers/193/regint.h +0 -850
- data/ext/did_you_mean/ruby_headers/193/regparse.h +0 -362
- data/ext/did_you_mean/ruby_headers/193/revision.h +0 -1
- data/ext/did_you_mean/ruby_headers/193/siphash.h +0 -48
- data/ext/did_you_mean/ruby_headers/193/timev.h +0 -21
- data/ext/did_you_mean/ruby_headers/193/transcode_data.h +0 -117
- data/ext/did_you_mean/ruby_headers/193/transdb.h +0 -190
- data/ext/did_you_mean/ruby_headers/193/verconf.h +0 -13
- data/ext/did_you_mean/ruby_headers/193/version.h +0 -52
- data/ext/did_you_mean/ruby_headers/193/vm_exec.h +0 -184
- data/ext/did_you_mean/ruby_headers/193/vm_insnhelper.h +0 -220
- data/ext/did_you_mean/ruby_headers/200/addr2line.h +0 -21
- data/ext/did_you_mean/ruby_headers/200/constant.h +0 -36
- data/ext/did_you_mean/ruby_headers/200/dln.h +0 -50
- data/ext/did_you_mean/ruby_headers/200/encdb.h +0 -170
- data/ext/did_you_mean/ruby_headers/200/eval_intern.h +0 -213
- data/ext/did_you_mean/ruby_headers/200/gc.h +0 -104
- data/ext/did_you_mean/ruby_headers/200/iseq.h +0 -140
- data/ext/did_you_mean/ruby_headers/200/parse.h +0 -183
- data/ext/did_you_mean/ruby_headers/200/probes.h +0 -83
- data/ext/did_you_mean/ruby_headers/200/probes_helper.h +0 -67
- data/ext/did_you_mean/ruby_headers/200/regenc.h +0 -227
- data/ext/did_you_mean/ruby_headers/200/regint.h +0 -915
- data/ext/did_you_mean/ruby_headers/200/regparse.h +0 -367
- data/ext/did_you_mean/ruby_headers/200/revision.h +0 -1
- data/ext/did_you_mean/ruby_headers/200/siphash.h +0 -48
- data/ext/did_you_mean/ruby_headers/200/timev.h +0 -21
- data/ext/did_you_mean/ruby_headers/200/transcode_data.h +0 -127
- data/ext/did_you_mean/ruby_headers/200/transdb.h +0 -190
- data/ext/did_you_mean/ruby_headers/200/verconf.h +0 -13
- data/ext/did_you_mean/ruby_headers/200/version.h +0 -52
- data/ext/did_you_mean/ruby_headers/200/vm_exec.h +0 -173
- data/ext/did_you_mean/ruby_headers/200/vm_insnhelper.h +0 -274
- data/ext/did_you_mean/ruby_headers/210/addr2line.h +0 -21
- data/ext/did_you_mean/ruby_headers/210/constant.h +0 -36
- data/ext/did_you_mean/ruby_headers/210/dln.h +0 -51
- data/ext/did_you_mean/ruby_headers/210/encdb.h +0 -170
- data/ext/did_you_mean/ruby_headers/210/eval_intern.h +0 -260
- data/ext/did_you_mean/ruby_headers/210/gc.h +0 -101
- data/ext/did_you_mean/ruby_headers/210/iseq.h +0 -136
- data/ext/did_you_mean/ruby_headers/210/parse.h +0 -183
- data/ext/did_you_mean/ruby_headers/210/probes.h +0 -83
- data/ext/did_you_mean/ruby_headers/210/probes_helper.h +0 -67
- data/ext/did_you_mean/ruby_headers/210/regenc.h +0 -223
- data/ext/did_you_mean/ruby_headers/210/regint.h +0 -911
- data/ext/did_you_mean/ruby_headers/210/regparse.h +0 -363
- data/ext/did_you_mean/ruby_headers/210/revision.h +0 -1
- data/ext/did_you_mean/ruby_headers/210/siphash.h +0 -48
- data/ext/did_you_mean/ruby_headers/210/timev.h +0 -42
- data/ext/did_you_mean/ruby_headers/210/transcode_data.h +0 -123
- data/ext/did_you_mean/ruby_headers/210/transdb.h +0 -190
- data/ext/did_you_mean/ruby_headers/210/verconf.h +0 -13
- data/ext/did_you_mean/ruby_headers/210/version.h +0 -52
- data/ext/did_you_mean/ruby_headers/210/vm_exec.h +0 -182
- data/ext/did_you_mean/ruby_headers/210/vm_insnhelper.h +0 -273
- data/ext/did_you_mean/ruby_headers/211/addr2line.h +0 -21
- data/ext/did_you_mean/ruby_headers/211/constant.h +0 -36
- data/ext/did_you_mean/ruby_headers/211/dln.h +0 -51
- data/ext/did_you_mean/ruby_headers/211/encdb.h +0 -170
- data/ext/did_you_mean/ruby_headers/211/eval_intern.h +0 -260
- data/ext/did_you_mean/ruby_headers/211/gc.h +0 -101
- data/ext/did_you_mean/ruby_headers/211/iseq.h +0 -136
- data/ext/did_you_mean/ruby_headers/211/parse.h +0 -183
- data/ext/did_you_mean/ruby_headers/211/probes.h +0 -83
- data/ext/did_you_mean/ruby_headers/211/probes_helper.h +0 -67
- data/ext/did_you_mean/ruby_headers/211/regenc.h +0 -223
- data/ext/did_you_mean/ruby_headers/211/regint.h +0 -911
- data/ext/did_you_mean/ruby_headers/211/regparse.h +0 -363
- data/ext/did_you_mean/ruby_headers/211/revision.h +0 -1
- data/ext/did_you_mean/ruby_headers/211/siphash.h +0 -48
- data/ext/did_you_mean/ruby_headers/211/timev.h +0 -42
- data/ext/did_you_mean/ruby_headers/211/transcode_data.h +0 -123
- data/ext/did_you_mean/ruby_headers/211/transdb.h +0 -190
- data/ext/did_you_mean/ruby_headers/211/verconf.h +0 -13
- data/ext/did_you_mean/ruby_headers/211/version.h +0 -52
- data/ext/did_you_mean/ruby_headers/211/vm_exec.h +0 -182
- data/ext/did_you_mean/ruby_headers/211/vm_insnhelper.h +0 -273
- data/ext/did_you_mean/ruby_headers/212/addr2line.h +0 -21
- data/ext/did_you_mean/ruby_headers/212/constant.h +0 -36
- data/ext/did_you_mean/ruby_headers/212/dln.h +0 -51
- data/ext/did_you_mean/ruby_headers/212/encdb.h +0 -170
- data/ext/did_you_mean/ruby_headers/212/eval_intern.h +0 -260
- data/ext/did_you_mean/ruby_headers/212/gc.h +0 -101
- data/ext/did_you_mean/ruby_headers/212/iseq.h +0 -136
- data/ext/did_you_mean/ruby_headers/212/parse.h +0 -183
- data/ext/did_you_mean/ruby_headers/212/probes.h +0 -83
- data/ext/did_you_mean/ruby_headers/212/probes_helper.h +0 -67
- data/ext/did_you_mean/ruby_headers/212/regenc.h +0 -223
- data/ext/did_you_mean/ruby_headers/212/regint.h +0 -911
- data/ext/did_you_mean/ruby_headers/212/regparse.h +0 -363
- data/ext/did_you_mean/ruby_headers/212/revision.h +0 -1
- data/ext/did_you_mean/ruby_headers/212/siphash.h +0 -48
- data/ext/did_you_mean/ruby_headers/212/timev.h +0 -42
- data/ext/did_you_mean/ruby_headers/212/transcode_data.h +0 -123
- data/ext/did_you_mean/ruby_headers/212/transdb.h +0 -190
- data/ext/did_you_mean/ruby_headers/212/verconf.h +0 -13
- data/ext/did_you_mean/ruby_headers/212/version.h +0 -52
- data/ext/did_you_mean/ruby_headers/212/vm_exec.h +0 -182
- data/ext/did_you_mean/ruby_headers/212/vm_insnhelper.h +0 -273
- data/ext/did_you_mean/ruby_headers/213/addr2line.h +0 -21
- data/ext/did_you_mean/ruby_headers/213/constant.h +0 -36
- data/ext/did_you_mean/ruby_headers/213/dln.h +0 -51
- data/ext/did_you_mean/ruby_headers/213/encdb.h +0 -170
- data/ext/did_you_mean/ruby_headers/213/eval_intern.h +0 -270
- data/ext/did_you_mean/ruby_headers/213/gc.h +0 -101
- data/ext/did_you_mean/ruby_headers/213/iseq.h +0 -136
- data/ext/did_you_mean/ruby_headers/213/parse.h +0 -183
- data/ext/did_you_mean/ruby_headers/213/probes.h +0 -83
- data/ext/did_you_mean/ruby_headers/213/probes_helper.h +0 -67
- data/ext/did_you_mean/ruby_headers/213/regenc.h +0 -223
- data/ext/did_you_mean/ruby_headers/213/regint.h +0 -911
- data/ext/did_you_mean/ruby_headers/213/regparse.h +0 -363
- data/ext/did_you_mean/ruby_headers/213/revision.h +0 -1
- data/ext/did_you_mean/ruby_headers/213/siphash.h +0 -48
- data/ext/did_you_mean/ruby_headers/213/timev.h +0 -42
- data/ext/did_you_mean/ruby_headers/213/transcode_data.h +0 -123
- data/ext/did_you_mean/ruby_headers/213/transdb.h +0 -190
- data/ext/did_you_mean/ruby_headers/213/verconf.h +0 -13
- data/ext/did_you_mean/ruby_headers/213/version.h +0 -52
- data/ext/did_you_mean/ruby_headers/213/vm_exec.h +0 -182
- data/ext/did_you_mean/ruby_headers/213/vm_insnhelper.h +0 -273
- data/ext/did_you_mean/ruby_headers/214/addr2line.h +0 -21
- data/ext/did_you_mean/ruby_headers/214/constant.h +0 -36
- data/ext/did_you_mean/ruby_headers/214/dln.h +0 -51
- data/ext/did_you_mean/ruby_headers/214/encdb.h +0 -170
- data/ext/did_you_mean/ruby_headers/214/eval_intern.h +0 -270
- data/ext/did_you_mean/ruby_headers/214/gc.h +0 -101
- data/ext/did_you_mean/ruby_headers/214/iseq.h +0 -136
- data/ext/did_you_mean/ruby_headers/214/parse.h +0 -183
- data/ext/did_you_mean/ruby_headers/214/probes.h +0 -83
- data/ext/did_you_mean/ruby_headers/214/probes_helper.h +0 -67
- data/ext/did_you_mean/ruby_headers/214/regenc.h +0 -223
- data/ext/did_you_mean/ruby_headers/214/regint.h +0 -911
- data/ext/did_you_mean/ruby_headers/214/regparse.h +0 -363
- data/ext/did_you_mean/ruby_headers/214/revision.h +0 -1
- data/ext/did_you_mean/ruby_headers/214/siphash.h +0 -48
- data/ext/did_you_mean/ruby_headers/214/timev.h +0 -42
- data/ext/did_you_mean/ruby_headers/214/transcode_data.h +0 -123
- data/ext/did_you_mean/ruby_headers/214/transdb.h +0 -190
- data/ext/did_you_mean/ruby_headers/214/verconf.h +0 -13
- data/ext/did_you_mean/ruby_headers/214/version.h +0 -52
- data/ext/did_you_mean/ruby_headers/214/vm_exec.h +0 -182
- data/ext/did_you_mean/ruby_headers/214/vm_insnhelper.h +0 -273
- data/ext/did_you_mean/ruby_headers/220/addr2line.h +0 -21
- data/ext/did_you_mean/ruby_headers/220/ccan/build_assert/build_assert.h +0 -40
- data/ext/did_you_mean/ruby_headers/220/ccan/licenses/BSD-MIT +0 -17
- data/ext/did_you_mean/ruby_headers/220/ccan/licenses/CC0 +0 -28
- data/ext/did_you_mean/ruby_headers/220/constant.h +0 -43
- data/ext/did_you_mean/ruby_headers/220/dln.h +0 -51
- data/ext/did_you_mean/ruby_headers/220/encdb.h +0 -170
- data/ext/did_you_mean/ruby_headers/220/eval_intern.h +0 -275
- data/ext/did_you_mean/ruby_headers/220/gc.h +0 -107
- data/ext/did_you_mean/ruby_headers/220/iseq.h +0 -157
- data/ext/did_you_mean/ruby_headers/220/parse.h +0 -183
- data/ext/did_you_mean/ruby_headers/220/probes.h +0 -83
- data/ext/did_you_mean/ruby_headers/220/probes_helper.h +0 -67
- data/ext/did_you_mean/ruby_headers/220/regenc.h +0 -234
- data/ext/did_you_mean/ruby_headers/220/regint.h +0 -972
- data/ext/did_you_mean/ruby_headers/220/regparse.h +0 -363
- data/ext/did_you_mean/ruby_headers/220/revision.h +0 -1
- data/ext/did_you_mean/ruby_headers/220/siphash.h +0 -48
- data/ext/did_you_mean/ruby_headers/220/timev.h +0 -42
- data/ext/did_you_mean/ruby_headers/220/transcode_data.h +0 -123
- data/ext/did_you_mean/ruby_headers/220/transdb.h +0 -190
- data/ext/did_you_mean/ruby_headers/220/verconf.h +0 -13
- data/ext/did_you_mean/ruby_headers/220/version.h +0 -53
- data/ext/did_you_mean/ruby_headers/220/vm_exec.h +0 -182
- data/ext/did_you_mean/ruby_headers/220/vm_insnhelper.h +0 -233
@@ -1,123 +0,0 @@
|
|
1
|
-
/**********************************************************************
|
2
|
-
|
3
|
-
transcode_data.h -
|
4
|
-
|
5
|
-
$Author$
|
6
|
-
created at: Mon 10 Dec 2007 14:01:47 JST 2007
|
7
|
-
|
8
|
-
Copyright (C) 2007 Martin Duerst
|
9
|
-
|
10
|
-
**********************************************************************/
|
11
|
-
|
12
|
-
#include "ruby/ruby.h"
|
13
|
-
|
14
|
-
#ifndef RUBY_TRANSCODE_DATA_H
|
15
|
-
#define RUBY_TRANSCODE_DATA_H 1
|
16
|
-
|
17
|
-
RUBY_SYMBOL_EXPORT_BEGIN
|
18
|
-
|
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])
|
24
|
-
|
25
|
-
#define PType (unsigned int)
|
26
|
-
|
27
|
-
#define NOMAP (PType 0x01) /* direct map */
|
28
|
-
#define ONEbt (0x02) /* one byte payload */
|
29
|
-
#define TWObt (0x03) /* two bytes payload */
|
30
|
-
#define THREEbt (0x05) /* three bytes payload */
|
31
|
-
#define FOURbt (0x06) /* four bytes payload, UTF-8 only, macros start at getBT0 */
|
32
|
-
#define INVALID (PType 0x07) /* invalid byte sequence */
|
33
|
-
#define UNDEF (PType 0x09) /* legal but undefined */
|
34
|
-
#define ZERObt (PType 0x0A) /* zero bytes of payload, i.e. remove */
|
35
|
-
#define FUNii (PType 0x0B) /* function from info to info */
|
36
|
-
#define FUNsi (PType 0x0D) /* function from start to info */
|
37
|
-
#define FUNio (PType 0x0E) /* function from info to output */
|
38
|
-
#define FUNso (PType 0x0F) /* function from start to output */
|
39
|
-
#define STR1 (PType 0x11) /* string 4 <= len <= 259 bytes: 1byte length + content */
|
40
|
-
#define GB4bt (PType 0x12) /* GB18030 four bytes payload */
|
41
|
-
#define FUNsio (PType 0x13) /* function from start and info to output */
|
42
|
-
|
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)
|
47
|
-
|
48
|
-
#define o1(b1) (PType((((unsigned char)(b1))<<8)|ONEbt))
|
49
|
-
#define o2(b1,b2) (PType((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|TWObt))
|
50
|
-
#define o3(b1,b2,b3) (PType(((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|(((unsigned int)(unsigned char)(b3))<<24)|THREEbt)&0xffffffffU))
|
51
|
-
#define o4(b0,b1,b2,b3) (PType(((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|(((unsigned char)(b3))<<24)|((((unsigned char)(b0))&0x07)<<5)|FOURbt)&0xffffffffU))
|
52
|
-
#define g4(b0,b1,b2,b3) (PType(((((unsigned char)(b0))<<8)|(((unsigned char)(b2))<<16)|((((unsigned char)(b1))&0x0f)<<24)|((((unsigned int)(unsigned char)(b3))&0x0f)<<28)|GB4bt)&0xffffffffU))
|
53
|
-
#define funsio(diff) (PType((((unsigned int)(diff))<<8)|FUNsio))
|
54
|
-
|
55
|
-
#define getBT1(a) ((unsigned char)((a)>> 8))
|
56
|
-
#define getBT2(a) ((unsigned char)((a)>>16))
|
57
|
-
#define getBT3(a) ((unsigned char)((a)>>24))
|
58
|
-
#define getBT0(a) (((unsigned char)((a)>> 5)&0x07)|0xF0) /* for UTF-8 only!!! */
|
59
|
-
|
60
|
-
#define getGB4bt0(a) ((unsigned char)((a)>> 8))
|
61
|
-
#define getGB4bt1(a) (((unsigned char)((a)>>24)&0x0F)|0x30)
|
62
|
-
#define getGB4bt2(a) ((unsigned char)((a)>>16))
|
63
|
-
#define getGB4bt3(a) (((unsigned char)((a)>>28)&0x0F)|0x30)
|
64
|
-
|
65
|
-
#define o2FUNii(b1,b2) (PType((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|FUNii))
|
66
|
-
|
67
|
-
/* do we need these??? maybe not, can be done with simple tables */
|
68
|
-
#define ONETRAIL /* legal but undefined if one more trailing UTF-8 */
|
69
|
-
#define TWOTRAIL /* legal but undefined if two more trailing UTF-8 */
|
70
|
-
#define THREETRAIL /* legal but undefined if three more trailing UTF-8 */
|
71
|
-
|
72
|
-
typedef enum {
|
73
|
-
asciicompat_converter, /* ASCII-compatible -> ASCII-compatible */
|
74
|
-
asciicompat_decoder, /* ASCII-incompatible -> ASCII-compatible */
|
75
|
-
asciicompat_encoder /* ASCII-compatible -> ASCII-incompatible */
|
76
|
-
/* ASCII-incompatible -> ASCII-incompatible is intentionally omitted. */
|
77
|
-
} rb_transcoder_asciicompat_type_t;
|
78
|
-
|
79
|
-
typedef struct rb_transcoder rb_transcoder;
|
80
|
-
|
81
|
-
/* static structure, one per supported encoding pair */
|
82
|
-
struct rb_transcoder {
|
83
|
-
const char *src_encoding;
|
84
|
-
const char *dst_encoding;
|
85
|
-
unsigned int conv_tree_start;
|
86
|
-
const unsigned char *byte_array;
|
87
|
-
unsigned int byte_array_length;
|
88
|
-
const unsigned int *word_array;
|
89
|
-
unsigned int word_array_length;
|
90
|
-
int word_size;
|
91
|
-
int input_unit_length;
|
92
|
-
int max_input;
|
93
|
-
int max_output;
|
94
|
-
rb_transcoder_asciicompat_type_t asciicompat_type;
|
95
|
-
size_t state_size;
|
96
|
-
int (*state_init_func)(void*); /* ret==0:success ret!=0:failure(errno) */
|
97
|
-
int (*state_fini_func)(void*); /* ret==0:success ret!=0:failure(errno) */
|
98
|
-
VALUE (*func_ii)(void*, VALUE); /* info -> info */
|
99
|
-
VALUE (*func_si)(void*, const unsigned char*, size_t); /* start -> info */
|
100
|
-
ssize_t (*func_io)(void*, VALUE, const unsigned char*, size_t); /* info -> output */
|
101
|
-
ssize_t (*func_so)(void*, const unsigned char*, size_t, unsigned char*, size_t); /* start -> output */
|
102
|
-
ssize_t (*finish_func)(void*, unsigned char*, size_t); /* -> output */
|
103
|
-
ssize_t (*resetsize_func)(void*); /* -> len */
|
104
|
-
ssize_t (*resetstate_func)(void*, unsigned char*, size_t); /* -> output */
|
105
|
-
ssize_t (*func_sio)(void*, const unsigned char*, size_t, VALUE, unsigned char*, size_t); /* start -> output */
|
106
|
-
};
|
107
|
-
|
108
|
-
void rb_declare_transcoder(const char *enc1, const char *enc2, const char *lib);
|
109
|
-
void rb_register_transcoder(const rb_transcoder *);
|
110
|
-
|
111
|
-
/*
|
112
|
-
* To get rid of collision of initializer symbols in statically-linked encodings
|
113
|
-
* and transcoders
|
114
|
-
*/
|
115
|
-
#if defined(EXTSTATIC) && EXTSTATIC
|
116
|
-
# define TRANS_INIT(name) void Init_trans_ ## name(void)
|
117
|
-
#else
|
118
|
-
# define TRANS_INIT(name) void Init_ ## name(void)
|
119
|
-
#endif
|
120
|
-
|
121
|
-
RUBY_SYMBOL_EXPORT_END
|
122
|
-
|
123
|
-
#endif /* RUBY_TRANSCODE_DATA_H */
|
@@ -1,190 +0,0 @@
|
|
1
|
-
rb_declare_transcoder("Big5", "UTF-8", "big5");
|
2
|
-
rb_declare_transcoder("UTF-8", "Big5", "big5");
|
3
|
-
rb_declare_transcoder("CP950", "UTF-8", "big5");
|
4
|
-
rb_declare_transcoder("UTF-8", "CP950", "big5");
|
5
|
-
rb_declare_transcoder("Big5-HKSCS", "UTF-8", "big5");
|
6
|
-
rb_declare_transcoder("UTF-8", "Big5-HKSCS", "big5");
|
7
|
-
rb_declare_transcoder("CP951", "UTF-8", "big5");
|
8
|
-
rb_declare_transcoder("UTF-8", "CP951", "big5");
|
9
|
-
rb_declare_transcoder("Big5-UAO", "UTF-8", "big5");
|
10
|
-
rb_declare_transcoder("UTF-8", "Big5-UAO", "big5");
|
11
|
-
rb_declare_transcoder("GB2312", "UTF-8", "chinese");
|
12
|
-
rb_declare_transcoder("GB12345", "UTF-8", "chinese");
|
13
|
-
rb_declare_transcoder("UTF-8", "GB2312", "chinese");
|
14
|
-
rb_declare_transcoder("UTF-8", "GB12345", "chinese");
|
15
|
-
rb_declare_transcoder("UTF8-DoCoMo", "UTF8-KDDI", "emoji");
|
16
|
-
rb_declare_transcoder("UTF8-DoCoMo", "UTF8-SoftBank", "emoji");
|
17
|
-
rb_declare_transcoder("UTF8-DoCoMo", "UTF-8", "emoji");
|
18
|
-
rb_declare_transcoder("UTF8-KDDI", "UTF8-DoCoMo", "emoji");
|
19
|
-
rb_declare_transcoder("UTF8-KDDI", "UTF8-SoftBank", "emoji");
|
20
|
-
rb_declare_transcoder("UTF8-KDDI", "UTF-8", "emoji");
|
21
|
-
rb_declare_transcoder("UTF8-SoftBank", "UTF8-DoCoMo", "emoji");
|
22
|
-
rb_declare_transcoder("UTF8-SoftBank", "UTF8-KDDI", "emoji");
|
23
|
-
rb_declare_transcoder("UTF8-SoftBank", "UTF-8", "emoji");
|
24
|
-
rb_declare_transcoder("UTF-8", "UTF8-DoCoMo", "emoji");
|
25
|
-
rb_declare_transcoder("UTF-8", "UTF8-KDDI", "emoji");
|
26
|
-
rb_declare_transcoder("UTF-8", "UTF8-SoftBank", "emoji");
|
27
|
-
rb_declare_transcoder("stateless-ISO-2022-JP-KDDI", "UTF8-KDDI", "emoji_iso2022_kddi");
|
28
|
-
rb_declare_transcoder("UTF8-KDDI", "stateless-ISO-2022-JP-KDDI", "emoji_iso2022_kddi");
|
29
|
-
rb_declare_transcoder("ISO-2022-JP-KDDI", "stateless-ISO-2022-JP-KDDI", "emoji_iso2022_kddi");
|
30
|
-
rb_declare_transcoder("stateless-ISO-2022-JP-KDDI", "ISO-2022-JP-KDDI", "emoji_iso2022_kddi");
|
31
|
-
rb_declare_transcoder("SJIS-DOCOMO", "UTF8-DOCOMO", "emoji_sjis_docomo");
|
32
|
-
rb_declare_transcoder("UTF8-DOCOMO", "SJIS-DOCOMO", "emoji_sjis_docomo");
|
33
|
-
rb_declare_transcoder("SJIS-KDDI", "UTF8-KDDI", "emoji_sjis_kddi");
|
34
|
-
rb_declare_transcoder("UTF8-KDDI", "SJIS-KDDI", "emoji_sjis_kddi");
|
35
|
-
rb_declare_transcoder("SJIS-SoftBank", "UTF8-SoftBank", "emoji_sjis_softbank");
|
36
|
-
rb_declare_transcoder("UTF8-SoftBank", "SJIS-SoftBank", "emoji_sjis_softbank");
|
37
|
-
rb_declare_transcoder("", "amp_escape", "escape");
|
38
|
-
rb_declare_transcoder("", "xml_text_escape", "escape");
|
39
|
-
rb_declare_transcoder("", "xml_attr_content_escape", "escape");
|
40
|
-
rb_declare_transcoder("", "xml_attr_quote", "escape");
|
41
|
-
rb_declare_transcoder("GB18030", "UTF-8", "gb18030");
|
42
|
-
rb_declare_transcoder("UTF-8", "GB18030", "gb18030");
|
43
|
-
rb_declare_transcoder("GBK", "UTF-8", "gbk");
|
44
|
-
rb_declare_transcoder("UTF-8", "GBK", "gbk");
|
45
|
-
rb_declare_transcoder("ISO-2022-JP", "stateless-ISO-2022-JP", "iso2022");
|
46
|
-
rb_declare_transcoder("stateless-ISO-2022-JP", "ISO-2022-JP", "iso2022");
|
47
|
-
rb_declare_transcoder("stateless-ISO-2022-JP", "EUC-JP", "iso2022");
|
48
|
-
rb_declare_transcoder("EUC-JP", "stateless-ISO-2022-JP", "iso2022");
|
49
|
-
rb_declare_transcoder("CP50220", "cp51932", "iso2022");
|
50
|
-
rb_declare_transcoder("CP50221", "cp51932", "iso2022");
|
51
|
-
rb_declare_transcoder("CP51932", "CP50221", "iso2022");
|
52
|
-
rb_declare_transcoder("CP51932", "CP50220", "iso2022");
|
53
|
-
rb_declare_transcoder("EUC-JP", "Shift_JIS", "japanese");
|
54
|
-
rb_declare_transcoder("Shift_JIS", "EUC-JP", "japanese");
|
55
|
-
rb_declare_transcoder("EUC-JP", "UTF-8", "japanese_euc");
|
56
|
-
rb_declare_transcoder("eucJP-ms", "UTF-8", "japanese_euc");
|
57
|
-
rb_declare_transcoder("CP51932", "UTF-8", "japanese_euc");
|
58
|
-
rb_declare_transcoder("EUC-JIS-2004", "UTF-8", "japanese_euc");
|
59
|
-
rb_declare_transcoder("UTF-8", "EUC-JP", "japanese_euc");
|
60
|
-
rb_declare_transcoder("UTF-8", "eucJP-ms", "japanese_euc");
|
61
|
-
rb_declare_transcoder("UTF-8", "CP51932", "japanese_euc");
|
62
|
-
rb_declare_transcoder("UTF-8", "EUC-JIS-2004", "japanese_euc");
|
63
|
-
rb_declare_transcoder("Shift_JIS", "UTF-8", "japanese_sjis");
|
64
|
-
rb_declare_transcoder("Windows-31J", "UTF-8", "japanese_sjis");
|
65
|
-
rb_declare_transcoder("UTF-8", "Shift_JIS", "japanese_sjis");
|
66
|
-
rb_declare_transcoder("UTF-8", "Windows-31J", "japanese_sjis");
|
67
|
-
rb_declare_transcoder("UTF-8", "EUC-KR", "korean");
|
68
|
-
rb_declare_transcoder("EUC-KR", "UTF-8", "korean");
|
69
|
-
rb_declare_transcoder("UTF-8", "CP949", "korean");
|
70
|
-
rb_declare_transcoder("CP949", "UTF-8", "korean");
|
71
|
-
rb_declare_transcoder("US-ASCII", "UTF-8", "single_byte");
|
72
|
-
rb_declare_transcoder("UTF-8", "US-ASCII", "single_byte");
|
73
|
-
rb_declare_transcoder("ASCII-8BIT", "UTF-8", "single_byte");
|
74
|
-
rb_declare_transcoder("UTF-8", "ASCII-8BIT", "single_byte");
|
75
|
-
rb_declare_transcoder("ISO-8859-1", "UTF-8", "single_byte");
|
76
|
-
rb_declare_transcoder("UTF-8", "ISO-8859-1", "single_byte");
|
77
|
-
rb_declare_transcoder("ISO-8859-2", "UTF-8", "single_byte");
|
78
|
-
rb_declare_transcoder("UTF-8", "ISO-8859-2", "single_byte");
|
79
|
-
rb_declare_transcoder("ISO-8859-3", "UTF-8", "single_byte");
|
80
|
-
rb_declare_transcoder("UTF-8", "ISO-8859-3", "single_byte");
|
81
|
-
rb_declare_transcoder("ISO-8859-4", "UTF-8", "single_byte");
|
82
|
-
rb_declare_transcoder("UTF-8", "ISO-8859-4", "single_byte");
|
83
|
-
rb_declare_transcoder("ISO-8859-5", "UTF-8", "single_byte");
|
84
|
-
rb_declare_transcoder("UTF-8", "ISO-8859-5", "single_byte");
|
85
|
-
rb_declare_transcoder("ISO-8859-6", "UTF-8", "single_byte");
|
86
|
-
rb_declare_transcoder("UTF-8", "ISO-8859-6", "single_byte");
|
87
|
-
rb_declare_transcoder("ISO-8859-7", "UTF-8", "single_byte");
|
88
|
-
rb_declare_transcoder("UTF-8", "ISO-8859-7", "single_byte");
|
89
|
-
rb_declare_transcoder("ISO-8859-8", "UTF-8", "single_byte");
|
90
|
-
rb_declare_transcoder("UTF-8", "ISO-8859-8", "single_byte");
|
91
|
-
rb_declare_transcoder("ISO-8859-9", "UTF-8", "single_byte");
|
92
|
-
rb_declare_transcoder("UTF-8", "ISO-8859-9", "single_byte");
|
93
|
-
rb_declare_transcoder("ISO-8859-10", "UTF-8", "single_byte");
|
94
|
-
rb_declare_transcoder("UTF-8", "ISO-8859-10", "single_byte");
|
95
|
-
rb_declare_transcoder("ISO-8859-11", "UTF-8", "single_byte");
|
96
|
-
rb_declare_transcoder("UTF-8", "ISO-8859-11", "single_byte");
|
97
|
-
rb_declare_transcoder("ISO-8859-13", "UTF-8", "single_byte");
|
98
|
-
rb_declare_transcoder("UTF-8", "ISO-8859-13", "single_byte");
|
99
|
-
rb_declare_transcoder("ISO-8859-14", "UTF-8", "single_byte");
|
100
|
-
rb_declare_transcoder("UTF-8", "ISO-8859-14", "single_byte");
|
101
|
-
rb_declare_transcoder("ISO-8859-15", "UTF-8", "single_byte");
|
102
|
-
rb_declare_transcoder("UTF-8", "ISO-8859-15", "single_byte");
|
103
|
-
rb_declare_transcoder("ISO-8859-16", "UTF-8", "single_byte");
|
104
|
-
rb_declare_transcoder("UTF-8", "ISO-8859-16", "single_byte");
|
105
|
-
rb_declare_transcoder("WINDOWS-874", "UTF-8", "single_byte");
|
106
|
-
rb_declare_transcoder("UTF-8", "WINDOWS-874", "single_byte");
|
107
|
-
rb_declare_transcoder("WINDOWS-1250", "UTF-8", "single_byte");
|
108
|
-
rb_declare_transcoder("UTF-8", "WINDOWS-1250", "single_byte");
|
109
|
-
rb_declare_transcoder("WINDOWS-1251", "UTF-8", "single_byte");
|
110
|
-
rb_declare_transcoder("UTF-8", "WINDOWS-1251", "single_byte");
|
111
|
-
rb_declare_transcoder("WINDOWS-1252", "UTF-8", "single_byte");
|
112
|
-
rb_declare_transcoder("UTF-8", "WINDOWS-1252", "single_byte");
|
113
|
-
rb_declare_transcoder("WINDOWS-1253", "UTF-8", "single_byte");
|
114
|
-
rb_declare_transcoder("UTF-8", "WINDOWS-1253", "single_byte");
|
115
|
-
rb_declare_transcoder("WINDOWS-1254", "UTF-8", "single_byte");
|
116
|
-
rb_declare_transcoder("UTF-8", "WINDOWS-1254", "single_byte");
|
117
|
-
rb_declare_transcoder("WINDOWS-1255", "UTF-8", "single_byte");
|
118
|
-
rb_declare_transcoder("UTF-8", "WINDOWS-1255", "single_byte");
|
119
|
-
rb_declare_transcoder("WINDOWS-1256", "UTF-8", "single_byte");
|
120
|
-
rb_declare_transcoder("UTF-8", "WINDOWS-1256", "single_byte");
|
121
|
-
rb_declare_transcoder("WINDOWS-1257", "UTF-8", "single_byte");
|
122
|
-
rb_declare_transcoder("UTF-8", "WINDOWS-1257", "single_byte");
|
123
|
-
rb_declare_transcoder("IBM437", "UTF-8", "single_byte");
|
124
|
-
rb_declare_transcoder("UTF-8", "IBM437", "single_byte");
|
125
|
-
rb_declare_transcoder("IBM775", "UTF-8", "single_byte");
|
126
|
-
rb_declare_transcoder("UTF-8", "IBM775", "single_byte");
|
127
|
-
rb_declare_transcoder("IBM737", "UTF-8", "single_byte");
|
128
|
-
rb_declare_transcoder("UTF-8", "IBM737", "single_byte");
|
129
|
-
rb_declare_transcoder("IBM852", "UTF-8", "single_byte");
|
130
|
-
rb_declare_transcoder("UTF-8", "IBM852", "single_byte");
|
131
|
-
rb_declare_transcoder("IBM855", "UTF-8", "single_byte");
|
132
|
-
rb_declare_transcoder("UTF-8", "IBM855", "single_byte");
|
133
|
-
rb_declare_transcoder("IBM857", "UTF-8", "single_byte");
|
134
|
-
rb_declare_transcoder("UTF-8", "IBM857", "single_byte");
|
135
|
-
rb_declare_transcoder("IBM860", "UTF-8", "single_byte");
|
136
|
-
rb_declare_transcoder("UTF-8", "IBM860", "single_byte");
|
137
|
-
rb_declare_transcoder("IBM861", "UTF-8", "single_byte");
|
138
|
-
rb_declare_transcoder("UTF-8", "IBM861", "single_byte");
|
139
|
-
rb_declare_transcoder("IBM862", "UTF-8", "single_byte");
|
140
|
-
rb_declare_transcoder("UTF-8", "IBM862", "single_byte");
|
141
|
-
rb_declare_transcoder("IBM863", "UTF-8", "single_byte");
|
142
|
-
rb_declare_transcoder("UTF-8", "IBM863", "single_byte");
|
143
|
-
rb_declare_transcoder("IBM865", "UTF-8", "single_byte");
|
144
|
-
rb_declare_transcoder("UTF-8", "IBM865", "single_byte");
|
145
|
-
rb_declare_transcoder("IBM866", "UTF-8", "single_byte");
|
146
|
-
rb_declare_transcoder("UTF-8", "IBM866", "single_byte");
|
147
|
-
rb_declare_transcoder("IBM869", "UTF-8", "single_byte");
|
148
|
-
rb_declare_transcoder("UTF-8", "IBM869", "single_byte");
|
149
|
-
rb_declare_transcoder("MACCROATIAN", "UTF-8", "single_byte");
|
150
|
-
rb_declare_transcoder("UTF-8", "MACCROATIAN", "single_byte");
|
151
|
-
rb_declare_transcoder("MACCYRILLIC", "UTF-8", "single_byte");
|
152
|
-
rb_declare_transcoder("UTF-8", "MACCYRILLIC", "single_byte");
|
153
|
-
rb_declare_transcoder("MACGREEK", "UTF-8", "single_byte");
|
154
|
-
rb_declare_transcoder("UTF-8", "MACGREEK", "single_byte");
|
155
|
-
rb_declare_transcoder("MACICELAND", "UTF-8", "single_byte");
|
156
|
-
rb_declare_transcoder("UTF-8", "MACICELAND", "single_byte");
|
157
|
-
rb_declare_transcoder("MACROMAN", "UTF-8", "single_byte");
|
158
|
-
rb_declare_transcoder("UTF-8", "MACROMAN", "single_byte");
|
159
|
-
rb_declare_transcoder("MACROMANIA", "UTF-8", "single_byte");
|
160
|
-
rb_declare_transcoder("UTF-8", "MACROMANIA", "single_byte");
|
161
|
-
rb_declare_transcoder("MACTURKISH", "UTF-8", "single_byte");
|
162
|
-
rb_declare_transcoder("UTF-8", "MACTURKISH", "single_byte");
|
163
|
-
rb_declare_transcoder("MACUKRAINE", "UTF-8", "single_byte");
|
164
|
-
rb_declare_transcoder("UTF-8", "MACUKRAINE", "single_byte");
|
165
|
-
rb_declare_transcoder("KOI8-U", "UTF-8", "single_byte");
|
166
|
-
rb_declare_transcoder("UTF-8", "KOI8-U", "single_byte");
|
167
|
-
rb_declare_transcoder("KOI8-R", "UTF-8", "single_byte");
|
168
|
-
rb_declare_transcoder("UTF-8", "KOI8-R", "single_byte");
|
169
|
-
rb_declare_transcoder("TIS-620", "UTF-8", "single_byte");
|
170
|
-
rb_declare_transcoder("UTF-8", "TIS-620", "single_byte");
|
171
|
-
rb_declare_transcoder("CP850", "UTF-8", "single_byte");
|
172
|
-
rb_declare_transcoder("UTF-8", "CP850", "single_byte");
|
173
|
-
rb_declare_transcoder("CP852", "UTF-8", "single_byte");
|
174
|
-
rb_declare_transcoder("UTF-8", "CP852", "single_byte");
|
175
|
-
rb_declare_transcoder("CP855", "UTF-8", "single_byte");
|
176
|
-
rb_declare_transcoder("UTF-8", "CP855", "single_byte");
|
177
|
-
rb_declare_transcoder("UTF-8", "UTF8-MAC", "utf8_mac");
|
178
|
-
rb_declare_transcoder("UTF8-MAC", "UTF-8", "utf8_mac");
|
179
|
-
rb_declare_transcoder("UTF-16BE", "UTF-8", "utf_16_32");
|
180
|
-
rb_declare_transcoder("UTF-8", "UTF-16BE", "utf_16_32");
|
181
|
-
rb_declare_transcoder("UTF-16LE", "UTF-8", "utf_16_32");
|
182
|
-
rb_declare_transcoder("UTF-8", "UTF-16LE", "utf_16_32");
|
183
|
-
rb_declare_transcoder("UTF-32BE", "UTF-8", "utf_16_32");
|
184
|
-
rb_declare_transcoder("UTF-8", "UTF-32BE", "utf_16_32");
|
185
|
-
rb_declare_transcoder("UTF-32LE", "UTF-8", "utf_16_32");
|
186
|
-
rb_declare_transcoder("UTF-8", "UTF-32LE", "utf_16_32");
|
187
|
-
rb_declare_transcoder("UTF-16", "UTF-8", "utf_16_32");
|
188
|
-
rb_declare_transcoder("UTF-32", "UTF-8", "utf_16_32");
|
189
|
-
rb_declare_transcoder("UTF-8", "UTF-16", "utf_16_32");
|
190
|
-
rb_declare_transcoder("UTF-8", "UTF-32", "utf_16_32");
|
@@ -1,13 +0,0 @@
|
|
1
|
-
#define RUBY_BASE_NAME "ruby"
|
2
|
-
#define RUBY_VERSION_NAME RUBY_BASE_NAME"-"RUBY_LIB_VERSION
|
3
|
-
#define RUBY_LIB_VERSION_STYLE 3 /* full */
|
4
|
-
#define RUBY_EXEC_PREFIX "/usr/local"
|
5
|
-
#define RUBY_LIB_PREFIX RUBY_EXEC_PREFIX"/lib/ruby"
|
6
|
-
#define RUBY_ARCH_PREFIX_FOR(arch) RUBY_LIB_PREFIX"/"arch
|
7
|
-
#define RUBY_SITEARCH_PREFIX_FOR(arch) RUBY_LIB_PREFIX"/"arch
|
8
|
-
#define RUBY_LIB RUBY_LIB_PREFIX"/"RUBY_LIB_VERSION
|
9
|
-
#define RUBY_ARCH_LIB_FOR(arch) RUBY_LIB"/"arch
|
10
|
-
#define RUBY_SITE_LIB RUBY_LIB_PREFIX"/site_ruby"
|
11
|
-
#define RUBY_SITE_ARCH_LIB_FOR(arch) RUBY_SITE_LIB2"/"arch
|
12
|
-
#define RUBY_VENDOR_LIB RUBY_LIB_PREFIX"/vendor_ruby"
|
13
|
-
#define RUBY_VENDOR_ARCH_LIB_FOR(arch) RUBY_VENDOR_LIB2"/"arch
|
@@ -1,52 +0,0 @@
|
|
1
|
-
#define RUBY_VERSION "2.1.1"
|
2
|
-
#define RUBY_RELEASE_DATE "2014-02-24"
|
3
|
-
#define RUBY_PATCHLEVEL 76
|
4
|
-
|
5
|
-
#define RUBY_RELEASE_YEAR 2014
|
6
|
-
#define RUBY_RELEASE_MONTH 2
|
7
|
-
#define RUBY_RELEASE_DAY 24
|
8
|
-
|
9
|
-
#include "ruby/version.h"
|
10
|
-
|
11
|
-
#if !defined RUBY_LIB_VERSION && defined RUBY_LIB_VERSION_STYLE
|
12
|
-
# if RUBY_LIB_VERSION_STYLE == 3
|
13
|
-
# define RUBY_LIB_VERSION STRINGIZE(RUBY_API_VERSION_MAJOR)"."STRINGIZE(RUBY_API_VERSION_MINOR)"."STRINGIZE(RUBY_API_VERSION_TEENY)
|
14
|
-
# elif RUBY_LIB_VERSION_STYLE == 2
|
15
|
-
# define RUBY_LIB_VERSION STRINGIZE(RUBY_API_VERSION_MAJOR)"."STRINGIZE(RUBY_API_VERSION_MINOR)
|
16
|
-
# endif
|
17
|
-
#endif
|
18
|
-
|
19
|
-
#if RUBY_PATCHLEVEL == -1
|
20
|
-
#define RUBY_PATCHLEVEL_STR "dev"
|
21
|
-
#else
|
22
|
-
#define RUBY_PATCHLEVEL_STR "p"STRINGIZE(RUBY_PATCHLEVEL)
|
23
|
-
#endif
|
24
|
-
|
25
|
-
#ifndef RUBY_REVISION
|
26
|
-
# include "revision.h"
|
27
|
-
#endif
|
28
|
-
#ifndef RUBY_REVISION
|
29
|
-
# define RUBY_REVISION 0
|
30
|
-
#endif
|
31
|
-
|
32
|
-
#if RUBY_REVISION
|
33
|
-
# ifdef RUBY_BRANCH_NAME
|
34
|
-
# define RUBY_REVISION_STR " "RUBY_BRANCH_NAME" "STRINGIZE(RUBY_REVISION)
|
35
|
-
# else
|
36
|
-
# define RUBY_REVISION_STR " revision "STRINGIZE(RUBY_REVISION)
|
37
|
-
# endif
|
38
|
-
#else
|
39
|
-
# define RUBY_REVISION_STR ""
|
40
|
-
#endif
|
41
|
-
|
42
|
-
# define RUBY_DESCRIPTION \
|
43
|
-
"ruby "RUBY_VERSION \
|
44
|
-
RUBY_PATCHLEVEL_STR \
|
45
|
-
" ("RUBY_RELEASE_DATE \
|
46
|
-
RUBY_REVISION_STR") " \
|
47
|
-
"["RUBY_PLATFORM"]"
|
48
|
-
# define RUBY_COPYRIGHT \
|
49
|
-
"ruby - Copyright (C) " \
|
50
|
-
STRINGIZE(RUBY_BIRTH_YEAR)"-" \
|
51
|
-
STRINGIZE(RUBY_RELEASE_YEAR)" " \
|
52
|
-
RUBY_AUTHOR
|
@@ -1,182 +0,0 @@
|
|
1
|
-
/**********************************************************************
|
2
|
-
|
3
|
-
vm.h -
|
4
|
-
|
5
|
-
$Author$
|
6
|
-
created at: 04/01/01 16:56:59 JST
|
7
|
-
|
8
|
-
Copyright (C) 2004-2007 Koichi Sasada
|
9
|
-
|
10
|
-
**********************************************************************/
|
11
|
-
|
12
|
-
#ifndef RUBY_VM_EXEC_H
|
13
|
-
#define RUBY_VM_EXEC_H
|
14
|
-
|
15
|
-
typedef long OFFSET;
|
16
|
-
typedef unsigned long lindex_t;
|
17
|
-
typedef VALUE GENTRY;
|
18
|
-
typedef rb_iseq_t *ISEQ;
|
19
|
-
|
20
|
-
#ifdef __GCC__
|
21
|
-
/* TODO: machine dependent prefetch instruction */
|
22
|
-
#define PREFETCH(pc)
|
23
|
-
#else
|
24
|
-
#define PREFETCH(pc)
|
25
|
-
#endif
|
26
|
-
|
27
|
-
#if VMDEBUG > 0
|
28
|
-
#define debugs printf
|
29
|
-
#define DEBUG_ENTER_INSN(insn) \
|
30
|
-
rb_vmdebug_debug_print_pre(th, GET_CFP(),GET_PC());
|
31
|
-
|
32
|
-
#if OPT_STACK_CACHING
|
33
|
-
#define SC_REGS() , reg_a, reg_b
|
34
|
-
#else
|
35
|
-
#define SC_REGS()
|
36
|
-
#endif
|
37
|
-
|
38
|
-
#define DEBUG_END_INSN() \
|
39
|
-
rb_vmdebug_debug_print_post(th, GET_CFP() SC_REGS());
|
40
|
-
|
41
|
-
#else
|
42
|
-
|
43
|
-
#define debugs
|
44
|
-
#define DEBUG_ENTER_INSN(insn)
|
45
|
-
#define DEBUG_END_INSN()
|
46
|
-
#endif
|
47
|
-
|
48
|
-
#define throwdebug if(0)printf
|
49
|
-
/* #define throwdebug printf */
|
50
|
-
|
51
|
-
/************************************************/
|
52
|
-
#if defined(DISPATCH_XXX)
|
53
|
-
error !
|
54
|
-
/************************************************/
|
55
|
-
#elif OPT_CALL_THREADED_CODE
|
56
|
-
|
57
|
-
#define LABEL(x) insn_func_##x
|
58
|
-
#define ELABEL(x)
|
59
|
-
#define LABEL_PTR(x) &LABEL(x)
|
60
|
-
|
61
|
-
#define INSN_ENTRY(insn) \
|
62
|
-
static rb_control_frame_t * \
|
63
|
-
FUNC_FASTCALL(LABEL(insn))(rb_thread_t *th, rb_control_frame_t *reg_cfp) {
|
64
|
-
|
65
|
-
#define END_INSN(insn) return reg_cfp;}
|
66
|
-
|
67
|
-
#define NEXT_INSN() return reg_cfp;
|
68
|
-
|
69
|
-
/************************************************/
|
70
|
-
#elif OPT_TOKEN_THREADED_CODE || OPT_DIRECT_THREADED_CODE
|
71
|
-
/* threaded code with gcc */
|
72
|
-
|
73
|
-
#define LABEL(x) INSN_LABEL_##x
|
74
|
-
#define ELABEL(x) INSN_ELABEL_##x
|
75
|
-
#define LABEL_PTR(x) &&LABEL(x)
|
76
|
-
|
77
|
-
#define INSN_ENTRY_SIG(insn)
|
78
|
-
|
79
|
-
|
80
|
-
#define INSN_DISPATCH_SIG(insn)
|
81
|
-
|
82
|
-
#define INSN_ENTRY(insn) \
|
83
|
-
LABEL(insn): \
|
84
|
-
INSN_ENTRY_SIG(insn); \
|
85
|
-
|
86
|
-
/* dispatcher */
|
87
|
-
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && __GNUC__ == 3
|
88
|
-
#define DISPATCH_ARCH_DEPEND_WAY(addr) \
|
89
|
-
__asm__ __volatile__("jmp *%0;\t# -- inserted by vm.h\t[length = 2]" : : "r" (addr))
|
90
|
-
|
91
|
-
#else
|
92
|
-
#define DISPATCH_ARCH_DEPEND_WAY(addr) \
|
93
|
-
/* do nothing */
|
94
|
-
|
95
|
-
#endif
|
96
|
-
|
97
|
-
|
98
|
-
/**********************************/
|
99
|
-
#if OPT_DIRECT_THREADED_CODE
|
100
|
-
|
101
|
-
/* for GCC 3.4.x */
|
102
|
-
#define TC_DISPATCH(insn) \
|
103
|
-
INSN_DISPATCH_SIG(insn); \
|
104
|
-
goto *(void const *)GET_CURRENT_INSN(); \
|
105
|
-
;
|
106
|
-
|
107
|
-
#else
|
108
|
-
/* token threaded code */
|
109
|
-
|
110
|
-
#define TC_DISPATCH(insn) \
|
111
|
-
DISPATCH_ARCH_DEPEND_WAY(insns_address_table[GET_CURRENT_INSN()]); \
|
112
|
-
INSN_DISPATCH_SIG(insn); \
|
113
|
-
goto *insns_address_table[GET_CURRENT_INSN()]; \
|
114
|
-
rb_bug("tc error");
|
115
|
-
|
116
|
-
|
117
|
-
#endif /* DISPATCH_DIRECT_THREADED_CODE */
|
118
|
-
|
119
|
-
#define END_INSN(insn) \
|
120
|
-
DEBUG_END_INSN(); \
|
121
|
-
TC_DISPATCH(insn);
|
122
|
-
|
123
|
-
#define INSN_DISPATCH() \
|
124
|
-
TC_DISPATCH(__START__) \
|
125
|
-
{
|
126
|
-
|
127
|
-
#define END_INSNS_DISPATCH() \
|
128
|
-
rb_bug("unknown insn: %"PRIdVALUE, GET_CURRENT_INSN()); \
|
129
|
-
} /* end of while loop */ \
|
130
|
-
|
131
|
-
#define NEXT_INSN() TC_DISPATCH(__NEXT_INSN__)
|
132
|
-
|
133
|
-
/************************************************/
|
134
|
-
#else /* no threaded code */
|
135
|
-
/* most common method */
|
136
|
-
|
137
|
-
#define INSN_ENTRY(insn) \
|
138
|
-
case BIN(insn):
|
139
|
-
|
140
|
-
#define END_INSN(insn) \
|
141
|
-
DEBUG_END_INSN(); \
|
142
|
-
break;
|
143
|
-
|
144
|
-
|
145
|
-
#define INSN_DISPATCH() \
|
146
|
-
while (1) { \
|
147
|
-
switch (GET_CURRENT_INSN()) {
|
148
|
-
|
149
|
-
#define END_INSNS_DISPATCH() \
|
150
|
-
default: \
|
151
|
-
SDR(); \
|
152
|
-
rb_bug("unknown insn: %ld", GET_CURRENT_INSN()); \
|
153
|
-
} /* end of switch */ \
|
154
|
-
} /* end of while loop */ \
|
155
|
-
|
156
|
-
#define NEXT_INSN() goto first
|
157
|
-
|
158
|
-
#endif
|
159
|
-
|
160
|
-
#define VM_SP_CNT(th, sp) ((sp) - (th)->stack)
|
161
|
-
|
162
|
-
#if OPT_CALL_THREADED_CODE
|
163
|
-
#define THROW_EXCEPTION(exc) do { \
|
164
|
-
th->errinfo = (VALUE)(exc); \
|
165
|
-
return 0; \
|
166
|
-
} while (0)
|
167
|
-
#else
|
168
|
-
#define THROW_EXCEPTION(exc) return (VALUE)(exc)
|
169
|
-
#endif
|
170
|
-
|
171
|
-
#define SCREG(r) (reg_##r)
|
172
|
-
|
173
|
-
#define VM_DEBUG_STACKOVERFLOW 0
|
174
|
-
|
175
|
-
#if VM_DEBUG_STACKOVERFLOW
|
176
|
-
#define CHECK_VM_STACK_OVERFLOW_FOR_INSN(cfp, margin) \
|
177
|
-
WHEN_VM_STACK_OVERFLOWED(cfp, (cfp)->sp, margin) vm_stack_overflow_for_insn()
|
178
|
-
#else
|
179
|
-
#define CHECK_VM_STACK_OVERFLOW_FOR_INSN(cfp, margin)
|
180
|
-
#endif
|
181
|
-
|
182
|
-
#endif /* RUBY_VM_EXEC_H */
|