Ruby
1.9.3p484(2013-11-22revision43786)
Main Page
Modules
Data Structures
Files
File List
Globals
include
ruby
intern.h
Go to the documentation of this file.
1
/**********************************************************************
2
3
intern.h -
4
5
$Author: usa $
6
created at: Thu Jun 10 14:22:17 JST 1993
7
8
Copyright (C) 1993-2007 Yukihiro Matsumoto
9
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
10
Copyright (C) 2000 Information-technology Promotion Agency, Japan
11
12
**********************************************************************/
13
14
#ifndef RUBY_INTERN_H
15
#define RUBY_INTERN_H 1
16
17
#if defined(__cplusplus)
18
extern
"C"
{
19
#if 0
20
}
/* satisfy cc-mode */
21
#endif
22
#endif
23
24
#include "
ruby/defines.h
"
25
#ifdef RUBY_EXTCONF_H
26
#include RUBY_EXTCONF_H
27
#endif
28
29
#ifdef HAVE_STDARG_PROTOTYPES
30
# include <stdarg.h>
31
#else
32
# include <varargs.h>
33
#endif
34
35
#if defined(HAVE_SYS_TYPES_H)
36
#include <sys/types.h>
37
#endif
38
39
#if defined(HAVE_SYS_TIME_H)
40
#include <sys/time.h>
41
#endif
42
43
#include "
ruby/st.h
"
44
45
#if defined __GNUC__ && __GNUC__ >= 4
46
#pragma GCC visibility push(default)
47
#endif
48
49
/*
50
* Functions and variables that are used by more than one source file of
51
* the kernel.
52
*/
53
54
#define ID_ALLOCATOR 1
55
56
/* array.c */
57
void
rb_mem_clear
(
register
VALUE
*,
register
long
);
58
VALUE
rb_assoc_new
(
VALUE
,
VALUE
);
59
VALUE
rb_check_array_type
(
VALUE
);
60
VALUE
rb_ary_new
(
void
);
61
VALUE
rb_ary_new2
(
long
);
62
VALUE
rb_ary_new3
(
long
,...);
63
VALUE
rb_ary_new4
(
long
,
const
VALUE
*);
64
VALUE
rb_ary_tmp_new
(
long
);
65
void
rb_ary_free
(
VALUE
);
66
void
rb_ary_modify
(
VALUE
);
67
VALUE
rb_ary_freeze
(
VALUE
);
68
VALUE
rb_ary_aref
(
int
,
VALUE
*,
VALUE
);
69
VALUE
rb_ary_subseq
(
VALUE
,
long
,
long
);
70
void
rb_ary_store
(
VALUE
,
long
,
VALUE
);
71
VALUE
rb_ary_dup
(
VALUE
);
72
VALUE
rb_ary_resurrect
(
VALUE
ary);
73
VALUE
rb_ary_to_ary
(
VALUE
);
74
VALUE
rb_ary_to_s
(
VALUE
);
75
VALUE
rb_ary_push
(
VALUE
,
VALUE
);
76
VALUE
rb_ary_pop
(
VALUE
);
77
VALUE
rb_ary_shift
(
VALUE
);
78
VALUE
rb_ary_unshift
(
VALUE
,
VALUE
);
79
VALUE
rb_ary_entry
(
VALUE
,
long
);
80
VALUE
rb_ary_each
(
VALUE
);
81
VALUE
rb_ary_join
(
VALUE
,
VALUE
);
82
VALUE
rb_ary_reverse
(
VALUE
);
83
VALUE
rb_ary_sort
(
VALUE
);
84
VALUE
rb_ary_sort_bang
(
VALUE
);
85
VALUE
rb_ary_delete
(
VALUE
,
VALUE
);
86
VALUE
rb_ary_delete_at
(
VALUE
,
long
);
87
VALUE
rb_ary_clear
(
VALUE
);
88
VALUE
rb_ary_plus
(
VALUE
,
VALUE
);
89
VALUE
rb_ary_concat
(
VALUE
,
VALUE
);
90
VALUE
rb_ary_assoc
(
VALUE
,
VALUE
);
91
VALUE
rb_ary_rassoc
(
VALUE
,
VALUE
);
92
VALUE
rb_ary_includes
(
VALUE
,
VALUE
);
93
VALUE
rb_ary_cmp
(
VALUE
,
VALUE
);
94
VALUE
rb_ary_replace
(
VALUE
copy,
VALUE
orig);
95
VALUE
rb_get_values_at
(
VALUE
,
long
,
int
,
VALUE
*,
VALUE
(*)(
VALUE
,
long
));
96
VALUE
rb_ary_resize
(
VALUE
ary,
long
len
);
97
/* bignum.c */
98
VALUE
rb_big_new
(
long
,
int
);
99
int
rb_bigzero_p
(
VALUE
x);
100
VALUE
rb_big_clone
(
VALUE
);
101
void
rb_big_2comp
(
VALUE
);
102
VALUE
rb_big_norm
(
VALUE
);
103
void
rb_big_resize
(
VALUE
big,
long
len
);
104
VALUE
rb_uint2big
(
VALUE
);
105
VALUE
rb_int2big
(
SIGNED_VALUE
);
106
VALUE
rb_uint2inum
(
VALUE
);
107
VALUE
rb_int2inum
(
SIGNED_VALUE
);
108
VALUE
rb_cstr_to_inum
(
const
char
*,
int
,
int
);
109
VALUE
rb_str_to_inum
(
VALUE
,
int
,
int
);
110
VALUE
rb_cstr2inum
(
const
char
*,
int
);
111
VALUE
rb_str2inum
(
VALUE
,
int
);
112
VALUE
rb_big2str
(
VALUE
,
int
);
113
VALUE
rb_big2str0
(
VALUE
,
int
,
int
);
114
SIGNED_VALUE
rb_big2long
(
VALUE
);
115
#define rb_big2int(x) rb_big2long(x)
116
VALUE
rb_big2ulong
(
VALUE
);
117
#define rb_big2uint(x) rb_big2ulong(x)
118
VALUE
rb_big2ulong_pack
(
VALUE
x);
119
#if HAVE_LONG_LONG
120
VALUE
rb_ll2inum(LONG_LONG);
121
VALUE
rb_ull2inum(
unsigned
LONG_LONG);
122
LONG_LONG rb_big2ll(
VALUE
);
123
unsigned
LONG_LONG rb_big2ull(
VALUE
);
124
#endif
/* HAVE_LONG_LONG */
125
DEPRECATED
(
void
rb_quad_pack
(
char
*,
VALUE
));
126
DEPRECATED
(
VALUE
rb_quad_unpack
(
const
char
*,
int
));
127
void
rb_big_pack
(
VALUE
val,
unsigned
long
*
buf
,
long
num_longs);
128
VALUE
rb_big_unpack
(
unsigned
long
*
buf
,
long
num_longs);
129
int
rb_uv_to_utf8
(
char
[6],
unsigned
long
);
130
VALUE
rb_dbl2big
(
double
);
131
double
rb_big2dbl
(
VALUE
);
132
VALUE
rb_big_cmp
(
VALUE
,
VALUE
);
133
VALUE
rb_big_eq
(
VALUE
,
VALUE
);
134
VALUE
rb_big_eql
(
VALUE
,
VALUE
);
135
VALUE
rb_big_plus
(
VALUE
,
VALUE
);
136
VALUE
rb_big_minus
(
VALUE
,
VALUE
);
137
VALUE
rb_big_mul
(
VALUE
,
VALUE
);
138
VALUE
rb_big_div
(
VALUE
,
VALUE
);
139
VALUE
rb_big_idiv
(
VALUE
,
VALUE
);
140
VALUE
rb_big_modulo
(
VALUE
,
VALUE
);
141
VALUE
rb_big_divmod
(
VALUE
,
VALUE
);
142
VALUE
rb_big_pow
(
VALUE
,
VALUE
);
143
VALUE
rb_big_and
(
VALUE
,
VALUE
);
144
VALUE
rb_big_or
(
VALUE
,
VALUE
);
145
VALUE
rb_big_xor
(
VALUE
,
VALUE
);
146
VALUE
rb_big_lshift
(
VALUE
,
VALUE
);
147
VALUE
rb_big_rshift
(
VALUE
,
VALUE
);
148
/* rational.c */
149
VALUE
rb_rational_raw
(
VALUE
,
VALUE
);
150
#define rb_rational_raw1(x) rb_rational_raw((x), INT2FIX(1))
151
#define rb_rational_raw2(x,y) rb_rational_raw((x), (y))
152
VALUE
rb_rational_new
(
VALUE
,
VALUE
);
153
#define rb_rational_new1(x) rb_rational_new((x), INT2FIX(1))
154
#define rb_rational_new2(x,y) rb_rational_new((x), (y))
155
VALUE
rb_Rational
(
VALUE
,
VALUE
);
156
#define rb_Rational1(x) rb_Rational((x), INT2FIX(1))
157
#define rb_Rational2(x,y) rb_Rational((x), (y))
158
/* complex.c */
159
VALUE
rb_complex_raw
(
VALUE
,
VALUE
);
160
#define rb_complex_raw1(x) rb_complex_raw((x), INT2FIX(0))
161
#define rb_complex_raw2(x,y) rb_complex_raw((x), (y))
162
VALUE
rb_complex_new
(
VALUE
,
VALUE
);
163
#define rb_complex_new1(x) rb_complex_new((x), INT2FIX(0))
164
#define rb_complex_new2(x,y) rb_complex_new((x), (y))
165
VALUE
rb_complex_polar
(
VALUE
,
VALUE
);
166
VALUE
rb_Complex
(
VALUE
,
VALUE
);
167
#define rb_Complex1(x) rb_Complex((x), INT2FIX(0))
168
#define rb_Complex2(x,y) rb_Complex((x), (y))
169
/* class.c */
170
VALUE
rb_class_boot
(
VALUE
);
171
VALUE
rb_class_new
(
VALUE
);
172
VALUE
rb_mod_init_copy
(
VALUE
,
VALUE
);
173
VALUE
rb_singleton_class_clone
(
VALUE
);
174
void
rb_singleton_class_attached
(
VALUE
,
VALUE
);
175
VALUE
rb_make_metaclass
(
VALUE
,
VALUE
);
176
void
rb_check_inheritable
(
VALUE
);
177
VALUE
rb_class_inherited
(
VALUE
,
VALUE
);
178
VALUE
rb_define_class_id
(
ID
,
VALUE
);
179
VALUE
rb_define_class_id_under
(
VALUE
,
ID
,
VALUE
);
180
VALUE
rb_module_new
(
void
);
181
VALUE
rb_define_module_id
(
ID
);
182
VALUE
rb_define_module_id_under
(
VALUE
,
ID
);
183
VALUE
rb_mod_included_modules
(
VALUE
);
184
VALUE
rb_mod_include_p
(
VALUE
,
VALUE
);
185
VALUE
rb_mod_ancestors
(
VALUE
);
186
VALUE
rb_class_instance_methods
(
int
,
VALUE
*,
VALUE
);
187
VALUE
rb_class_public_instance_methods
(
int
,
VALUE
*,
VALUE
);
188
VALUE
rb_class_protected_instance_methods
(
int
,
VALUE
*,
VALUE
);
189
VALUE
rb_class_private_instance_methods
(
int
,
VALUE
*,
VALUE
);
190
VALUE
rb_obj_singleton_methods
(
int
,
VALUE
*,
VALUE
);
191
void
rb_define_method_id
(
VALUE
,
ID
,
VALUE
(*)(
ANYARGS
),
int
);
192
void
rb_frozen_class_p
(
VALUE
);
193
void
rb_undef
(
VALUE
,
ID
);
194
void
rb_define_protected_method
(
VALUE
,
const
char
*,
VALUE
(*)(
ANYARGS
),
int
);
195
void
rb_define_private_method
(
VALUE
,
const
char
*,
VALUE
(*)(
ANYARGS
),
int
);
196
void
rb_define_singleton_method
(
VALUE
,
const
char
*,
VALUE
(*)(
ANYARGS
),
int
);
197
VALUE
rb_singleton_class
(
VALUE
);
198
/* compar.c */
199
int
rb_cmpint
(
VALUE
,
VALUE
,
VALUE
);
200
NORETURN
(
void
rb_cmperr
(
VALUE
,
VALUE
));
201
/* cont.c */
202
VALUE
rb_fiber_new
(
VALUE
(*)(
ANYARGS
),
VALUE
);
203
VALUE
rb_fiber_resume
(
VALUE
fib,
int
argc
,
VALUE
*
args
);
204
VALUE
rb_fiber_yield
(
int
argc
,
VALUE
*
args
);
205
VALUE
rb_fiber_current
(
void
);
206
VALUE
rb_fiber_alive_p
(
VALUE
);
207
/* enum.c */
208
/* enumerator.c */
209
VALUE
rb_enumeratorize
(
VALUE
,
VALUE
,
int
,
VALUE
*);
210
#define RETURN_ENUMERATOR(obj, argc, argv) do { \
211
if (!rb_block_given_p()) \
212
return rb_enumeratorize((obj), ID2SYM(rb_frame_this_func()),\
213
(argc), (argv)); \
214
} while (0)
215
/* error.c */
216
VALUE
rb_exc_new
(
VALUE
,
const
char
*,
long
);
217
VALUE
rb_exc_new2
(
VALUE
,
const
char
*);
218
VALUE
rb_exc_new3
(
VALUE
,
VALUE
);
219
PRINTF_ARGS
(
NORETURN
(
void
rb_loaderror
(
const
char
*, ...)), 1, 2);
220
PRINTF_ARGS
(
NORETURN
(
void
rb_name_error
(
ID
,
const
char
*, ...)), 2, 3);
221
NORETURN
(
void
rb_invalid_str
(
const
char
*,
const
char
*));
222
PRINTF_ARGS
(
void
rb_compile_error
(
const
char
*,
int
,
const
char
*, ...), 3, 4);
223
PRINTF_ARGS
(
void
rb_compile_error_with_enc
(
const
char
*,
int
,
void
*,
const
char
*, ...), 4, 5);
224
PRINTF_ARGS
(
void
rb_compile_error_append
(
const
char
*, ...), 1, 2);
225
NORETURN
(
void
rb_load_fail
(
const
char
*));
226
NORETURN
(
void
rb_error_frozen
(
const
char
*));
227
void
rb_check_frozen
(
VALUE
);
228
#define rb_check_frozen_internal(obj) do { \
229
VALUE frozen_obj = (obj); \
230
if (OBJ_FROZEN(frozen_obj)) { \
231
rb_error_frozen(rb_obj_classname(frozen_obj)); \
232
} \
233
} while (0)
234
#ifdef __GNUC__
235
#define rb_check_frozen(obj) __extension__({rb_check_frozen_internal(obj);})
236
#else
237
static
inline
void
238
rb_check_frozen_inline
(
VALUE
obj)
239
{
240
rb_check_frozen_internal
(obj);
241
}
242
#define rb_check_frozen(obj) rb_check_frozen_inline(obj)
243
#endif
244
245
/* eval.c */
246
int
rb_sourceline
(
void
);
247
const
char
*
rb_sourcefile
(
void
);
248
VALUE
rb_check_funcall
(
VALUE
,
ID
,
int
,
VALUE
*);
249
250
#if defined(NFDBITS) && defined(HAVE_RB_FD_INIT)
251
typedef
struct
{
252
int
maxfd;
253
fd_set *fdset;
254
}
rb_fdset_t
;
255
256
void
rb_fd_init
(
rb_fdset_t
*);
257
void
rb_fd_term
(
rb_fdset_t
*);
258
void
rb_fd_zero
(
rb_fdset_t
*);
259
void
rb_fd_set
(
int
,
rb_fdset_t
*);
260
void
rb_fd_clr
(
int
,
rb_fdset_t
*);
261
int
rb_fd_isset
(
int
,
const
rb_fdset_t
*);
262
void
rb_fd_copy
(
rb_fdset_t
*,
const
fd_set *,
int
);
263
void
rb_fd_dup
(
rb_fdset_t
*dst,
const
rb_fdset_t
*src);
264
int
rb_fd_select
(
int
,
rb_fdset_t
*,
rb_fdset_t
*,
rb_fdset_t
*,
struct
timeval
*);
265
266
#define rb_fd_ptr(f) ((f)->fdset)
267
#define rb_fd_max(f) ((f)->maxfd)
268
269
#elif defined(_WIN32)
270
271
typedef
struct
{
272
int
capa;
273
fd_set *fdset;
274
}
rb_fdset_t
;
275
276
void
rb_fd_init
(
rb_fdset_t
*);
277
void
rb_fd_term
(
rb_fdset_t
*);
278
#define rb_fd_zero(f) ((f)->fdset->fd_count = 0)
279
void
rb_fd_set
(
int
,
rb_fdset_t
*);
280
#define rb_fd_clr(n, f) rb_w32_fdclr((n), (f)->fdset)
281
#define rb_fd_isset(n, f) rb_w32_fdisset((n), (f)->fdset)
282
#define rb_fd_copy(d, s, n) rb_w32_fd_copy((d), (s), (n))
283
void
rb_w32_fd_copy
(
rb_fdset_t
*,
const
fd_set *,
int
);
284
#define rb_fd_dup(d, s) rb_w32_fd_dup((d), (s))
285
void
rb_w32_fd_dup
(
rb_fdset_t
*dst,
const
rb_fdset_t
*src);
286
#define rb_fd_select(n, rfds, wfds, efds, timeout) rb_w32_select((n), (rfds) ? ((rb_fdset_t*)(rfds))->fdset : NULL, (wfds) ? ((rb_fdset_t*)(wfds))->fdset : NULL, (efds) ? ((rb_fdset_t*)(efds))->fdset: NULL, (timeout))
287
#define rb_fd_resize(n, f) ((void)(f))
288
289
#define rb_fd_ptr(f) ((f)->fdset)
290
#define rb_fd_max(f) ((f)->fdset->fd_count)
291
292
#else
293
294
typedef
fd_set
rb_fdset_t
;
295
#define rb_fd_zero(f) FD_ZERO(f)
296
#define rb_fd_set(n, f) FD_SET((n), (f))
297
#define rb_fd_clr(n, f) FD_CLR((n), (f))
298
#define rb_fd_isset(n, f) FD_ISSET((n), (f))
299
#define rb_fd_copy(d, s, n) (*(d) = *(s))
300
#define rb_fd_dup(d, s) (*(d) = *(s))
301
#define rb_fd_resize(n, f) ((void)(f))
302
#define rb_fd_ptr(f) (f)
303
#define rb_fd_init(f) FD_ZERO(f)
304
#define rb_fd_init_copy(d, s) (*(d) = *(s))
305
#define rb_fd_term(f) ((void)(f))
306
#define rb_fd_max(f) FD_SETSIZE
307
#define rb_fd_select(n, rfds, wfds, efds, timeout) select((n), (rfds), (wfds), (efds), (timeout))
308
309
#endif
310
311
NORETURN
(
void
rb_exc_raise
(
VALUE
));
312
NORETURN
(
void
rb_exc_fatal
(
VALUE
));
313
VALUE
rb_f_exit
(
int
,
VALUE
*);
314
VALUE
rb_f_abort
(
int
,
VALUE
*);
315
void
rb_remove_method
(
VALUE
,
const
char
*);
316
void
rb_remove_method_id
(
VALUE
,
ID
);
317
#define rb_disable_super(klass, name) ((void)0)
318
#define rb_enable_super(klass, name) ((void)0)
319
#define HAVE_RB_DEFINE_ALLOC_FUNC 1
320
typedef
VALUE
(*
rb_alloc_func_t
)(
VALUE
);
321
void
rb_define_alloc_func
(
VALUE
,
rb_alloc_func_t
);
322
void
rb_undef_alloc_func
(
VALUE
);
323
rb_alloc_func_t
rb_get_alloc_func
(
VALUE
);
324
void
rb_clear_cache
(
void
);
325
void
rb_clear_cache_by_class
(
VALUE
);
326
void
rb_alias
(
VALUE
,
ID
,
ID
);
327
void
rb_attr
(
VALUE
,
ID
,
int
,
int
,
int
);
328
int
rb_method_boundp
(
VALUE
,
ID
,
int
);
329
int
rb_method_basic_definition_p
(
VALUE
,
ID
);
330
VALUE
rb_eval_cmd
(
VALUE
,
VALUE
,
int
);
331
int
rb_obj_respond_to
(
VALUE
,
ID
,
int
);
332
int
rb_respond_to
(
VALUE
,
ID
);
333
VALUE
rb_f_notimplement
(
int
argc
,
VALUE
*
argv
,
VALUE
obj);
334
void
rb_interrupt
(
void
);
335
VALUE
rb_apply
(
VALUE
,
ID
,
VALUE
);
336
void
rb_backtrace
(
void
);
337
ID
rb_frame_this_func
(
void
);
338
VALUE
rb_obj_instance_eval
(
int
,
VALUE
*,
VALUE
);
339
VALUE
rb_obj_instance_exec
(
int
,
VALUE
*,
VALUE
);
340
VALUE
rb_mod_module_eval
(
int
,
VALUE
*,
VALUE
);
341
VALUE
rb_mod_module_exec
(
int
,
VALUE
*,
VALUE
);
342
void
rb_load
(
VALUE
,
int
);
343
void
rb_load_protect
(
VALUE
,
int
,
int
*);
344
NORETURN
(
void
rb_jump_tag
(
int
));
345
int
rb_provided
(
const
char
*);
346
int
rb_feature_provided
(
const
char
*,
const
char
**);
347
void
rb_provide
(
const
char
*);
348
VALUE
rb_f_require
(
VALUE
,
VALUE
);
349
VALUE
rb_require_safe
(
VALUE
,
int
);
350
void
rb_obj_call_init
(
VALUE
,
int
,
VALUE
*);
351
VALUE
rb_class_new_instance
(
int
,
VALUE
*,
VALUE
);
352
VALUE
rb_block_proc
(
void
);
353
DEPRECATED
(
VALUE
rb_f_lambda
(
void
));
354
VALUE
rb_block_lambda
(
void
);
355
VALUE
rb_proc_new
(
VALUE
(*)(
ANYARGS
/* VALUE yieldarg[, VALUE procarg] */
),
VALUE
);
356
VALUE
rb_obj_is_proc
(
VALUE
);
357
VALUE
rb_proc_call
(
VALUE
,
VALUE
);
358
VALUE
rb_proc_call_with_block
(
VALUE
,
int
argc
,
VALUE
*
argv
,
VALUE
);
359
int
rb_proc_arity
(
VALUE
);
360
VALUE
rb_proc_lambda_p
(
VALUE
);
361
VALUE
rb_binding_new
(
void
);
362
VALUE
rb_obj_method
(
VALUE
,
VALUE
);
363
VALUE
rb_obj_is_method
(
VALUE
);
364
VALUE
rb_method_call
(
int
,
VALUE
*,
VALUE
);
365
VALUE
rb_method_call_with_block
(
int
,
VALUE
*,
VALUE
,
VALUE
);
366
int
rb_mod_method_arity
(
VALUE
,
ID
);
367
int
rb_obj_method_arity
(
VALUE
,
ID
);
368
VALUE
rb_protect
(
VALUE
(*)(
VALUE
),
VALUE
,
int
*);
369
void
rb_set_end_proc
(
void
(*)(
VALUE
),
VALUE
);
370
void
rb_mark_end_proc
(
void
);
371
void
rb_exec_end_proc
(
void
);
372
void
ruby_finalize
(
void
);
373
NORETURN
(
void
ruby_stop
(
int
));
374
int
ruby_cleanup
(
volatile
int
);
375
DEPRECATED
(
void
rb_gc_mark_threads
(
void
));
376
void
rb_thread_schedule
(
void
);
377
void
rb_thread_wait_fd
(
int
);
378
int
rb_thread_fd_writable
(
int
);
379
void
rb_thread_fd_close
(
int
);
380
int
rb_thread_alone
(
void
);
381
void
rb_thread_polling
(
void
);
382
void
rb_thread_sleep
(
int
);
383
void
rb_thread_sleep_forever
(
void
);
384
VALUE
rb_thread_stop
(
void
);
385
VALUE
rb_thread_wakeup
(
VALUE
);
386
VALUE
rb_thread_wakeup_alive
(
VALUE
);
387
VALUE
rb_thread_run
(
VALUE
);
388
VALUE
rb_thread_kill
(
VALUE
);
389
VALUE
rb_thread_create
(
VALUE
(*)(
ANYARGS
),
void
*);
390
DEPRECATED
(
int
rb_thread_select
(
int
, fd_set *, fd_set *, fd_set *,
struct
timeval
*));
391
int
rb_thread_fd_select
(
int
, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *,
struct
timeval
*);
392
void
rb_thread_wait_for
(
struct
timeval
);
393
VALUE
rb_thread_current
(
void
);
394
VALUE
rb_thread_main
(
void
);
395
VALUE
rb_thread_local_aref
(
VALUE
,
ID
);
396
VALUE
rb_thread_local_aset
(
VALUE
,
ID
,
VALUE
);
397
void
rb_thread_atfork
(
void
);
398
void
rb_thread_atfork_before_exec
(
void
);
399
VALUE
rb_exec_recursive
(
VALUE
(*)(
VALUE
,
VALUE
,
int
),
VALUE
,
VALUE
);
400
VALUE
rb_exec_recursive_paired
(
VALUE
(*)(
VALUE
,
VALUE
,
int
),
VALUE
,
VALUE
,
VALUE
);
401
VALUE
rb_exec_recursive_outer
(
VALUE
(*)(
VALUE
,
VALUE
,
int
),
VALUE
,
VALUE
);
402
/* dir.c */
403
VALUE
rb_dir_getwd
(
void
);
404
/* file.c */
405
VALUE
rb_file_s_expand_path
(
int
,
VALUE
*);
406
VALUE
rb_file_expand_path
(
VALUE
,
VALUE
);
407
VALUE
rb_file_s_absolute_path
(
int
,
VALUE
*);
408
VALUE
rb_file_absolute_path
(
VALUE
,
VALUE
);
409
VALUE
rb_file_dirname
(
VALUE
fname);
410
void
rb_file_const
(
const
char
*,
VALUE
);
411
int
rb_file_load_ok
(
const
char
*);
412
int
rb_find_file_ext_safe
(
VALUE
*,
const
char
*
const
*,
int
);
413
VALUE
rb_find_file_safe
(
VALUE
,
int
);
414
int
rb_find_file_ext
(
VALUE
*,
const
char
*
const
*);
415
VALUE
rb_find_file
(
VALUE
);
416
DEPRECATED
(
char
*
rb_path_next
(
const
char
*));
417
DEPRECATED
(
char
*
rb_path_skip_prefix
(
const
char
*));
418
DEPRECATED
(
char
*
rb_path_last_separator
(
const
char
*));
419
DEPRECATED
(
char
*
rb_path_end
(
const
char
*));
420
VALUE
rb_file_directory_p
(
VALUE
,
VALUE
);
421
VALUE
rb_str_encode_ospath
(
VALUE
);
422
int
rb_is_absolute_path
(
const
char
*);
423
DEPRECATED
(
const
char
*
ruby_find_basename
(
const
char
*
name
,
long
*baselen,
long
*alllen));
424
DEPRECATED
(
const
char
*
ruby_find_extname
(
const
char
*
name
,
long
*
len
));
425
/* gc.c */
426
void
ruby_set_stack_size
(
size_t
);
427
NORETURN
(
void
rb_memerror
(
void
));
428
int
ruby_stack_check
(
void
);
429
size_t
ruby_stack_length
(
VALUE
**);
430
int
rb_during_gc
(
void
);
431
void
rb_gc_mark_locations
(
VALUE
*,
VALUE
*);
432
void
rb_mark_tbl
(
struct
st_table
*);
433
void
rb_mark_set
(
struct
st_table
*);
434
void
rb_mark_hash
(
struct
st_table
*);
435
void
rb_gc_mark_maybe
(
VALUE
);
436
void
rb_gc_mark
(
VALUE
);
437
void
rb_gc_force_recycle
(
VALUE
);
438
void
rb_gc
(
void
);
439
void
rb_gc_copy_finalizer
(
VALUE
,
VALUE
);
440
void
rb_gc_finalize_deferred
(
void
);
441
void
rb_gc_call_finalizer_at_exit
(
void
);
442
VALUE
rb_gc_enable
(
void
);
443
VALUE
rb_gc_disable
(
void
);
444
VALUE
rb_gc_start
(
void
);
445
#define Init_stack(addr) ruby_init_stack(addr)
446
void
rb_gc_set_params
(
void
);
447
/* hash.c */
448
void
st_foreach_safe
(
struct
st_table
*,
int
(*)(
ANYARGS
),
st_data_t
);
449
VALUE
rb_check_hash_type
(
VALUE
);
450
void
rb_hash_foreach
(
VALUE
,
int
(*)(
ANYARGS
),
VALUE
);
451
VALUE
rb_hash
(
VALUE
);
452
VALUE
rb_hash_new
(
void
);
453
VALUE
rb_hash_dup
(
VALUE
);
454
VALUE
rb_hash_freeze
(
VALUE
);
455
VALUE
rb_hash_aref
(
VALUE
,
VALUE
);
456
VALUE
rb_hash_lookup
(
VALUE
,
VALUE
);
457
VALUE
rb_hash_lookup2
(
VALUE
,
VALUE
,
VALUE
);
458
VALUE
rb_hash_fetch
(
VALUE
,
VALUE
);
459
VALUE
rb_hash_aset
(
VALUE
,
VALUE
,
VALUE
);
460
VALUE
rb_hash_delete_if
(
VALUE
);
461
VALUE
rb_hash_delete
(
VALUE
,
VALUE
);
462
typedef
VALUE
rb_hash_update_func
(
VALUE
newkey,
VALUE
oldkey,
VALUE
value);
463
VALUE
rb_hash_update_by
(
VALUE
hash1,
VALUE
hash2,
rb_hash_update_func
*
func
);
464
struct
st_table
*
rb_hash_tbl
(
VALUE
);
465
int
rb_path_check
(
const
char
*);
466
int
rb_env_path_tainted
(
void
);
467
VALUE
rb_env_clear
(
void
);
468
/* io.c */
469
#define rb_defout rb_stdout
470
RUBY_EXTERN
VALUE
rb_fs
;
471
RUBY_EXTERN
VALUE
rb_output_fs
;
472
RUBY_EXTERN
VALUE
rb_rs
;
473
RUBY_EXTERN
VALUE
rb_default_rs
;
474
RUBY_EXTERN
VALUE
rb_output_rs
;
475
VALUE
rb_io_write
(
VALUE
,
VALUE
);
476
VALUE
rb_io_gets
(
VALUE
);
477
VALUE
rb_io_getbyte
(
VALUE
);
478
VALUE
rb_io_ungetc
(
VALUE
,
VALUE
);
479
VALUE
rb_io_ungetbyte
(
VALUE
,
VALUE
);
480
VALUE
rb_io_close
(
VALUE
);
481
VALUE
rb_io_flush
(
VALUE
);
482
VALUE
rb_io_eof
(
VALUE
);
483
VALUE
rb_io_binmode
(
VALUE
);
484
VALUE
rb_io_ascii8bit_binmode
(
VALUE
);
485
VALUE
rb_io_addstr
(
VALUE
,
VALUE
);
486
VALUE
rb_io_printf
(
int
,
VALUE
*,
VALUE
);
487
VALUE
rb_io_print
(
int
,
VALUE
*,
VALUE
);
488
VALUE
rb_io_puts
(
int
,
VALUE
*,
VALUE
);
489
VALUE
rb_io_fdopen
(
int
,
int
,
const
char
*);
490
VALUE
rb_io_get_io
(
VALUE
);
491
VALUE
rb_file_open
(
const
char
*,
const
char
*);
492
VALUE
rb_file_open_str
(
VALUE
,
const
char
*);
493
VALUE
rb_gets
(
void
);
494
void
rb_write_error
(
const
char
*);
495
void
rb_write_error2
(
const
char
*,
long
);
496
void
rb_close_before_exec
(
int
lowfd,
int
maxhint,
VALUE
noclose_fds);
497
int
rb_pipe
(
int
*pipes);
498
int
rb_reserved_fd_p
(
int
fd);
499
#define RB_RESERVED_FD_P(fd) rb_reserved_fd_p(fd)
500
void
rb_update_max_fd
(
int
fd);
501
/* marshal.c */
502
VALUE
rb_marshal_dump
(
VALUE
,
VALUE
);
503
VALUE
rb_marshal_load
(
VALUE
);
504
void
rb_marshal_define_compat
(
VALUE
newclass,
VALUE
oldclass,
VALUE
(*dumper)(
VALUE
),
VALUE
(*loader)(
VALUE
,
VALUE
));
505
/* numeric.c */
506
NORETURN
(
void
rb_num_zerodiv
(
void
));
507
#define RB_NUM_COERCE_FUNCS_NEED_OPID 1
508
VALUE
rb_num_coerce_bin
(
VALUE
,
VALUE
,
ID
);
509
VALUE
rb_num_coerce_cmp
(
VALUE
,
VALUE
,
ID
);
510
VALUE
rb_num_coerce_relop
(
VALUE
,
VALUE
,
ID
);
511
VALUE
rb_float_new
(
double
);
512
VALUE
rb_num2fix
(
VALUE
);
513
VALUE
rb_fix2str
(
VALUE
,
int
);
514
VALUE
rb_dbl_cmp
(
double
,
double
);
515
/* object.c */
516
int
rb_eql
(
VALUE
,
VALUE
);
517
VALUE
rb_any_to_s
(
VALUE
);
518
VALUE
rb_inspect
(
VALUE
);
519
VALUE
rb_obj_is_instance_of
(
VALUE
,
VALUE
);
520
VALUE
rb_obj_is_kind_of
(
VALUE
,
VALUE
);
521
VALUE
rb_obj_alloc
(
VALUE
);
522
VALUE
rb_obj_clone
(
VALUE
);
523
VALUE
rb_obj_dup
(
VALUE
);
524
VALUE
rb_obj_init_copy
(
VALUE
,
VALUE
);
525
VALUE
rb_obj_taint
(
VALUE
);
526
VALUE
rb_obj_tainted
(
VALUE
);
527
VALUE
rb_obj_untaint
(
VALUE
);
528
VALUE
rb_obj_untrust
(
VALUE
);
529
VALUE
rb_obj_untrusted
(
VALUE
);
530
VALUE
rb_obj_trust
(
VALUE
);
531
VALUE
rb_obj_freeze
(
VALUE
);
532
VALUE
rb_obj_frozen_p
(
VALUE
);
533
VALUE
rb_obj_id
(
VALUE
);
534
VALUE
rb_obj_class
(
VALUE
);
535
VALUE
rb_class_real
(
VALUE
);
536
VALUE
rb_class_inherited_p
(
VALUE
,
VALUE
);
537
VALUE
rb_class_superclass
(
VALUE
);
538
VALUE
rb_class_get_superclass
(
VALUE
);
539
VALUE
rb_convert_type
(
VALUE
,
int
,
const
char
*,
const
char
*);
540
VALUE
rb_check_convert_type
(
VALUE
,
int
,
const
char
*,
const
char
*);
541
VALUE
rb_check_to_integer
(
VALUE
,
const
char
*);
542
VALUE
rb_check_to_float
(
VALUE
);
543
VALUE
rb_to_int
(
VALUE
);
544
VALUE
rb_Integer
(
VALUE
);
545
VALUE
rb_to_float
(
VALUE
);
546
VALUE
rb_Float
(
VALUE
);
547
VALUE
rb_String
(
VALUE
);
548
VALUE
rb_Array
(
VALUE
);
549
double
rb_cstr_to_dbl
(
const
char
*,
int
);
550
double
rb_str_to_dbl
(
VALUE
,
int
);
551
/* parse.y */
552
RUBY_EXTERN
int
ruby_sourceline
;
553
RUBY_EXTERN
char
*
ruby_sourcefile
;
554
ID
rb_id_attrset
(
ID
);
555
void
rb_gc_mark_parser
(
void
);
556
int
rb_is_const_id
(
ID
);
557
int
rb_is_instance_id
(
ID
);
558
int
rb_is_class_id
(
ID
);
559
int
rb_is_local_id
(
ID
);
560
int
rb_is_junk_id
(
ID
);
561
int
rb_symname_p
(
const
char
*);
562
int
rb_sym_interned_p
(
VALUE
);
563
void
rb_gc_mark_symbols
(
void
);
564
VALUE
rb_backref_get
(
void
);
565
void
rb_backref_set
(
VALUE
);
566
VALUE
rb_lastline_get
(
void
);
567
void
rb_lastline_set
(
VALUE
);
568
VALUE
rb_sym_all_symbols
(
void
);
569
/* process.c */
570
void
rb_last_status_set
(
int
status, rb_pid_t pid);
571
VALUE
rb_last_status_get
(
void
);
572
struct
rb_exec_arg
{
573
int
argc
;
574
VALUE
*
argv
;
575
const
char
*
prog
;
576
VALUE
options
;
577
VALUE
redirect_fds
;
578
};
579
int
rb_proc_exec_n
(
int
,
VALUE
*,
const
char
*);
580
int
rb_proc_exec
(
const
char
*);
581
VALUE
rb_exec_arg_init
(
int
argc
,
VALUE
*
argv
,
int
accept_shell,
struct
rb_exec_arg
*e);
582
int
rb_exec_arg_addopt
(
struct
rb_exec_arg
*e,
VALUE
key
,
VALUE
val);
583
void
rb_exec_arg_fixup
(
struct
rb_exec_arg
*e);
584
int
rb_run_exec_options
(
const
struct
rb_exec_arg
*e,
struct
rb_exec_arg
*s);
585
int
rb_run_exec_options_err
(
const
struct
rb_exec_arg
*e,
struct
rb_exec_arg
*s,
char
*,
size_t
);
586
int
rb_exec
(
const
struct
rb_exec_arg
*);
587
int
rb_exec_err
(
const
struct
rb_exec_arg
*,
char
*,
size_t
);
588
rb_pid_t
rb_fork
(
int
*,
int
(*)(
void
*),
void
*,
VALUE
);
589
rb_pid_t
rb_fork_err
(
int
*,
int
(*)(
void
*,
char
*,
size_t
),
void
*,
VALUE
,
char
*,
size_t
);
590
VALUE
rb_f_exec
(
int
,
VALUE
*);
591
rb_pid_t
rb_waitpid
(rb_pid_t pid,
int
*status,
int
flags);
592
void
rb_syswait
(rb_pid_t pid);
593
rb_pid_t
rb_spawn
(
int
,
VALUE
*);
594
rb_pid_t
rb_spawn_err
(
int
,
VALUE
*,
char
*,
size_t
);
595
VALUE
rb_proc_times
(
VALUE
);
596
VALUE
rb_detach_process
(rb_pid_t pid);
597
/* range.c */
598
VALUE
rb_range_new
(
VALUE
,
VALUE
,
int
);
599
VALUE
rb_range_beg_len
(
VALUE
,
long
*,
long
*,
long
,
int
);
600
int
rb_range_values
(
VALUE
range
,
VALUE
*begp,
VALUE
*endp,
int
*exclp);
601
/* random.c */
602
unsigned
int
rb_genrand_int32
(
void
);
603
double
rb_genrand_real
(
void
);
604
void
rb_reset_random_seed
(
void
);
605
VALUE
rb_random_bytes
(
VALUE
rnd,
long
n);
606
VALUE
rb_random_int
(
VALUE
rnd,
VALUE
max
);
607
unsigned
int
rb_random_int32
(
VALUE
rnd);
608
double
rb_random_real
(
VALUE
rnd);
609
unsigned
long
rb_genrand_ulong_limited
(
unsigned
long
i
);
610
/* re.c */
611
#define rb_memcmp memcmp
612
int
rb_memcicmp
(
const
void
*,
const
void
*,
long
);
613
void
rb_match_busy
(
VALUE
);
614
VALUE
rb_reg_nth_defined
(
int
,
VALUE
);
615
VALUE
rb_reg_nth_match
(
int
,
VALUE
);
616
int
rb_reg_backref_number
(
VALUE
match
,
VALUE
backref);
617
VALUE
rb_reg_last_match
(
VALUE
);
618
VALUE
rb_reg_match_pre
(
VALUE
);
619
VALUE
rb_reg_match_post
(
VALUE
);
620
VALUE
rb_reg_match_last
(
VALUE
);
621
#define HAVE_RB_REG_NEW_STR 1
622
VALUE
rb_reg_new_str
(
VALUE
,
int
);
623
VALUE
rb_reg_new
(
const
char
*,
long
,
int
);
624
VALUE
rb_reg_alloc
(
void
);
625
VALUE
rb_reg_init_str
(
VALUE
re,
VALUE
s,
int
options
);
626
VALUE
rb_reg_match
(
VALUE
,
VALUE
);
627
VALUE
rb_reg_match2
(
VALUE
);
628
int
rb_reg_options
(
VALUE
);
629
/* ruby.c */
630
#define rb_argv rb_get_argv()
631
RUBY_EXTERN
VALUE
rb_argv0
;
632
VALUE
rb_get_argv
(
void
);
633
void
*
rb_load_file
(
const
char
*);
634
void
ruby_script
(
const
char
*);
635
void
ruby_prog_init
(
void
);
636
void
ruby_set_argv
(
int
,
char
**);
637
void
*
ruby_process_options
(
int
,
char
**);
638
void
ruby_init_loadpath
(
void
);
639
void
ruby_incpush
(
const
char
*);
640
/* signal.c */
641
VALUE
rb_f_kill
(
int
,
VALUE
*);
642
void
rb_gc_mark_trap_list
(
void
);
643
#ifdef POSIX_SIGNAL
644
#define posix_signal ruby_posix_signal
645
RETSIGTYPE (*
posix_signal
(
int
, RETSIGTYPE (*)(
int
)))(int);
646
#endif
647
void
ruby_sig_finalize
(
void
);
648
void
rb_trap_exit
(
void
);
649
void
rb_trap_exec
(
void
);
650
const
char
*
ruby_signal_name
(
int
);
651
void
ruby_default_signal
(
int
);
652
/* sprintf.c */
653
VALUE
rb_f_sprintf
(
int
,
const
VALUE
*);
654
PRINTF_ARGS
(
VALUE
rb_sprintf
(
const
char
*, ...), 1, 2);
655
VALUE
rb_vsprintf
(
const
char
*, va_list);
656
PRINTF_ARGS
(
VALUE
rb_str_catf
(
VALUE
,
const
char
*, ...), 2, 3);
657
VALUE
rb_str_vcatf
(
VALUE
,
const
char
*, va_list);
658
VALUE
rb_str_format
(
int
,
const
VALUE
*,
VALUE
);
659
/* string.c */
660
VALUE
rb_str_new
(
const
char
*,
long
);
661
VALUE
rb_str_new_cstr
(
const
char
*);
662
VALUE
rb_str_new2
(
const
char
*);
663
VALUE
rb_str_new_shared
(
VALUE
);
664
VALUE
rb_str_new3
(
VALUE
);
665
VALUE
rb_str_new_frozen
(
VALUE
);
666
VALUE
rb_str_new4
(
VALUE
);
667
VALUE
rb_str_new_with_class
(
VALUE
,
const
char
*,
long
);
668
VALUE
rb_str_new5
(
VALUE
,
const
char
*,
long
);
669
VALUE
rb_tainted_str_new_cstr
(
const
char
*);
670
VALUE
rb_tainted_str_new
(
const
char
*,
long
);
671
VALUE
rb_tainted_str_new2
(
const
char
*);
672
VALUE
rb_external_str_new
(
const
char
*,
long
);
673
VALUE
rb_external_str_new_cstr
(
const
char
*);
674
VALUE
rb_locale_str_new
(
const
char
*,
long
);
675
VALUE
rb_locale_str_new_cstr
(
const
char
*);
676
VALUE
rb_filesystem_str_new
(
const
char
*,
long
);
677
VALUE
rb_filesystem_str_new_cstr
(
const
char
*);
678
VALUE
rb_str_buf_new
(
long
);
679
VALUE
rb_str_buf_new_cstr
(
const
char
*);
680
VALUE
rb_str_buf_new2
(
const
char
*);
681
VALUE
rb_str_tmp_new
(
long
);
682
VALUE
rb_usascii_str_new
(
const
char
*,
long
);
683
VALUE
rb_usascii_str_new_cstr
(
const
char
*);
684
VALUE
rb_usascii_str_new2
(
const
char
*);
685
void
rb_str_free
(
VALUE
);
686
void
rb_str_shared_replace
(
VALUE
,
VALUE
);
687
VALUE
rb_str_buf_append
(
VALUE
,
VALUE
);
688
VALUE
rb_str_buf_cat
(
VALUE
,
const
char
*,
long
);
689
VALUE
rb_str_buf_cat2
(
VALUE
,
const
char
*);
690
VALUE
rb_str_buf_cat_ascii
(
VALUE
,
const
char
*);
691
VALUE
rb_obj_as_string
(
VALUE
);
692
VALUE
rb_check_string_type
(
VALUE
);
693
VALUE
rb_str_dup
(
VALUE
);
694
VALUE
rb_str_resurrect
(
VALUE
str);
695
VALUE
rb_str_locktmp
(
VALUE
);
696
VALUE
rb_str_unlocktmp
(
VALUE
);
697
VALUE
rb_str_dup_frozen
(
VALUE
);
698
#define rb_str_dup_frozen rb_str_new_frozen
699
VALUE
rb_str_plus
(
VALUE
,
VALUE
);
700
VALUE
rb_str_times
(
VALUE
,
VALUE
);
701
long
rb_str_sublen
(
VALUE
,
long
);
702
VALUE
rb_str_substr
(
VALUE
,
long
,
long
);
703
VALUE
rb_str_subseq
(
VALUE
,
long
,
long
);
704
void
rb_str_modify
(
VALUE
);
705
void
rb_str_modify_expand
(
VALUE
,
long
);
706
VALUE
rb_str_freeze
(
VALUE
);
707
void
rb_str_set_len
(
VALUE
,
long
);
708
VALUE
rb_str_resize
(
VALUE
,
long
);
709
VALUE
rb_str_cat
(
VALUE
,
const
char
*,
long
);
710
VALUE
rb_str_cat2
(
VALUE
,
const
char
*);
711
VALUE
rb_str_append
(
VALUE
,
VALUE
);
712
VALUE
rb_str_concat
(
VALUE
,
VALUE
);
713
st_index_t
rb_memhash
(
const
void
*ptr,
long
len
);
714
st_index_t
rb_hash_start
(
st_index_t
);
715
st_index_t
rb_hash_uint32
(
st_index_t
,
uint32_t
);
716
st_index_t
rb_hash_uint
(
st_index_t
,
st_index_t
);
717
st_index_t
rb_hash_end
(
st_index_t
);
718
#define rb_hash_uint32(h, i) st_hash_uint32((h), (i))
719
#define rb_hash_uint(h, i) st_hash_uint((h), (i))
720
#define rb_hash_end(h) st_hash_end(h)
721
st_index_t
rb_str_hash
(
VALUE
);
722
int
rb_str_hash_cmp
(
VALUE
,
VALUE
);
723
int
rb_str_comparable
(
VALUE
,
VALUE
);
724
int
rb_str_cmp
(
VALUE
,
VALUE
);
725
VALUE
rb_str_equal
(
VALUE
str1,
VALUE
str2);
726
VALUE
rb_str_drop_bytes
(
VALUE
,
long
);
727
void
rb_str_update
(
VALUE
,
long
,
long
,
VALUE
);
728
VALUE
rb_str_replace
(
VALUE
,
VALUE
);
729
VALUE
rb_str_inspect
(
VALUE
);
730
VALUE
rb_str_dump
(
VALUE
);
731
VALUE
rb_str_split
(
VALUE
,
const
char
*);
732
void
rb_str_associate
(
VALUE
,
VALUE
);
733
VALUE
rb_str_associated
(
VALUE
);
734
void
rb_str_setter
(
VALUE
,
ID
,
VALUE
*);
735
VALUE
rb_str_intern
(
VALUE
);
736
VALUE
rb_sym_to_s
(
VALUE
);
737
long
rb_str_strlen
(
VALUE
);
738
VALUE
rb_str_length
(
VALUE
);
739
long
rb_str_offset
(
VALUE
,
long
);
740
size_t
rb_str_capacity
(
VALUE
);
741
VALUE
rb_str_ellipsize
(
VALUE
,
long
);
742
#if defined(__GNUC__) && !defined(__PCC__)
743
#define rb_str_new_cstr(str) __extension__ ( \
744
{ \
745
(__builtin_constant_p(str)) ? \
746
rb_str_new((str), (long)strlen(str)) : \
747
rb_str_new_cstr(str); \
748
})
749
#define rb_tainted_str_new_cstr(str) __extension__ ( \
750
{ \
751
(__builtin_constant_p(str)) ? \
752
rb_tainted_str_new((str), (long)strlen(str)) : \
753
rb_tainted_str_new_cstr(str); \
754
})
755
#define rb_usascii_str_new_cstr(str) __extension__ ( \
756
{ \
757
(__builtin_constant_p(str)) ? \
758
rb_usascii_str_new((str), (long)strlen(str)) : \
759
rb_usascii_str_new_cstr(str); \
760
})
761
#define rb_external_str_new_cstr(str) __extension__ ( \
762
{ \
763
(__builtin_constant_p(str)) ? \
764
rb_external_str_new((str), (long)strlen(str)) : \
765
rb_external_str_new_cstr(str); \
766
})
767
#define rb_locale_str_new_cstr(str) __extension__ ( \
768
{ \
769
(__builtin_constant_p(str)) ? \
770
rb_locale_str_new((str), (long)strlen(str)) : \
771
rb_locale_str_new_cstr(str); \
772
})
773
#define rb_str_buf_new_cstr(str) __extension__ ( \
774
{ \
775
(__builtin_constant_p(str)) ? \
776
rb_str_buf_cat(rb_str_buf_new((long)strlen(str)), \
777
(str), (long)strlen(str)) : \
778
rb_str_buf_new_cstr(str); \
779
})
780
#define rb_str_buf_cat2(str, ptr) __extension__ ( \
781
{ \
782
(__builtin_constant_p(ptr)) ? \
783
rb_str_buf_cat((str), (ptr), (long)strlen(ptr)) : \
784
rb_str_buf_cat2((str), (ptr)); \
785
})
786
#define rb_str_cat2(str, ptr) __extension__ ( \
787
{ \
788
(__builtin_constant_p(ptr)) ? \
789
rb_str_cat((str), (ptr), (long)strlen(ptr)) : \
790
rb_str_cat2((str), (ptr)); \
791
})
792
#define rb_exc_new2(klass, ptr) __extension__ ( \
793
{ \
794
(__builtin_constant_p(ptr)) ? \
795
rb_exc_new((klass), (ptr), (long)strlen(ptr)) : \
796
rb_exc_new2((klass), (ptr)); \
797
})
798
#endif
799
#define rb_str_new2 rb_str_new_cstr
800
#define rb_str_new3 rb_str_new_shared
801
#define rb_str_new4 rb_str_new_frozen
802
#define rb_str_new5 rb_str_new_with_class
803
#define rb_tainted_str_new2 rb_tainted_str_new_cstr
804
#define rb_str_buf_new2 rb_str_buf_new_cstr
805
#define rb_usascii_str_new2 rb_usascii_str_new_cstr
806
/* struct.c */
807
VALUE
rb_struct_new
(
VALUE
, ...);
808
VALUE
rb_struct_define
(
const
char
*, ...);
809
VALUE
rb_struct_alloc
(
VALUE
,
VALUE
);
810
VALUE
rb_struct_initialize
(
VALUE
,
VALUE
);
811
VALUE
rb_struct_aref
(
VALUE
,
VALUE
);
812
VALUE
rb_struct_aset
(
VALUE
,
VALUE
,
VALUE
);
813
VALUE
rb_struct_getmember
(
VALUE
,
ID
);
814
DEPRECATED
(
VALUE
rb_struct_iv_get
(
VALUE
,
const
char
*));
815
VALUE
rb_struct_s_members
(
VALUE
);
816
VALUE
rb_struct_members
(
VALUE
);
817
VALUE
rb_struct_alloc_noinit
(
VALUE
);
818
VALUE
rb_struct_define_without_accessor
(
const
char
*,
VALUE
,
rb_alloc_func_t
, ...);
819
/* thread.c */
820
typedef
void
rb_unblock_function_t
(
void
*);
821
typedef
VALUE
rb_blocking_function_t
(
void
*);
822
void
rb_thread_check_ints
(
void
);
823
int
rb_thread_interrupted
(
VALUE
thval);
824
VALUE
rb_thread_blocking_region
(
rb_blocking_function_t
*
func
,
void
*data1,
825
rb_unblock_function_t
*ubf,
void
*data2);
826
#define RUBY_UBF_IO ((rb_unblock_function_t *)-1)
827
#define RUBY_UBF_PROCESS ((rb_unblock_function_t *)-1)
828
VALUE
rb_mutex_new
(
void
);
829
VALUE
rb_mutex_locked_p
(
VALUE
mutex);
830
VALUE
rb_mutex_trylock
(
VALUE
mutex);
831
VALUE
rb_mutex_lock
(
VALUE
mutex);
832
VALUE
rb_mutex_unlock
(
VALUE
mutex);
833
VALUE
rb_mutex_sleep
(
VALUE
self
,
VALUE
timeout);
834
VALUE
rb_mutex_synchronize
(
VALUE
mutex,
VALUE
(*
func
)(
VALUE
arg
),
VALUE
arg);
835
VALUE
rb_barrier_new
(
void
);
836
VALUE
rb_barrier_wait
(
VALUE
self
);
837
VALUE
rb_barrier_release
(
VALUE
self
);
838
VALUE
rb_barrier_destroy
(
VALUE
self
);
839
/* time.c */
840
VALUE
rb_time_new
(time_t,
long
);
841
VALUE
rb_time_nano_new
(time_t,
long
);
842
VALUE
rb_time_num_new
(
VALUE
,
VALUE
);
843
struct
timeval
rb_time_interval
(
VALUE
num);
844
struct
timeval
rb_time_timeval
(
VALUE
time);
845
struct
timespec
rb_time_timespec
(
VALUE
time);
846
/* variable.c */
847
VALUE
rb_mod_name
(
VALUE
);
848
VALUE
rb_class_path
(
VALUE
);
849
void
rb_set_class_path
(
VALUE
,
VALUE
,
const
char
*);
850
void
rb_set_class_path_string
(
VALUE
,
VALUE
,
VALUE
);
851
VALUE
rb_path_to_class
(
VALUE
);
852
VALUE
rb_path2class
(
const
char
*);
853
void
rb_name_class
(
VALUE
,
ID
);
854
VALUE
rb_class_name
(
VALUE
);
855
void
rb_autoload
(
VALUE
,
ID
,
const
char
*);
856
VALUE
rb_autoload_load
(
VALUE
,
ID
);
857
VALUE
rb_autoload_p
(
VALUE
,
ID
);
858
void
rb_gc_mark_global_tbl
(
void
);
859
VALUE
rb_f_trace_var
(
int
,
VALUE
*);
860
VALUE
rb_f_untrace_var
(
int
,
VALUE
*);
861
VALUE
rb_f_global_variables
(
void
);
862
void
rb_alias_variable
(
ID
,
ID
);
863
struct
st_table
*
rb_generic_ivar_table
(
VALUE
);
864
void
rb_copy_generic_ivar
(
VALUE
,
VALUE
);
865
void
rb_mark_generic_ivar
(
VALUE
);
866
void
rb_mark_generic_ivar_tbl
(
void
);
867
void
rb_free_generic_ivar
(
VALUE
);
868
VALUE
rb_ivar_get
(
VALUE
,
ID
);
869
VALUE
rb_ivar_set
(
VALUE
,
ID
,
VALUE
);
870
VALUE
rb_ivar_defined
(
VALUE
,
ID
);
871
void
rb_ivar_foreach
(
VALUE
,
int
(*)(
ANYARGS
),
st_data_t
);
872
st_index_t
rb_ivar_count
(
VALUE
);
873
VALUE
rb_iv_set
(
VALUE
,
const
char
*,
VALUE
);
874
VALUE
rb_iv_get
(
VALUE
,
const
char
*);
875
VALUE
rb_attr_get
(
VALUE
,
ID
);
876
VALUE
rb_obj_instance_variables
(
VALUE
);
877
VALUE
rb_obj_remove_instance_variable
(
VALUE
,
VALUE
);
878
void
*
rb_mod_const_at
(
VALUE
,
void
*);
879
void
*
rb_mod_const_of
(
VALUE
,
void
*);
880
VALUE
rb_const_list
(
void
*);
881
VALUE
rb_mod_constants
(
int
,
VALUE
*,
VALUE
);
882
VALUE
rb_mod_remove_const
(
VALUE
,
VALUE
);
883
int
rb_const_defined
(
VALUE
,
ID
);
884
int
rb_const_defined_at
(
VALUE
,
ID
);
885
int
rb_const_defined_from
(
VALUE
,
ID
);
886
VALUE
rb_const_get
(
VALUE
,
ID
);
887
VALUE
rb_const_get_at
(
VALUE
,
ID
);
888
VALUE
rb_const_get_from
(
VALUE
,
ID
);
889
void
rb_const_set
(
VALUE
,
ID
,
VALUE
);
890
VALUE
rb_const_remove
(
VALUE
,
ID
);
891
VALUE
rb_mod_const_missing
(
VALUE
,
VALUE
);
892
VALUE
rb_cvar_defined
(
VALUE
,
ID
);
893
void
rb_cvar_set
(
VALUE
,
ID
,
VALUE
);
894
VALUE
rb_cvar_get
(
VALUE
,
ID
);
895
void
rb_cv_set
(
VALUE
,
const
char
*,
VALUE
);
896
VALUE
rb_cv_get
(
VALUE
,
const
char
*);
897
void
rb_define_class_variable
(
VALUE
,
const
char
*,
VALUE
);
898
VALUE
rb_mod_class_variables
(
VALUE
);
899
VALUE
rb_mod_remove_cvar
(
VALUE
,
VALUE
);
900
/* version.c */
901
void
ruby_show_version
(
void
);
902
void
ruby_show_copyright
(
void
);
903
904
ID
rb_frame_callee
(
void
);
905
VALUE
rb_str_succ
(
VALUE
);
906
VALUE
rb_time_succ
(
VALUE
);
907
void
rb_frame_pop
(
void
);
908
int
rb_frame_method_id_and_class
(
ID
*idp,
VALUE
*klassp);
909
VALUE
rb_make_backtrace
(
void
);
910
VALUE
rb_make_exception
(
int
,
VALUE
*);
911
912
#if defined __GNUC__ && __GNUC__ >= 4
913
#pragma GCC visibility pop
914
#endif
915
916
#if defined(__cplusplus)
917
#if 0
918
{
/* satisfy cc-mode */
919
#endif
920
}
/* extern "C" { */
921
#endif
922
923
#endif
/* RUBY_INTERN_H */
924
Generated on Fri Nov 22 2013 07:04:10 for Ruby by
1.8.3