Ruby  1.9.3p392(2013-02-22revision39386)
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 
142 /* object.c */
143 VALUE rb_obj_equal(VALUE obj1, VALUE obj2);
144 
145 /* parse.y */
148 
149 /* proc.c */
151 
152 /* rational.c */
153 VALUE rb_lcm(VALUE x, VALUE y);
155 
156 /* re.c */
157 VALUE rb_reg_compile(VALUE str, int options, const char *sourcefile, int sourceline);
159 
160 /* signal.c */
161 int rb_get_next_signal(void);
162 
163 /* strftime.c */
164 size_t rb_strftime_timespec(char *s, size_t maxsize, const char *format, const struct vtm *vtm, struct timespec *ts, int gmt);
165 
166 /* string.c */
167 int rb_str_buf_cat_escaped_char(VALUE result, unsigned int c, int unicode_p);
168 
169 /* struct.c */
171 
172 /* time.c */
174 
175 /* thread.c */
177 VALUE ruby_suppress_tracing(VALUE (*func)(VALUE, int), VALUE arg, int always);
179 void rb_clear_trace_func(void);
181 VALUE rb_get_coverages(void);
182 
183 /* thread_pthread.c, thread_win32.c */
184 void Init_native_thread(void);
185 
186 /* vm.c */
188 void rb_vm_mark(void *ptr);
189 void Init_BareVM(void);
190 VALUE rb_vm_top_self(void);
192 void rb_vm_change_state(void);
194 void rb_thread_mark(void *th);
195 const void **rb_vm_get_insns_address_table(void);
196 
197 /* vm_dump.c */
198 void rb_vm_bugreport(void);
199 
200 /* vm_eval.c */
201 void Init_vm_eval(void);
203 
204 /* vm_method.c */
205 void Init_eval_method(void);
206 
207 /* miniprelude.c, prelude.c */
208 void Init_prelude(void);
209 
210 #if defined __GNUC__ && __GNUC__ >= 4
211 #pragma GCC visibility push(default)
212 #endif
213 const char *rb_objspace_data_type_name(VALUE obj);
214 
215 /* Temporary. This API will be removed (renamed). */
217 
218 /* experimental.
219  * These APIs can be changed on Ruby 1.9.4 or later.
220  * We will change these APIs (spac, name and so on) if there are something wrong.
221  * If you use these APIs, catch up future changes.
222  */
223 void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
225  rb_blocking_function_t *func, void *data1,
226  rb_unblock_function_t *ubf, void *data2);
227 
228 #if defined __GNUC__ && __GNUC__ >= 4
229 #pragma GCC visibility pop
230 #endif
231 
232 #if defined(__cplusplus)
233 #if 0
234 { /* satisfy cc-mode */
235 #endif
236 } /* extern "C" { */
237 #endif
238 
239 #endif /* RUBY_INTERNAL_H */
240