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