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