debase-ruby_core_source 0.8.2 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/addr2line.h +21 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/constant.h +36 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/dln.h +50 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/encdb.h +169 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/eval_intern.h +241 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/gc.h +104 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/id.h +135 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/insns.inc +187 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/insns_info.inc +724 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/internal.h +395 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/iseq.h +140 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/known_errors.inc +731 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/method.h +141 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/node.h +541 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/node_name.inc +212 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/opt_sc.inc +702 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/optinsn.inc +83 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/optunifs.inc +120 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/parse.h +181 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/probes_helper.h +67 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/regenc.h +227 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/regint.h +915 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/regparse.h +367 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/revision.h +1 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/ruby_atomic.h +170 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/siphash.h +48 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/thread_pthread.h +56 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/thread_win32.h +45 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/timev.h +21 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/transcode_data.h +127 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/transdb.h +193 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/version.h +52 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/vm.inc +3196 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/vm_core.h +1020 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/vm_debug.h +41 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/vm_exec.h +173 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/vm_insnhelper.h +274 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/vm_opts.h +56 -0
- data/lib/debase/ruby_core_source/ruby-2.0.0-p648/vmtc.inc +101 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/addr2line.h +21 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/constant.h +36 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/dln.h +51 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/encdb.h +170 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/eval_intern.h +270 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/gc.h +101 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/id.h +171 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/insns.inc +189 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/insns_info.inc +731 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/internal.h +896 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/iseq.h +136 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/known_errors.inc +731 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/method.h +145 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/node.h +543 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/node_name.inc +212 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/opt_sc.inc +710 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/optinsn.inc +83 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/optunifs.inc +121 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/parse.h +183 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/probes_helper.h +67 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/regenc.h +223 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/regint.h +911 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/regparse.h +363 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/revision.h +1 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/ruby_atomic.h +170 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/siphash.h +48 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/thread_native.h +23 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/thread_pthread.h +56 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/thread_win32.h +45 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/timev.h +42 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/transcode_data.h +123 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/transdb.h +190 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/version.h +52 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/vm.inc +3241 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/vm_core.h +1057 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/vm_debug.h +37 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/vm_exec.h +182 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/vm_insnhelper.h +273 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/vm_opts.h +56 -0
- data/lib/debase/ruby_core_source/ruby-2.1.8-p440/vmtc.inc +102 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/addr2line.h +21 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/ccan/build_assert/build_assert.h +40 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/ccan/check_type/check_type.h +63 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/ccan/container_of/container_of.h +142 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/ccan/list/list.h +635 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/ccan/str/str.h +16 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/constant.h +43 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/dln.h +51 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/eval_intern.h +275 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/gc.h +107 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/id.h +210 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/insns.inc +107 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/insns_info.inc +752 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/internal.h +1196 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/iseq.h +158 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/known_errors.inc +746 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/method.h +144 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/node.h +544 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/node_name.inc +212 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/opt_sc.inc +734 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/optinsn.inc +83 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/optunifs.inc +124 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/parse.h +184 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/probes_helper.h +67 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/regenc.h +234 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/regint.h +972 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/regparse.h +363 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/revision.h +1 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/ruby_atomic.h +170 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/siphash.h +48 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/symbol.h +88 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/thread_pthread.h +54 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/thread_win32.h +36 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/timev.h +42 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/transcode_data.h +123 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/version.h +52 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/vm.inc +3370 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/vm_core.h +1160 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/vm_debug.h +37 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/vm_exec.h +182 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/vm_insnhelper.h +233 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/vm_opts.h +56 -0
- data/lib/debase/ruby_core_source/ruby-2.2.4-p230/vmtc.inc +105 -0
- data/lib/debase/ruby_core_source/version.rb +1 -1
- metadata +124 -2
@@ -0,0 +1,48 @@
|
|
1
|
+
#ifndef SIPHASH_H
|
2
|
+
#define SIPHASH_H 1
|
3
|
+
#include <stdlib.h>
|
4
|
+
#ifdef HAVE_STDINT_H
|
5
|
+
#include <stdint.h>
|
6
|
+
#endif
|
7
|
+
#ifdef HAVE_INTTYPES_H
|
8
|
+
#include <inttypes.h>
|
9
|
+
#endif
|
10
|
+
|
11
|
+
#ifndef HAVE_UINT64_T
|
12
|
+
typedef struct {
|
13
|
+
uint32_t u32[2];
|
14
|
+
} sip_uint64_t;
|
15
|
+
#define uint64_t sip_uint64_t
|
16
|
+
#else
|
17
|
+
typedef uint64_t sip_uint64_t;
|
18
|
+
#endif
|
19
|
+
|
20
|
+
typedef struct {
|
21
|
+
int c;
|
22
|
+
int d;
|
23
|
+
uint64_t v[4];
|
24
|
+
uint8_t buf[sizeof(uint64_t)];
|
25
|
+
uint8_t buflen;
|
26
|
+
uint8_t msglen_byte;
|
27
|
+
} sip_state;
|
28
|
+
|
29
|
+
typedef struct sip_interface_st sip_interface;
|
30
|
+
|
31
|
+
typedef struct {
|
32
|
+
sip_state state[1];
|
33
|
+
const sip_interface *methods;
|
34
|
+
} sip_hash;
|
35
|
+
|
36
|
+
sip_hash *sip_hash_new(const uint8_t key[16], int c, int d);
|
37
|
+
sip_hash *sip_hash_init(sip_hash *h, const uint8_t key[16], int c, int d);
|
38
|
+
int sip_hash_update(sip_hash *h, const uint8_t *data, size_t len);
|
39
|
+
int sip_hash_final(sip_hash *h, uint8_t **digest, size_t *len);
|
40
|
+
int sip_hash_final_integer(sip_hash *h, uint64_t *digest);
|
41
|
+
int sip_hash_digest(sip_hash *h, const uint8_t *data, size_t data_len, uint8_t **digest, size_t *digest_len);
|
42
|
+
int sip_hash_digest_integer(sip_hash *h, const uint8_t *data, size_t data_len, uint64_t *digest);
|
43
|
+
void sip_hash_free(sip_hash *h);
|
44
|
+
void sip_hash_dump(sip_hash *h);
|
45
|
+
|
46
|
+
uint64_t sip_hash24(const uint8_t key[16], const uint8_t *data, size_t len);
|
47
|
+
|
48
|
+
#endif
|
@@ -0,0 +1,88 @@
|
|
1
|
+
/**********************************************************************
|
2
|
+
|
3
|
+
symbol.h -
|
4
|
+
|
5
|
+
$Author$
|
6
|
+
created at: Tue Jul 8 15:49:54 JST 2014
|
7
|
+
|
8
|
+
Copyright (C) 2014 Yukihiro Matsumoto
|
9
|
+
|
10
|
+
**********************************************************************/
|
11
|
+
|
12
|
+
#ifndef RUBY_SYMBOL_H
|
13
|
+
#define RUBY_SYMBOL_H 1
|
14
|
+
|
15
|
+
#include "id.h"
|
16
|
+
|
17
|
+
#define DYNAMIC_ID_P(id) (!(id&ID_STATIC_SYM)&&id>tLAST_OP_ID)
|
18
|
+
#define STATIC_ID2SYM(id) (((VALUE)(id)<<RUBY_SPECIAL_SHIFT)|SYMBOL_FLAG)
|
19
|
+
|
20
|
+
#ifdef __GNUC__
|
21
|
+
#define rb_id2sym(id) \
|
22
|
+
__extension__(__builtin_constant_p(id) && !DYNAMIC_ID_P(id) ? \
|
23
|
+
STATIC_ID2SYM(id) : rb_id2sym(id))
|
24
|
+
#endif
|
25
|
+
|
26
|
+
struct RSymbol {
|
27
|
+
struct RBasic basic;
|
28
|
+
st_index_t hashval;
|
29
|
+
VALUE fstr;
|
30
|
+
ID id;
|
31
|
+
};
|
32
|
+
|
33
|
+
#define RSYMBOL(obj) (R_CAST(RSymbol)(obj))
|
34
|
+
|
35
|
+
static inline int
|
36
|
+
id_type(ID id)
|
37
|
+
{
|
38
|
+
if (id<=tLAST_OP_ID) {
|
39
|
+
return -1;
|
40
|
+
}
|
41
|
+
return (int)(id&ID_SCOPE_MASK);
|
42
|
+
}
|
43
|
+
|
44
|
+
#define is_notop_id(id) ((id)>tLAST_OP_ID)
|
45
|
+
#define is_local_id(id) (id_type(id)==ID_LOCAL)
|
46
|
+
#define is_global_id(id) (id_type(id)==ID_GLOBAL)
|
47
|
+
#define is_instance_id(id) (id_type(id)==ID_INSTANCE)
|
48
|
+
#define is_attrset_id(id) (id_type(id)==ID_ATTRSET)
|
49
|
+
#define is_const_id(id) (id_type(id)==ID_CONST)
|
50
|
+
#define is_class_id(id) (id_type(id)==ID_CLASS)
|
51
|
+
#define is_junk_id(id) (id_type(id)==ID_JUNK)
|
52
|
+
|
53
|
+
static inline int
|
54
|
+
sym_type(VALUE sym)
|
55
|
+
{
|
56
|
+
ID id;
|
57
|
+
if (STATIC_SYM_P(sym)) {
|
58
|
+
id = RSHIFT(sym, RUBY_SPECIAL_SHIFT);
|
59
|
+
if (id<=tLAST_OP_ID) {
|
60
|
+
return -1;
|
61
|
+
}
|
62
|
+
}
|
63
|
+
else {
|
64
|
+
id = RSYMBOL(sym)->id;
|
65
|
+
}
|
66
|
+
return (int)(id&ID_SCOPE_MASK);
|
67
|
+
}
|
68
|
+
|
69
|
+
#define is_local_sym(sym) (sym_type(sym)==ID_LOCAL)
|
70
|
+
#define is_global_sym(sym) (sym_type(sym)==ID_GLOBAL)
|
71
|
+
#define is_instance_sym(sym) (sym_type(sym)==ID_INSTANCE)
|
72
|
+
#define is_attrset_sym(sym) (sym_type(sym)==ID_ATTRSET)
|
73
|
+
#define is_const_sym(sym) (sym_type(sym)==ID_CONST)
|
74
|
+
#define is_class_sym(sym) (sym_type(sym)==ID_CLASS)
|
75
|
+
#define is_junk_sym(sym) (sym_type(sym)==ID_JUNK)
|
76
|
+
|
77
|
+
RUBY_FUNC_EXPORTED const unsigned int ruby_global_name_punct_bits[(0x7e - 0x20 + 31) / 32];
|
78
|
+
|
79
|
+
static inline int
|
80
|
+
is_global_name_punct(const int c)
|
81
|
+
{
|
82
|
+
if (c <= 0x20 || 0x7e < c) return 0;
|
83
|
+
return (ruby_global_name_punct_bits[(c - 0x20) / 32] >> (c % 32)) & 1;
|
84
|
+
}
|
85
|
+
|
86
|
+
ID rb_intern_cstr_without_pindown(const char *, long, rb_encoding *);
|
87
|
+
|
88
|
+
#endif
|
@@ -0,0 +1,54 @@
|
|
1
|
+
/**********************************************************************
|
2
|
+
|
3
|
+
thread_pthread.h -
|
4
|
+
|
5
|
+
$Author: normal $
|
6
|
+
|
7
|
+
Copyright (C) 2004-2007 Koichi Sasada
|
8
|
+
|
9
|
+
**********************************************************************/
|
10
|
+
|
11
|
+
#ifndef RUBY_THREAD_PTHREAD_H
|
12
|
+
#define RUBY_THREAD_PTHREAD_H
|
13
|
+
|
14
|
+
#ifdef HAVE_PTHREAD_NP_H
|
15
|
+
#include <pthread_np.h>
|
16
|
+
#endif
|
17
|
+
|
18
|
+
#define RB_NATIVETHREAD_LOCK_INIT PTHREAD_MUTEX_INITIALIZER
|
19
|
+
#define RB_NATIVETHREAD_COND_INIT { PTHREAD_COND_INITIALIZER, }
|
20
|
+
|
21
|
+
typedef struct rb_thread_cond_struct {
|
22
|
+
pthread_cond_t cond;
|
23
|
+
#ifdef HAVE_CLOCKID_T
|
24
|
+
clockid_t clockid;
|
25
|
+
#endif
|
26
|
+
} rb_nativethread_cond_t;
|
27
|
+
|
28
|
+
typedef struct native_thread_data_struct {
|
29
|
+
void *signal_thread_list;
|
30
|
+
rb_nativethread_cond_t sleep_cond;
|
31
|
+
} native_thread_data_t;
|
32
|
+
|
33
|
+
#undef except
|
34
|
+
#undef try
|
35
|
+
#undef leave
|
36
|
+
#undef finally
|
37
|
+
|
38
|
+
typedef struct rb_global_vm_lock_struct {
|
39
|
+
/* fast path */
|
40
|
+
unsigned long acquired;
|
41
|
+
rb_nativethread_lock_t lock;
|
42
|
+
|
43
|
+
/* slow path */
|
44
|
+
volatile unsigned long waiting;
|
45
|
+
rb_nativethread_cond_t cond;
|
46
|
+
|
47
|
+
/* yield */
|
48
|
+
rb_nativethread_cond_t switch_cond;
|
49
|
+
rb_nativethread_cond_t switch_wait_cond;
|
50
|
+
int need_yield;
|
51
|
+
int wait_yield;
|
52
|
+
} rb_global_vm_lock_t;
|
53
|
+
|
54
|
+
#endif /* RUBY_THREAD_PTHREAD_H */
|
@@ -0,0 +1,36 @@
|
|
1
|
+
/**********************************************************************
|
2
|
+
|
3
|
+
thread_win32.h -
|
4
|
+
|
5
|
+
$Author: ko1 $
|
6
|
+
|
7
|
+
Copyright (C) 2004-2007 Koichi Sasada
|
8
|
+
|
9
|
+
**********************************************************************/
|
10
|
+
|
11
|
+
/* interface */
|
12
|
+
#ifndef RUBY_THREAD_WIN32_H
|
13
|
+
#define RUBY_THREAD_WIN32_H
|
14
|
+
|
15
|
+
# ifdef __CYGWIN__
|
16
|
+
# undef _WIN32
|
17
|
+
# endif
|
18
|
+
|
19
|
+
WINBASEAPI BOOL WINAPI
|
20
|
+
TryEnterCriticalSection(IN OUT LPCRITICAL_SECTION lpCriticalSection);
|
21
|
+
|
22
|
+
typedef struct rb_thread_cond_struct {
|
23
|
+
struct cond_event_entry *next;
|
24
|
+
struct cond_event_entry *prev;
|
25
|
+
} rb_nativethread_cond_t;
|
26
|
+
|
27
|
+
typedef struct native_thread_data_struct {
|
28
|
+
HANDLE interrupt_event;
|
29
|
+
} native_thread_data_t;
|
30
|
+
|
31
|
+
typedef struct rb_global_vm_lock_struct {
|
32
|
+
HANDLE lock;
|
33
|
+
} rb_global_vm_lock_t;
|
34
|
+
|
35
|
+
#endif /* RUBY_THREAD_WIN32_H */
|
36
|
+
|
@@ -0,0 +1,42 @@
|
|
1
|
+
#ifndef RUBY_TIMEV_H
|
2
|
+
#define RUBY_TIMEV_H
|
3
|
+
|
4
|
+
PACKED_STRUCT_UNALIGNED(struct vtm {
|
5
|
+
VALUE year; /* 2000 for example. Integer. */
|
6
|
+
VALUE subsecx; /* 0 <= subsecx < TIME_SCALE. possibly Rational. */
|
7
|
+
VALUE utc_offset; /* -3600 as -01:00 for example. possibly Rational. */
|
8
|
+
const char *zone; /* "JST", "EST", "EDT", etc. */
|
9
|
+
uint16_t yday:9; /* 1..366 */
|
10
|
+
uint8_t mon:4; /* 1..12 */
|
11
|
+
uint8_t mday:5; /* 1..31 */
|
12
|
+
uint8_t hour:5; /* 0..23 */
|
13
|
+
uint8_t min:6; /* 0..59 */
|
14
|
+
uint8_t sec:6; /* 0..60 */
|
15
|
+
uint8_t wday:3; /* 0:Sunday, 1:Monday, ..., 6:Saturday 7:init */
|
16
|
+
uint8_t isdst:2; /* 0:StandardTime 1:DayLightSavingTime 3:init */
|
17
|
+
});
|
18
|
+
|
19
|
+
#define TIME_SCALE 1000000000
|
20
|
+
|
21
|
+
#ifndef TYPEOF_TIMEVAL_TV_SEC
|
22
|
+
# define TYPEOF_TIMEVAL_TV_SEC time_t
|
23
|
+
#endif
|
24
|
+
#ifndef TYPEOF_TIMEVAL_TV_USEC
|
25
|
+
# if INT_MAX >= 1000000
|
26
|
+
# define TYPEOF_TIMEVAL_TV_USEC int
|
27
|
+
# else
|
28
|
+
# define TYPEOF_TIMEVAL_TV_USEC long
|
29
|
+
# endif
|
30
|
+
#endif
|
31
|
+
|
32
|
+
#if SIZEOF_TIME_T == SIZEOF_LONG
|
33
|
+
typedef unsigned long unsigned_time_t;
|
34
|
+
#elif SIZEOF_TIME_T == SIZEOF_INT
|
35
|
+
typedef unsigned int unsigned_time_t;
|
36
|
+
#elif SIZEOF_TIME_T == SIZEOF_LONG_LONG
|
37
|
+
typedef unsigned LONG_LONG unsigned_time_t;
|
38
|
+
#else
|
39
|
+
# error cannot find integer type which size is same as time_t.
|
40
|
+
#endif
|
41
|
+
|
42
|
+
#endif
|
@@ -0,0 +1,123 @@
|
|
1
|
+
/**********************************************************************
|
2
|
+
|
3
|
+
transcode_data.h -
|
4
|
+
|
5
|
+
$Author: nobu $
|
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 */
|
@@ -0,0 +1,52 @@
|
|
1
|
+
#define RUBY_VERSION "2.2.4"
|
2
|
+
#define RUBY_RELEASE_DATE "2015-12-16"
|
3
|
+
#define RUBY_PATCHLEVEL 230
|
4
|
+
|
5
|
+
#define RUBY_RELEASE_YEAR 2015
|
6
|
+
#define RUBY_RELEASE_MONTH 12
|
7
|
+
#define RUBY_RELEASE_DAY 16
|
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
|