Ruby  1.9.3p551(2014-11-13revision48407)
internal.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  internal.h -
4 
5  $Author$
6  created at: Tue May 17 11:42:20 JST 2011
7 
8  Copyright (C) 2011 Yukihiro Matsumoto
9 
10 **********************************************************************/
11 
12 #ifndef RUBY_INTERNAL_H
13 #define RUBY_INTERNAL_H 1
14 
15 #if defined(__cplusplus)
16 extern "C" {
17 #if 0
18 } /* satisfy cc-mode */
19 #endif
20 #endif
21 
23  char conflict[sizeof(VALUE) * 3];
24 };
25 
26 struct rb_classext_struct {
27  VALUE super;
28  struct st_table *iv_tbl;
29  struct st_table *const_tbl;
30 };
31 
32 #undef RCLASS_SUPER
33 #define RCLASS_EXT(c) (RCLASS(c)->ptr)
34 #define RCLASS_SUPER(c) (RCLASS_EXT(c)->super)
35 #define RCLASS_IV_TBL(c) (RCLASS_EXT(c)->iv_tbl)
36 #define RCLASS_CONST_TBL(c) (RCLASS_EXT(c)->const_tbl)
37 #define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl)
38 #define RCLASS_IV_INDEX_TBL(c) (RCLASS(c)->iv_index_tbl)
39 
40 struct vtm; /* defined by timev.h */
41 
42 /* array.c */
43 VALUE rb_ary_last(int, VALUE *, VALUE);
44 
45 /* bignum.c */
48 
49 /* class.c */
55 void Init_class_hierarchy(void);
56 
57 /* compile.c */
58 int rb_dvar_defined(ID);
59 int rb_local_defined(ID);
60 int rb_parse_in_eval(void);
61 int rb_parse_in_main(void);
63 
64 /* cont.c */
67 
68 /* debug.c */
69 PRINTF_ARGS(void ruby_debug_printf(const char*, ...), 1, 2);
70 
71 /* dmyext.c */
72 void Init_ext(void);
73 
74 /* encoding.c */
75 ID rb_id_encoding(void);
76 
77 /* encoding.c */
78 void rb_gc_mark_encodings(void);
79 
80 /* error.c */
81 NORETURN(PRINTF_ARGS(void rb_compile_bug(const char*, int, const char*, ...), 3, 4));
83 NORETURN(void rb_async_bug_errno(const char *,int));
84 
85 /* eval_error.c */
86 void ruby_error_print(void);
88 
89 /* eval_jump.c */
90 void rb_call_end_proc(VALUE data);
91 
92 /* file.c */
93 VALUE rb_home_dir(const char *user, VALUE result);
94 VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict);
97 void Init_File(void);
98 
99 #ifdef _WIN32
100 /* file.c, win32/file.c */
101 void rb_w32_init_file(void);
102 #endif
103 
104 /* gc.c */
105 void Init_heap(void);
106 
107 /* inits.c */
108 void rb_call_inits(void);
109 
110 /* io.c */
111 const char *ruby_get_inplace_mode(void);
112 void ruby_set_inplace_mode(const char *);
113 ssize_t rb_io_bufread(VALUE io, void *buf, size_t size);
115 
116 /* iseq.c */
117 VALUE rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE filepath, VALUE line, VALUE opt);
118 VALUE rb_iseq_clone(VALUE iseqval, VALUE newcbase);
119 
120 /* load.c */
121 VALUE rb_get_load_path(void);
122 
123 /* math.c */
133 
134 /* newline.c */
135 void Init_newline(void);
136 
137 /* numeric.c */
138 int rb_num_to_uint(VALUE val, unsigned int *ret);
139 int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl);
140 double ruby_float_mod(double x, double y);
141 VALUE rb_int_succ(VALUE num);
142 VALUE rb_int_pred(VALUE num);
143 
144 /* object.c */
145 VALUE rb_obj_equal(VALUE obj1, VALUE obj2);
146 
147 /* parse.y */
150 
151 /* proc.c */
153 
154 /* rational.c */
155 VALUE rb_lcm(VALUE x, VALUE y);
157 
158 /* re.c */
159 VALUE rb_reg_compile(VALUE str, int options, const char *sourcefile, int sourceline);
161 
162 /* signal.c */
163 int rb_get_next_signal(void);
164 
165 /* strftime.c */
166 size_t rb_strftime_timespec(char *s, size_t maxsize, const char *format, const struct vtm *vtm, struct timespec *ts, int gmt);
167 
168 /* string.c */
169 int rb_str_buf_cat_escaped_char(VALUE result, unsigned int c, int unicode_p);
171 
172 /* struct.c */
174 
175 /* time.c */
177 
178 /* thread.c */
180 VALUE ruby_suppress_tracing(VALUE (*func)(VALUE, int), VALUE arg, int always);
182 void rb_clear_trace_func(void);
184 VALUE rb_get_coverages(void);
185 
186 /* thread_pthread.c, thread_win32.c */
187 void Init_native_thread(void);
188 
189 /* vm.c */
191 void rb_vm_mark(void *ptr);
192 void Init_BareVM(void);
193 VALUE rb_vm_top_self(void);
195 void rb_vm_change_state(void);
197 void rb_thread_mark(void *th);
198 const void **rb_vm_get_insns_address_table(void);
199 
200 /* vm_dump.c */
201 void rb_vm_bugreport(void);
202 
203 /* vm_eval.c */
204 void Init_vm_eval(void);
206 
207 /* vm_method.c */
208 void Init_eval_method(void);
209 
210 /* miniprelude.c, prelude.c */
211 void Init_prelude(void);
212 
213 #if defined __GNUC__ && __GNUC__ >= 4
214 #pragma GCC visibility push(default)
215 #endif
216 const char *rb_objspace_data_type_name(VALUE obj);
217 
218 /* Temporary. This API will be removed (renamed). */
220 
221 /* experimental.
222  * These APIs can be changed on Ruby 1.9.4 or later.
223  * We will change these APIs (spac, name and so on) if there are something wrong.
224  * If you use these APIs, catch up future changes.
225  */
226 void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
228  rb_blocking_function_t *func, void *data1,
229  rb_unblock_function_t *ubf, void *data2);
230 
231 #if defined __GNUC__ && __GNUC__ >= 4
232 #pragma GCC visibility pop
233 #endif
234 
235 #if defined(__cplusplus)
236 #if 0
237 { /* satisfy cc-mode */
238 #endif
239 } /* extern "C" { */
240 #endif
241 
242 #endif /* RUBY_INTERNAL_H */
243