debase-ruby_core_source 0.10.9 → 0.10.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/debase-ruby_core_source.gemspec +3 -2
- data/lib/debase/ruby_core_source.rb +0 -2
- data/lib/debase/ruby_core_source/version.rb +1 -1
- metadata +22 -113
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/addr2line.h +0 -21
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/ccan/build_assert/build_assert.h +0 -40
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/ccan/check_type/check_type.h +0 -63
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/ccan/container_of/container_of.h +0 -142
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/ccan/list/list.h +0 -788
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/ccan/str/str.h +0 -16
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/constant.h +0 -54
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/debug_counter.h +0 -378
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/dln.h +0 -51
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/encindex.h +0 -69
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/eval_intern.h +0 -314
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/gc.h +0 -129
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/hrtime.h +0 -168
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/id.h +0 -292
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/id_table.h +0 -34
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/insns.inc +0 -249
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/insns_info.inc +0 -9614
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/internal.h +0 -2682
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/iseq.h +0 -312
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/known_errors.inc +0 -791
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/method.h +0 -232
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/mjit.h +0 -179
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/mjit_compile.inc +0 -7883
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/node.h +0 -483
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/node_name.inc +0 -210
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/opt_sc.inc +0 -109
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/optinsn.inc +0 -128
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/optunifs.inc +0 -43
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/parse.h +0 -210
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/probes_helper.h +0 -42
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/regenc.h +0 -254
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/regint.h +0 -938
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/regparse.h +0 -370
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/revision.h +0 -2
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/ruby_assert.h +0 -15
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/ruby_atomic.h +0 -244
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/siphash.h +0 -48
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/symbol.h +0 -119
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/thread_pthread.h +0 -75
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/thread_win32.h +0 -36
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/timev.h +0 -56
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/transcode_data.h +0 -139
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/transient_heap.h +0 -62
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/version.h +0 -77
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/vm.inc +0 -5269
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/vm_call_iseq_optimized.inc +0 -237
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/vm_core.h +0 -1955
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/vm_debug.h +0 -34
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/vm_exec.h +0 -193
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/vm_insnhelper.h +0 -255
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/vm_opts.h +0 -70
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview2/vmtc.inc +0 -243
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/addr2line.h +0 -21
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/builtin.h +0 -68
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/ccan/build_assert/build_assert.h +0 -40
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/ccan/check_type/check_type.h +0 -63
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/ccan/container_of/container_of.h +0 -142
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/ccan/list/list.h +0 -788
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/ccan/str/str.h +0 -16
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/constant.h +0 -50
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/debug_counter.h +0 -378
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/dln.h +0 -51
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/encindex.h +0 -69
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/eval_intern.h +0 -311
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/gc.h +0 -129
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/hrtime.h +0 -168
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/id.h +0 -290
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/id_table.h +0 -34
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/insns.inc +0 -253
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/insns_info.inc +0 -9196
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/internal.h +0 -2657
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/iseq.h +0 -311
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/known_errors.inc +0 -791
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/method.h +0 -228
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/mjit.h +0 -175
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/mjit_compile.inc +0 -7782
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/node.h +0 -476
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/node_name.inc +0 -208
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/opt_sc.inc +0 -109
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/optinsn.inc +0 -128
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/optunifs.inc +0 -43
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/parse.h +0 -210
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/probes_helper.h +0 -42
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/regenc.h +0 -254
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/regint.h +0 -938
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/regparse.h +0 -370
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/revision.h +0 -2
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/ruby_assert.h +0 -15
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/ruby_atomic.h +0 -244
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/siphash.h +0 -48
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/symbol.h +0 -119
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/thread_pthread.h +0 -75
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/thread_win32.h +0 -36
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/timev.h +0 -56
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/transcode_data.h +0 -139
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/transient_heap.h +0 -62
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/version.h +0 -77
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/vm.inc +0 -5319
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/vm_call_iseq_optimized.inc +0 -237
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/vm_core.h +0 -1957
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/vm_debug.h +0 -34
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/vm_exec.h +0 -193
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/vm_insnhelper.h +0 -255
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/vm_opts.h +0 -72
- data/lib/debase/ruby_core_source/ruby-2.7.0-preview3/vmtc.inc +0 -247
@@ -1,48 +0,0 @@
|
|
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
|
-
NO_SANITIZE("unsigned-integer-overflow", uint64_t sip_hash13(const uint8_t key[16], const uint8_t *data, size_t len));
|
47
|
-
|
48
|
-
#endif
|
@@ -1,119 +0,0 @@
|
|
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 HAVE_BUILTIN___BUILTIN_CONSTANT_P
|
21
|
-
#define rb_id2sym(id) \
|
22
|
-
RB_GNUC_EXTENSION_BLOCK(__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
|
-
#define is_notop_id(id) ((id)>tLAST_OP_ID)
|
36
|
-
#define is_local_id(id) (id_type(id)==ID_LOCAL)
|
37
|
-
#define is_global_id(id) (id_type(id)==ID_GLOBAL)
|
38
|
-
#define is_instance_id(id) (id_type(id)==ID_INSTANCE)
|
39
|
-
#define is_attrset_id(id) ((id)==idASET||id_type(id)==ID_ATTRSET)
|
40
|
-
#define is_const_id(id) (id_type(id)==ID_CONST)
|
41
|
-
#define is_class_id(id) (id_type(id)==ID_CLASS)
|
42
|
-
#define is_junk_id(id) (id_type(id)==ID_JUNK)
|
43
|
-
|
44
|
-
static inline int
|
45
|
-
id_type(ID id)
|
46
|
-
{
|
47
|
-
if (is_notop_id(id)) {
|
48
|
-
return (int)(id&ID_SCOPE_MASK);
|
49
|
-
}
|
50
|
-
else {
|
51
|
-
return -1;
|
52
|
-
}
|
53
|
-
}
|
54
|
-
|
55
|
-
typedef uint32_t rb_id_serial_t;
|
56
|
-
static const uint32_t RB_ID_SERIAL_MAX = /* 256M on LP32 */
|
57
|
-
UINT32_MAX >>
|
58
|
-
((sizeof(ID)-sizeof(rb_id_serial_t))*CHAR_BIT < RUBY_ID_SCOPE_SHIFT ?
|
59
|
-
RUBY_ID_SCOPE_SHIFT : 0);
|
60
|
-
|
61
|
-
typedef struct {
|
62
|
-
rb_id_serial_t last_id;
|
63
|
-
st_table *str_sym;
|
64
|
-
VALUE ids;
|
65
|
-
VALUE dsymbol_fstr_hash;
|
66
|
-
} rb_symbols_t;
|
67
|
-
|
68
|
-
static inline rb_id_serial_t
|
69
|
-
rb_id_to_serial(ID id)
|
70
|
-
{
|
71
|
-
if (is_notop_id(id)) {
|
72
|
-
return (rb_id_serial_t)(id >> ID_SCOPE_SHIFT);
|
73
|
-
}
|
74
|
-
else {
|
75
|
-
return (rb_id_serial_t)id;
|
76
|
-
}
|
77
|
-
}
|
78
|
-
|
79
|
-
static inline int
|
80
|
-
sym_type(VALUE sym)
|
81
|
-
{
|
82
|
-
ID id;
|
83
|
-
if (STATIC_SYM_P(sym)) {
|
84
|
-
id = RSHIFT(sym, RUBY_SPECIAL_SHIFT);
|
85
|
-
if (id<=tLAST_OP_ID) {
|
86
|
-
return -1;
|
87
|
-
}
|
88
|
-
}
|
89
|
-
else {
|
90
|
-
id = RSYMBOL(sym)->id;
|
91
|
-
}
|
92
|
-
return (int)(id&ID_SCOPE_MASK);
|
93
|
-
}
|
94
|
-
|
95
|
-
#define is_local_sym(sym) (sym_type(sym)==ID_LOCAL)
|
96
|
-
#define is_global_sym(sym) (sym_type(sym)==ID_GLOBAL)
|
97
|
-
#define is_instance_sym(sym) (sym_type(sym)==ID_INSTANCE)
|
98
|
-
#define is_attrset_sym(sym) (sym_type(sym)==ID_ATTRSET)
|
99
|
-
#define is_const_sym(sym) (sym_type(sym)==ID_CONST)
|
100
|
-
#define is_class_sym(sym) (sym_type(sym)==ID_CLASS)
|
101
|
-
#define is_junk_sym(sym) (sym_type(sym)==ID_JUNK)
|
102
|
-
|
103
|
-
RUBY_FUNC_EXPORTED const unsigned int ruby_global_name_punct_bits[(0x7e - 0x20 + 31) / 32];
|
104
|
-
|
105
|
-
static inline int
|
106
|
-
is_global_name_punct(const int c)
|
107
|
-
{
|
108
|
-
if (c <= 0x20 || 0x7e < c) return 0;
|
109
|
-
return (ruby_global_name_punct_bits[(c - 0x20) / 32] >> (c % 32)) & 1;
|
110
|
-
}
|
111
|
-
|
112
|
-
int rb_enc_symname_type(const char *name, long len, rb_encoding *enc, unsigned int allowed_attrset);
|
113
|
-
|
114
|
-
RUBY_SYMBOL_EXPORT_BEGIN
|
115
|
-
|
116
|
-
size_t rb_sym_immortal_count(void);
|
117
|
-
|
118
|
-
RUBY_SYMBOL_EXPORT_END
|
119
|
-
#endif
|
@@ -1,75 +0,0 @@
|
|
1
|
-
/**********************************************************************
|
2
|
-
|
3
|
-
thread_pthread.h -
|
4
|
-
|
5
|
-
$Author$
|
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 pthread_cond_t rb_nativethread_cond_t;
|
22
|
-
|
23
|
-
typedef struct native_thread_data_struct {
|
24
|
-
union {
|
25
|
-
struct list_node ubf;
|
26
|
-
struct list_node gvl;
|
27
|
-
} node;
|
28
|
-
#if defined(__GLIBC__) || defined(__FreeBSD__)
|
29
|
-
union
|
30
|
-
#else
|
31
|
-
/*
|
32
|
-
* assume the platform condvars are badly implemented and have a
|
33
|
-
* "memory" of which mutex they're associated with
|
34
|
-
*/
|
35
|
-
struct
|
36
|
-
#endif
|
37
|
-
{
|
38
|
-
rb_nativethread_cond_t intr; /* th->interrupt_lock */
|
39
|
-
rb_nativethread_cond_t gvlq; /* vm->gvl.lock */
|
40
|
-
} cond;
|
41
|
-
} native_thread_data_t;
|
42
|
-
|
43
|
-
#undef except
|
44
|
-
#undef try
|
45
|
-
#undef leave
|
46
|
-
#undef finally
|
47
|
-
|
48
|
-
typedef struct rb_global_vm_lock_struct {
|
49
|
-
/* fast path */
|
50
|
-
const struct rb_thread_struct *owner;
|
51
|
-
rb_nativethread_lock_t lock; /* AKA vm->gvl.lock */
|
52
|
-
|
53
|
-
/*
|
54
|
-
* slow path, protected by vm->gvl.lock
|
55
|
-
* - @waitq - FIFO queue of threads waiting for GVL
|
56
|
-
* - @timer - it handles timeslices for @owner. It is any one thread
|
57
|
-
* in @waitq, there is no @timer if @waitq is empty, but always
|
58
|
-
* a @timer if @waitq has entries
|
59
|
-
* - @timer_err tracks timeslice limit, the timeslice only resets
|
60
|
-
* when pthread_cond_timedwait returns ETIMEDOUT, so frequent
|
61
|
-
* switching between contended/uncontended GVL won't reset the
|
62
|
-
* timer.
|
63
|
-
*/
|
64
|
-
struct list_head waitq; /* <=> native_thread_data_t.node.ubf */
|
65
|
-
const struct rb_thread_struct *timer;
|
66
|
-
int timer_err;
|
67
|
-
|
68
|
-
/* yield */
|
69
|
-
rb_nativethread_cond_t switch_cond;
|
70
|
-
rb_nativethread_cond_t switch_wait_cond;
|
71
|
-
int need_yield;
|
72
|
-
int wait_yield;
|
73
|
-
} rb_global_vm_lock_t;
|
74
|
-
|
75
|
-
#endif /* RUBY_THREAD_PTHREAD_H */
|
@@ -1,36 +0,0 @@
|
|
1
|
-
/**********************************************************************
|
2
|
-
|
3
|
-
thread_win32.h -
|
4
|
-
|
5
|
-
$Author$
|
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
|
-
|
@@ -1,56 +0,0 @@
|
|
1
|
-
#ifndef RUBY_TIMEV_H
|
2
|
-
#define RUBY_TIMEV_H
|
3
|
-
|
4
|
-
#if 0
|
5
|
-
struct vtm {/* dummy for TAGS */};
|
6
|
-
#endif
|
7
|
-
PACKED_STRUCT_UNALIGNED(struct vtm {
|
8
|
-
VALUE year; /* 2000 for example. Integer. */
|
9
|
-
VALUE subsecx; /* 0 <= subsecx < TIME_SCALE. possibly Rational. */
|
10
|
-
VALUE utc_offset; /* -3600 as -01:00 for example. possibly Rational. */
|
11
|
-
VALUE zone; /* "JST", "EST", "EDT", etc. as String */
|
12
|
-
unsigned int yday:9; /* 1..366 */
|
13
|
-
unsigned int mon:4; /* 1..12 */
|
14
|
-
unsigned int mday:5; /* 1..31 */
|
15
|
-
unsigned int hour:5; /* 0..23 */
|
16
|
-
unsigned int min:6; /* 0..59 */
|
17
|
-
unsigned int sec:6; /* 0..60 */
|
18
|
-
unsigned int wday:3; /* 0:Sunday, 1:Monday, ..., 6:Saturday 7:init */
|
19
|
-
unsigned int isdst:2; /* 0:StandardTime 1:DayLightSavingTime 3:init */
|
20
|
-
});
|
21
|
-
|
22
|
-
#define TIME_SCALE 1000000000
|
23
|
-
|
24
|
-
#ifndef TYPEOF_TIMEVAL_TV_SEC
|
25
|
-
# define TYPEOF_TIMEVAL_TV_SEC time_t
|
26
|
-
#endif
|
27
|
-
#ifndef TYPEOF_TIMEVAL_TV_USEC
|
28
|
-
# if INT_MAX >= 1000000
|
29
|
-
# define TYPEOF_TIMEVAL_TV_USEC int
|
30
|
-
# else
|
31
|
-
# define TYPEOF_TIMEVAL_TV_USEC long
|
32
|
-
# endif
|
33
|
-
#endif
|
34
|
-
|
35
|
-
#if SIZEOF_TIME_T == SIZEOF_LONG
|
36
|
-
typedef unsigned long unsigned_time_t;
|
37
|
-
#elif SIZEOF_TIME_T == SIZEOF_INT
|
38
|
-
typedef unsigned int unsigned_time_t;
|
39
|
-
#elif SIZEOF_TIME_T == SIZEOF_LONG_LONG
|
40
|
-
typedef unsigned LONG_LONG unsigned_time_t;
|
41
|
-
#else
|
42
|
-
# error cannot find integer type which size is same as time_t.
|
43
|
-
#endif
|
44
|
-
|
45
|
-
/* strftime.c */
|
46
|
-
#ifdef RUBY_ENCODING_H
|
47
|
-
VALUE rb_strftime_timespec(const char *format, size_t format_len, rb_encoding *enc,
|
48
|
-
VALUE time, const struct vtm *vtm, struct timespec *ts, int gmt);
|
49
|
-
VALUE rb_strftime(const char *format, size_t format_len, rb_encoding *enc,
|
50
|
-
VALUE time, const struct vtm *vtm, VALUE timev, int gmt);
|
51
|
-
#endif
|
52
|
-
|
53
|
-
/* time.c */
|
54
|
-
VALUE rb_time_zone_abbreviation(VALUE zone, VALUE time);
|
55
|
-
|
56
|
-
#endif
|
@@ -1,139 +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)|\
|
50
|
-
(((unsigned char)(b2))<<16)|\
|
51
|
-
TWObt))
|
52
|
-
#define o3(b1,b2,b3) (PType(((((unsigned char)(b1))<<8)|\
|
53
|
-
(((unsigned char)(b2))<<16)|\
|
54
|
-
(((unsigned int)(unsigned char)(b3))<<24)|\
|
55
|
-
THREEbt)&\
|
56
|
-
0xffffffffU))
|
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)|\
|
61
|
-
FOURbt)&\
|
62
|
-
0xffffffffU))
|
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)|\
|
67
|
-
GB4bt)&\
|
68
|
-
0xffffffffU))
|
69
|
-
#define funsio(diff) (PType((((unsigned int)(diff))<<8)|FUNsio))
|
70
|
-
|
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) /* for UTF-8 only!!! */
|
75
|
-
|
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)
|
80
|
-
|
81
|
-
#define o2FUNii(b1,b2) (PType((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|FUNii))
|
82
|
-
|
83
|
-
/* do we need these??? maybe not, can be done with simple tables */
|
84
|
-
#define ONETRAIL /* legal but undefined if one more trailing UTF-8 */
|
85
|
-
#define TWOTRAIL /* legal but undefined if two more trailing UTF-8 */
|
86
|
-
#define THREETRAIL /* legal but undefined if three more trailing UTF-8 */
|
87
|
-
|
88
|
-
typedef enum {
|
89
|
-
asciicompat_converter, /* ASCII-compatible -> ASCII-compatible */
|
90
|
-
asciicompat_decoder, /* ASCII-incompatible -> ASCII-compatible */
|
91
|
-
asciicompat_encoder /* ASCII-compatible -> ASCII-incompatible */
|
92
|
-
/* ASCII-incompatible -> ASCII-incompatible is intentionally omitted. */
|
93
|
-
} rb_transcoder_asciicompat_type_t;
|
94
|
-
|
95
|
-
typedef struct rb_transcoder rb_transcoder;
|
96
|
-
|
97
|
-
/* static structure, one per supported encoding pair */
|
98
|
-
struct rb_transcoder {
|
99
|
-
const char *src_encoding;
|
100
|
-
const char *dst_encoding;
|
101
|
-
unsigned int conv_tree_start;
|
102
|
-
const unsigned char *byte_array;
|
103
|
-
unsigned int byte_array_length;
|
104
|
-
const unsigned int *word_array;
|
105
|
-
unsigned int word_array_length;
|
106
|
-
int word_size;
|
107
|
-
int input_unit_length;
|
108
|
-
int max_input;
|
109
|
-
int max_output;
|
110
|
-
rb_transcoder_asciicompat_type_t asciicompat_type;
|
111
|
-
size_t state_size;
|
112
|
-
int (*state_init_func)(void*); /* ret==0:success ret!=0:failure(errno) */
|
113
|
-
int (*state_fini_func)(void*); /* ret==0:success ret!=0:failure(errno) */
|
114
|
-
VALUE (*func_ii)(void*, VALUE); /* info -> info */
|
115
|
-
VALUE (*func_si)(void*, const unsigned char*, size_t); /* start -> info */
|
116
|
-
ssize_t (*func_io)(void*, VALUE, const unsigned char*, size_t); /* info -> output */
|
117
|
-
ssize_t (*func_so)(void*, const unsigned char*, size_t, unsigned char*, size_t); /* start -> output */
|
118
|
-
ssize_t (*finish_func)(void*, unsigned char*, size_t); /* -> output */
|
119
|
-
ssize_t (*resetsize_func)(void*); /* -> len */
|
120
|
-
ssize_t (*resetstate_func)(void*, unsigned char*, size_t); /* -> output */
|
121
|
-
ssize_t (*func_sio)(void*, const unsigned char*, size_t, VALUE, unsigned char*, size_t); /* start -> output */
|
122
|
-
};
|
123
|
-
|
124
|
-
void rb_declare_transcoder(const char *enc1, const char *enc2, const char *lib);
|
125
|
-
void rb_register_transcoder(const rb_transcoder *);
|
126
|
-
|
127
|
-
/*
|
128
|
-
* To get rid of collision of initializer symbols in statically-linked encodings
|
129
|
-
* and transcoders
|
130
|
-
*/
|
131
|
-
#if defined(EXTSTATIC) && EXTSTATIC
|
132
|
-
# define TRANS_INIT(name) void Init_trans_ ## name(void)
|
133
|
-
#else
|
134
|
-
# define TRANS_INIT(name) void Init_ ## name(void)
|
135
|
-
#endif
|
136
|
-
|
137
|
-
RUBY_SYMBOL_EXPORT_END
|
138
|
-
|
139
|
-
#endif /* RUBY_TRANSCODE_DATA_H */
|