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