Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 152 lines (128 sloc) 4.347 kb
7a4fd1b start cleaning up the public header files
Laurent Sansonetti authored
1 /*
2 * This file is covered by the Ruby license. See COPYING for more details.
3 *
9595725 update copyrights to 2011
Laurent Sansonetti authored
4 * Copyright (C) 2007-2011, Apple Inc. All rights reserved
7a4fd1b start cleaning up the public header files
Laurent Sansonetti authored
5 */
468a2ea Move Obj-C related headers around.
Thibault Martin-Lagardette authored
6
d0898dd include/ruby/macruby.h -> macruby_internal.h
Laurent Sansonetti authored
7 #ifndef __MACRUBY_INTERNAL_H
8 #define __MACRUBY_INTERNAL_H 1
468a2ea Move Obj-C related headers around.
Thibault Martin-Lagardette authored
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);
a6b0db5 Watson add a rb_objc_retain_count() for debug.
Watson1978 authored
34 unsigned int auto_zone_retain_count(void *zone, const void *ptr);
468a2ea Move Obj-C related headers around.
Thibault Martin-Lagardette authored
35 extern void *__auto_zone;
36 #else
37 extern auto_zone_t *__auto_zone;
38 #endif
39
29e274f when compiling write barriers, don't assert that the slot must be in the...
Laurent Sansonetti authored
40 #define GC_WB_0(dst, newval, check) \
468a2ea Move Obj-C related headers around.
Thibault Martin-Lagardette authored
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)) { \
29e274f when compiling write barriers, don't assert that the slot must be in the...
Laurent Sansonetti authored
46 if (check) { \
47 rb_bug("destination %p isn't in the auto zone", dst); \
48 } \
468a2ea Move Obj-C related headers around.
Thibault Martin-Lagardette authored
49 } \
50 } \
51 *(void **)dst = nv; \
52 } \
53 while (0)
54
29e274f when compiling write barriers, don't assert that the slot must be in the...
Laurent Sansonetti authored
55 #define GC_WB(dst, newval) GC_WB_0(dst, newval, true)
56
468a2ea Move Obj-C related headers around.
Thibault Martin-Lagardette authored
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
a6b0db5 Watson add a rb_objc_retain_count() for debug.
Watson1978 authored
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
468a2ea Move Obj-C related headers around.
Thibault Martin-Lagardette authored
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 *);
7a4fd1b start cleaning up the public header files
Laurent Sansonetti authored
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 } \
468a2ea Move Obj-C related headers around.
Thibault Martin-Lagardette authored
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);
24f19e3 Watson rb_num_coerce_relop() was renamed the rb_objc_num_coerce_relop(). And, a...
Watson1978 authored
116 VALUE rb_objc_num_coerce_relop(VALUE, VALUE, SEL sel);
468a2ea Move Obj-C related headers around.
Thibault Martin-Lagardette authored
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
6130312 move the macruby-only classes to macruby.h
Laurent Sansonetti authored
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
7a4fd1b start cleaning up the public header files
Laurent Sansonetti authored
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
468a2ea Move Obj-C related headers around.
Thibault Martin-Lagardette authored
147 #if defined(__cplusplus)
7a4fd1b start cleaning up the public header files
Laurent Sansonetti authored
148 } // extern "C" {
468a2ea Move Obj-C related headers around.
Thibault Martin-Lagardette authored
149 #endif
150
d0898dd include/ruby/macruby.h -> macruby_internal.h
Laurent Sansonetti authored
151 #endif /* __MACRUBY_INTERNAL_H */
Something went wrong with that request. Please try again.