Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 144 lines (121 sloc) 4.085 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);
34 extern void *__auto_zone;
35 #else
36 extern auto_zone_t *__auto_zone;
37 #endif
38
29e274f when compiling write barriers, don't assert that the slot must be in …
Laurent Sansonetti authored
39 #define GC_WB_0(dst, newval, check) \
468a2ea Move Obj-C related headers around.
Thibault Martin-Lagardette authored
40 do { \
41 void *nv = (void *)newval; \
42 if (!SPECIAL_CONST_P(nv)) { \
43 if (!auto_zone_set_write_barrier(__auto_zone, \
44 (const void *)dst, (const void *)nv)) { \
29e274f when compiling write barriers, don't assert that the slot must be in …
Laurent Sansonetti authored
45 if (check) { \
46 rb_bug("destination %p isn't in the auto zone", dst); \
47 } \
468a2ea Move Obj-C related headers around.
Thibault Martin-Lagardette authored
48 } \
49 } \
50 *(void **)dst = nv; \
51 } \
52 while (0)
53
29e274f when compiling write barriers, don't assert that the slot must be in …
Laurent Sansonetti authored
54 #define GC_WB(dst, newval) GC_WB_0(dst, newval, true)
55
468a2ea Move Obj-C related headers around.
Thibault Martin-Lagardette authored
56 static inline void *
57 rb_objc_retain(void *addr)
58 {
59 if (addr != NULL && !SPECIAL_CONST_P(addr)) {
60 auto_zone_retain(__auto_zone, addr);
61 }
62 return addr;
63 }
64 #define GC_RETAIN(obj) (rb_objc_retain((void *)obj))
65
66 static inline void *
67 rb_objc_release(void *addr)
68 {
69 if (addr != NULL && !SPECIAL_CONST_P(addr)) {
70 auto_zone_release(__auto_zone, addr);
71 }
72 return addr;
73 }
74 #define GC_RELEASE(obj) (rb_objc_release((void *)obj))
75
76 // MacRubyIntern.h
77
78 /* enumerator.c */
79 VALUE rb_enumeratorize(VALUE, SEL, int, VALUE *);
7a4fd1b start cleaning up the public header files
Laurent Sansonetti authored
80 #define RETURN_ENUMERATOR(obj, argc, argv) \
81 do { \
82 if (!rb_block_given_p()) { \
83 return rb_enumeratorize((VALUE)obj, sel, argc, argv); \
84 } \
468a2ea Move Obj-C related headers around.
Thibault Martin-Lagardette authored
85 } while (0)
86 VALUE rb_f_notimplement(VALUE rcv, SEL sel);
87 VALUE rb_method_call(VALUE, SEL, int, VALUE*);
88 VALUE rb_file_directory_p(VALUE,SEL,VALUE);
89 VALUE rb_obj_id(VALUE obj, SEL sel);
90
91 void rb_objc_gc_register_thread(void);
92 void rb_objc_gc_unregister_thread(void);
93 void rb_objc_set_associative_ref(void *, void *, void *);
94 void *rb_objc_get_associative_ref(void *, void *);
95
96 VALUE rb_io_gets(VALUE, SEL);
97 VALUE rb_io_getbyte(VALUE, SEL);
98 VALUE rb_io_ungetc(VALUE, SEL, VALUE);
99 VALUE rb_io_flush(VALUE, SEL);
100 VALUE rb_io_eof(VALUE, SEL);
101 VALUE rb_io_binmode(VALUE, SEL);
102 VALUE rb_io_addstr(VALUE, SEL, VALUE);
103 VALUE rb_io_printf(VALUE, SEL, int, VALUE *);
104 VALUE rb_io_print(VALUE, SEL, int, VALUE *);
105
106 VALUE rb_objc_num_coerce_bin(VALUE x, VALUE Y, SEL sel);
107 VALUE rb_objc_num_coerce_cmp(VALUE, VALUE, SEL sel);
24f19e3 @Watson1978 rb_num_coerce_relop() was renamed the rb_objc_num_coerce_relop(). And…
Watson1978 authored
108 VALUE rb_objc_num_coerce_relop(VALUE, VALUE, SEL sel);
468a2ea Move Obj-C related headers around.
Thibault Martin-Lagardette authored
109
110 VALUE rb_f_kill(VALUE, SEL, int, VALUE*);
111 VALUE rb_struct_initialize(VALUE, SEL, VALUE);
112 VALUE rb_class_real(VALUE, bool hide_builtin_foundation_classes);
113 void rb_range_extract(VALUE range, VALUE *begp, VALUE *endp, bool *exclude);
114 VALUE rb_cvar_get2(VALUE klass, ID id, bool check);
115
116 VALUE rb_require_framework(VALUE, SEL, int, VALUE *);
117
6130312 move the macruby-only classes to macruby.h
Laurent Sansonetti authored
118 RUBY_EXTERN VALUE rb_cNSObject;
119 RUBY_EXTERN VALUE rb_cRubyObject;
120 RUBY_EXTERN VALUE rb_cNSString;
121 RUBY_EXTERN VALUE rb_cNSMutableString;
122 RUBY_EXTERN VALUE rb_cRubyString;
123 RUBY_EXTERN VALUE rb_cNSArray;
124 RUBY_EXTERN VALUE rb_cNSMutableArray;
125 RUBY_EXTERN VALUE rb_cRubyArray;
126 RUBY_EXTERN VALUE rb_cNSHash;
127 RUBY_EXTERN VALUE rb_cNSMutableHash;
128 RUBY_EXTERN VALUE rb_cRubyHash;
129 RUBY_EXTERN VALUE rb_cNSNumber;
130 RUBY_EXTERN VALUE rb_cNSDate;
131 RUBY_EXTERN VALUE rb_cBoxed;
132 RUBY_EXTERN VALUE rb_cPointer;
133 RUBY_EXTERN VALUE rb_cTopLevel;
134
7a4fd1b start cleaning up the public header files
Laurent Sansonetti authored
135 long rb_objc_flag_get_mask(const void *);
136 void rb_objc_flag_set(const void *, int, bool);
137 bool rb_objc_flag_check(const void *, int);
138
468a2ea Move Obj-C related headers around.
Thibault Martin-Lagardette authored
139 #if defined(__cplusplus)
7a4fd1b start cleaning up the public header files
Laurent Sansonetti authored
140 } // extern "C" {
468a2ea Move Obj-C related headers around.
Thibault Martin-Lagardette authored
141 #endif
142
d0898dd include/ruby/macruby.h -> macruby_internal.h
Laurent Sansonetti authored
143 #endif /* __MACRUBY_INTERNAL_H */
Something went wrong with that request. Please try again.