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