Skip to content
This repository
Newer
Older
100644 151 lines (128 sloc) 4.347 kb
7a4fd1b4 » Laurent Sansonetti
2011-01-08 start cleaning up the public header files
1 /*
2 * This file is covered by the Ruby license. See COPYING for more details.
3 *
95957256 » Laurent Sansonetti
2011-01-15 update copyrights to 2011
4 * Copyright (C) 2007-2011, Apple Inc. All rights reserved
7a4fd1b4 » Laurent Sansonetti
2011-01-08 start cleaning up the public header files
5 */
468a2ea9 » Thibault Martin-Lagardette
2010-07-08 Move Obj-C related headers around.
6
d0898dd2 » Laurent Sansonetti
2011-01-08 include/ruby/macruby.h -> macruby_internal.h
7 #ifndef __MACRUBY_INTERNAL_H
8 #define __MACRUBY_INTERNAL_H 1
468a2ea9 » Thibault Martin-Lagardette
2010-07-08 Move Obj-C related headers around.
9
10 #if defined(__cplusplus)
11 extern "C" {
12 #endif
13
14 #include "ruby.h"
15
16 #include <objc/objc.h>
17 #include <objc/runtime.h>
18 #include <objc/message.h>
19 #include <objc/objc-auto.h>
20 #include <assert.h>
21 #include <CoreFoundation/CoreFoundation.h>
22
23 void rb_include_module2(VALUE klass, VALUE orig_klass, VALUE module, bool check,
24 bool add_methods);
25
26 VALUE rb_objc_block_call(VALUE obj, SEL sel, int argc,
27 VALUE *argv, VALUE (*bl_proc) (ANYARGS), VALUE data2);
28
29 #if !defined(__AUTO_ZONE__)
30 boolean_t auto_zone_set_write_barrier(void *zone, const void *dest, const void *new_value);
31 void auto_zone_add_root(void *zone, void *address_of_root_ptr, void *value);
32 void auto_zone_retain(void *zone, void *ptr);
33 unsigned int auto_zone_release(void *zone, void *ptr);
a6b0db5d » Watson1978
2011-05-27 add a rb_objc_retain_count() for debug.
34 unsigned int auto_zone_retain_count(void *zone, const void *ptr);
468a2ea9 » Thibault Martin-Lagardette
2010-07-08 Move Obj-C related headers around.
35 extern void *__auto_zone;
36 #else
37 extern auto_zone_t *__auto_zone;
38 #endif
39
29e274fc » Laurent Sansonetti
2010-09-27 when compiling write barriers, don't assert that the slot must be in …
40 #define GC_WB_0(dst, newval, check) \
468a2ea9 » Thibault Martin-Lagardette
2010-07-08 Move Obj-C related headers around.
41 do { \
42 void *nv = (void *)newval; \
43 if (!SPECIAL_CONST_P(nv)) { \
44 if (!auto_zone_set_write_barrier(__auto_zone, \
45 (const void *)dst, (const void *)nv)) { \
29e274fc » Laurent Sansonetti
2010-09-27 when compiling write barriers, don't assert that the slot must be in …
46 if (check) { \
47 rb_bug("destination %p isn't in the auto zone", dst); \
48 } \
468a2ea9 » Thibault Martin-Lagardette
2010-07-08 Move Obj-C related headers around.
49 } \
50 } \
51 *(void **)dst = nv; \
52 } \
53 while (0)
54
29e274fc » Laurent Sansonetti
2010-09-27 when compiling write barriers, don't assert that the slot must be in …
55 #define GC_WB(dst, newval) GC_WB_0(dst, newval, true)
56
468a2ea9 » Thibault Martin-Lagardette
2010-07-08 Move Obj-C related headers around.
57 static inline void *
58 rb_objc_retain(void *addr)
59 {
60 if (addr != NULL && !SPECIAL_CONST_P(addr)) {
61 auto_zone_retain(__auto_zone, addr);
62 }
63 return addr;
64 }
65 #define GC_RETAIN(obj) (rb_objc_retain((void *)obj))
66
a6b0db5d » Watson1978
2011-05-27 add a rb_objc_retain_count() for debug.
67 static inline unsigned int
68 rb_objc_retain_count(const void *addr)
69 {
70 return auto_zone_retain_count(__auto_zone, addr);
71 }
72 #define GC_RETAIN_COUNT(obj) (rb_objc_retain_count((const void *)obj))
73
468a2ea9 » Thibault Martin-Lagardette
2010-07-08 Move Obj-C related headers around.
74 static inline void *
75 rb_objc_release(void *addr)
76 {
77 if (addr != NULL && !SPECIAL_CONST_P(addr)) {
78 auto_zone_release(__auto_zone, addr);
79 }
80 return addr;
81 }
82 #define GC_RELEASE(obj) (rb_objc_release((void *)obj))
83
84 // MacRubyIntern.h
85
86 /* enumerator.c */
87 VALUE rb_enumeratorize(VALUE, SEL, int, VALUE *);
7a4fd1b4 » Laurent Sansonetti
2011-01-08 start cleaning up the public header files
88 #define RETURN_ENUMERATOR(obj, argc, argv) \
89 do { \
90 if (!rb_block_given_p()) { \
91 return rb_enumeratorize((VALUE)obj, sel, argc, argv); \
92 } \
468a2ea9 » Thibault Martin-Lagardette
2010-07-08 Move Obj-C related headers around.
93 } while (0)
94 VALUE rb_f_notimplement(VALUE rcv, SEL sel);
95 VALUE rb_method_call(VALUE, SEL, int, VALUE*);
96 VALUE rb_file_directory_p(VALUE,SEL,VALUE);
97 VALUE rb_obj_id(VALUE obj, SEL sel);
98
99 void rb_objc_gc_register_thread(void);
100 void rb_objc_gc_unregister_thread(void);
101 void rb_objc_set_associative_ref(void *, void *, void *);
102 void *rb_objc_get_associative_ref(void *, void *);
103
104 VALUE rb_io_gets(VALUE, SEL);
105 VALUE rb_io_getbyte(VALUE, SEL);
106 VALUE rb_io_ungetc(VALUE, SEL, VALUE);
107 VALUE rb_io_flush(VALUE, SEL);
108 VALUE rb_io_eof(VALUE, SEL);
109 VALUE rb_io_binmode(VALUE, SEL);
110 VALUE rb_io_addstr(VALUE, SEL, VALUE);
111 VALUE rb_io_printf(VALUE, SEL, int, VALUE *);
112 VALUE rb_io_print(VALUE, SEL, int, VALUE *);
113
114 VALUE rb_objc_num_coerce_bin(VALUE x, VALUE Y, SEL sel);
115 VALUE rb_objc_num_coerce_cmp(VALUE, VALUE, SEL sel);
24f19e33 » Watson1978
2010-10-29 rb_num_coerce_relop() was renamed the rb_objc_num_coerce_relop(). And…
116 VALUE rb_objc_num_coerce_relop(VALUE, VALUE, SEL sel);
468a2ea9 » Thibault Martin-Lagardette
2010-07-08 Move Obj-C related headers around.
117
118 VALUE rb_f_kill(VALUE, SEL, int, VALUE*);
119 VALUE rb_struct_initialize(VALUE, SEL, VALUE);
120 VALUE rb_class_real(VALUE, bool hide_builtin_foundation_classes);
121 void rb_range_extract(VALUE range, VALUE *begp, VALUE *endp, bool *exclude);
122 VALUE rb_cvar_get2(VALUE klass, ID id, bool check);
123
124 VALUE rb_require_framework(VALUE, SEL, int, VALUE *);
125
61303125 » Laurent Sansonetti
2011-01-07 move the macruby-only classes to macruby.h
126 RUBY_EXTERN VALUE rb_cNSObject;
127 RUBY_EXTERN VALUE rb_cRubyObject;
128 RUBY_EXTERN VALUE rb_cNSString;
129 RUBY_EXTERN VALUE rb_cNSMutableString;
130 RUBY_EXTERN VALUE rb_cRubyString;
131 RUBY_EXTERN VALUE rb_cNSArray;
132 RUBY_EXTERN VALUE rb_cNSMutableArray;
133 RUBY_EXTERN VALUE rb_cRubyArray;
134 RUBY_EXTERN VALUE rb_cNSHash;
135 RUBY_EXTERN VALUE rb_cNSMutableHash;
136 RUBY_EXTERN VALUE rb_cRubyHash;
137 RUBY_EXTERN VALUE rb_cNSNumber;
138 RUBY_EXTERN VALUE rb_cNSDate;
139 RUBY_EXTERN VALUE rb_cBoxed;
140 RUBY_EXTERN VALUE rb_cPointer;
141 RUBY_EXTERN VALUE rb_cTopLevel;
142
7a4fd1b4 » Laurent Sansonetti
2011-01-08 start cleaning up the public header files
143 long rb_objc_flag_get_mask(const void *);
144 void rb_objc_flag_set(const void *, int, bool);
145 bool rb_objc_flag_check(const void *, int);
146
468a2ea9 » Thibault Martin-Lagardette
2010-07-08 Move Obj-C related headers around.
147 #if defined(__cplusplus)
7a4fd1b4 » Laurent Sansonetti
2011-01-08 start cleaning up the public header files
148 } // extern "C" {
468a2ea9 » Thibault Martin-Lagardette
2010-07-08 Move Obj-C related headers around.
149 #endif
150
d0898dd2 » Laurent Sansonetti
2011-01-08 include/ruby/macruby.h -> macruby_internal.h
151 #endif /* __MACRUBY_INTERNAL_H */
Something went wrong with that request. Please try again.