/[eiffelstudio]/branches/eth/eve/Src/C/run-time/eif_built_in.h
ViewVC logotype

Contents of /branches/eth/eve/Src/C/run-time/eif_built_in.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 88379 - (show annotations)
Fri Mar 9 09:40:16 2012 UTC (7 years, 7 months ago) by jasonw
File MIME type: text/plain
File size: 11085 byte(s)
<<Merged from trunk#88377.>>
1 /*
2 description: "Declarations for `built_in' externals."
3 date: "$Date$"
4 revision: "$Revision$"
5 copyright: "Copyright (c) 1985-2008, Eiffel Software."
6 license: "GPL version 2 see http://www.eiffel.com/licensing/gpl.txt)"
7 licensing_options: "Commercial license is available at http://www.eiffel.com/licensing"
8 copying: "[
9 This file is part of Eiffel Software's Runtime.
10
11 Eiffel Software's Runtime is free software; you can
12 redistribute it and/or modify it under the terms of the
13 GNU General Public License as published by the Free
14 Software Foundation, version 2 of the License
15 (available at the URL listed under "license" above).
16
17 Eiffel Software's Runtime is distributed in the hope
18 that it will be useful, but WITHOUT ANY WARRANTY;
19 without even the implied warranty of MERCHANTABILITY
20 or FITNESS FOR A PARTICULAR PURPOSE.
21 See the GNU General Public License for more details.
22
23 You should have received a copy of the GNU General Public
24 License along with Eiffel Software's Runtime; if not,
25 write to the Free Software Foundation, Inc.,
26 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27 ]"
28 source: "[
29 Eiffel Software
30 356 Storke Road, Goleta, CA 93117 USA
31 Telephone 805-685-1006, Fax 805-685-6869
32 Website http://www.eiffel.com
33 Customer support http://support.eiffel.com
34 ]"
35 */
36
37 #ifndef _eif_built_in_h
38 #define _eif_built_in_h
39 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
40 #pragma once
41 #endif
42
43 #include "eif_eiffel.h"
44 #include "eif_misc.h"
45 #include "eif_helpers.h"
46 #include "eif_argv.h"
47 #include "eif_internal.h"
48 #include "eif_gen_conf.h"
49 #include "eif_object_id.h"
50 #include "eif_traverse.h"
51 #include "eif_macros.h"
52
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56
57 /* ANY class */
58 #define eif_builtin_ANY_generator(object) c_generator ((object))
59 #define eif_builtin_ANY_generating_type(object) eif_gen_typename ((object))
60 #define eif_builtin_ANY_conforms_to(source, target) econfg ((target), (source))
61 #define eif_builtin_ANY_same_type(obj1, obj2) estypeg ((obj1), (obj2))
62 #define eif_builtin_ANY_tagged_out(object) c_tagged_out ((object))
63 #define eif_builtin_ANY_copy(target, source) ecopy ((source), (target))
64 #define eif_builtin_ANY_standard_copy(target, source) ecopy ((source), (target))
65 #define eif_builtin_ANY_twin(object) eif_twin (object)
66 #define eif_builtin_ANY_standard_twin(object) eif_standard_twin (object)
67 #define eif_builtin_ANY_is_deep_equal(some, other) ediso ((some), (other))
68 #define eif_builtin_ANY_is_equal(some, other) eequal ((some), (other))
69 #define eif_builtin_ANY_standard_is_equal(some, other) eequal ((some), (other))
70 #define eif_builtin_ANY_deep_twin(object) edclone ((object))
71
72 /* ARGUMENTS class */
73 #define eif_builtin_ARGUMENTS_argument(some,i) arg_option(i)
74 #define eif_builtin_ARGUMENTS_argument_count(some) (arg_number() - 1)
75
76 /* EV_ANY_IMP class */
77 #define eif_builtin_EV_ANY_IMP_eif_current_object_id(object) eif_reference_id(object)
78 #define eif_builtin_EV_ANY_IMP_eif_is_object_id_of_current(object,id) EIF_TEST(eif_id_object(id) == object)
79
80 /* EXCEPTION_MANAGER class */
81 #define eif_builtin_ISE_EXCEPTION_MANAGER_developer_raise(object, code, meaning, message) draise(code, meaning, message)
82
83 /* IDENTIFIED_CONTROLLER class */
84 #define eif_builtin_IDENTIFIED_CONTROLLER_object_id_stack_size(obj) eif_object_id_stack_size();
85 #define eif_builtin_IDENTIFIED_CONTROLLER_extend_object_id_stack(obj,nb) eif_extend_object_id_stack(nb);
86
87 /* IDENTIFIED_ROUTINES class */
88 #define eif_builtin_IDENTIFIED_ROUTINES_eif_current_object_id(object) eif_reference_id(object)
89 #define eif_builtin_IDENTIFIED_ROUTINES_eif_is_object_id_of_current(object,id) EIF_TEST(eif_id_object(id) == object)
90
91 /* INTERNAL class */
92 #define eif_builtin_INTERNAL_c_is_instance_of(dftype,obj) RTRA(dftype,obj)
93 #define eif_builtin_INTERNAL_c_field(i,obj) ei_field(i,obj)
94 #define eif_builtin_INTERNAL_c_expanded_type(i,obj) ei_exp_type(i,obj)
95 #define eif_builtin_INTERNAL_c_character_8_field(i,obj) ei_char_field(i,obj)
96 #define eif_builtin_INTERNAL_c_character_32_field(i,obj) ei_char_32_field(i,obj)
97 #define eif_builtin_INTERNAL_c_boolean_field(i,obj) ei_bool_field(i,obj)
98 #define eif_builtin_INTERNAL_c_natural_8_field(i,obj) ei_uint_8_field(i,obj)
99 #define eif_builtin_INTERNAL_c_natural_16_field(i,obj) ei_uint_16_field(i,obj)
100 #define eif_builtin_INTERNAL_c_natural_32_field(i,obj) ei_uint_32_field(i,obj)
101 #define eif_builtin_INTERNAL_c_natural_64_field(i,obj) ei_uint_64_field(i,obj)
102 #define eif_builtin_INTERNAL_c_integer_8_field(i,obj) ei_int_8_field(i,obj)
103 #define eif_builtin_INTERNAL_c_integer_16_field(i,obj) ei_int_16_field(i,obj)
104 #define eif_builtin_INTERNAL_c_integer_32_field(i,obj) ei_int_32_field(i,obj)
105 #define eif_builtin_INTERNAL_c_integer_64_field(i,obj) ei_int_64_field(i,obj)
106 #define eif_builtin_INTERNAL_c_real_32_field(i,obj) ei_float_field(i,obj)
107 #define eif_builtin_INTERNAL_c_real_64_field(i,obj) ei_double_field(i,obj)
108 #define eif_builtin_INTERNAL_c_pointer_field(i,obj) ei_ptr_field(i,obj)
109 #define eif_builtin_INTERNAL_c_is_special(obj) ei_special(obj)
110 #define eif_builtin_INTERNAL_c_is_tuple(obj) ei_tuple(obj)
111 #define eif_builtin_INTERNAL_c_field_offset(i,obj) ei_offset(i,obj)
112 #define eif_builtin_INTERNAL_c_bit_size(i,obj) ei_bit_size(i,obj)
113 #define eif_builtin_INTERNAL_c_size(obj) ei_size(obj)
114 #define eif_builtin_INTERNAL_c_set_reference_field(i,obj,val) ei_set_reference_field(i,obj,val)
115 #define eif_builtin_INTERNAL_c_set_character_8_field(i,obj,val) ei_set_char_field(i,obj,val)
116 #define eif_builtin_INTERNAL_c_set_character_32_field(i,obj,val) ei_set_char_32_field(i,obj,val)
117 #define eif_builtin_INTERNAL_c_set_boolean_field(i,obj,val) ei_set_boolean_field(i,obj,val)
118 #define eif_builtin_INTERNAL_c_set_natural_8_field(i,obj,val) ei_set_natural_8_field(i,obj,val)
119 #define eif_builtin_INTERNAL_c_set_natural_16_field(i,obj,val) ei_set_natural_16_field(i,obj,val)
120 #define eif_builtin_INTERNAL_c_set_natural_32_field(i,obj,val) ei_set_natural_32_field(i,obj,val)
121 #define eif_builtin_INTERNAL_c_set_natural_64_field(i,obj,val) ei_set_natural_64_field(i,obj,val)
122 #define eif_builtin_INTERNAL_c_set_integer_8_field(i,obj,val) ei_set_integer_8_field(i,obj,val)
123 #define eif_builtin_INTERNAL_c_set_integer_16_field(i,obj,val) ei_set_integer_16_field(i,obj,val)
124 #define eif_builtin_INTERNAL_c_set_integer_32_field(i,obj,val) ei_set_integer_32_field(i,obj,val)
125 #define eif_builtin_INTERNAL_c_set_integer_64_field(i,obj,val) ei_set_integer_64_field(i,obj,val)
126 #define eif_builtin_INTERNAL_c_set_real_32_field(i,obj,val) ei_set_float_field(i,obj,val)
127 #define eif_builtin_INTERNAL_c_set_real_64_field(i,obj,val) ei_set_double_field(i,obj,val)
128 #define eif_builtin_INTERNAL_c_set_pointer_field(i,obj,val) ei_set_pointer_field(i,obj,val)
129 #define eif_builtin_INTERNAL_c_set_dynamic_type(obj,dftype) eif_set_dynamic_type(obj,dftype)
130 #define eif_builtin_INTERNAL_c_mark(obj) ei_mark(obj)
131 #define eif_builtin_INTERNAL_c_unmark(obj) ei_unmark(obj)
132 #define eif_builtin_INTERNAL_c_is_marked(obj) ei_is_marked(obj)
133
134 /* ISE_RUNTIME class */
135 #define eif_builtin_ISE_RUNTIME_dynamic_type(obj) Dftype(obj)
136
137 /* MEMORY class */
138 #define eif_builtin_MEMORY_free(obj) eif_mem_free(obj)
139 #define eif_builtin_MEMORY_find_referers(obj,dftype) find_referers(obj,dftype)
140
141 /* PLATFORM class */
142 #define eif_builtin_PLATFORM_is_vms EIF_IS_VMS
143 #ifdef EIF_IL_DLL
144 #define eif_builtin_PLATFORM_is_thread_capable EIF_TRUE
145 #else
146 #define eif_builtin_PLATFORM_is_thread_capable EIF_THREADS_SUPPORTED
147 #endif
148 #define eif_builtin_PLATFORM_is_scoop_capable EIF_TEST(egc_is_scoop_capable==1)
149 #define eif_builtin_PLATFORM_is_windows EIF_IS_WINDOWS
150 #define eif_builtin_PLATFORM_is_unix EIF_TEST(!(EIF_IS_VMS || EIF_IS_WINDOWS))
151 #define eif_builtin_PLATFORM_is_mac EIF_TEST(EIF_OS==EIF_OS_DARWIN)
152 #define eif_builtin_PLATFORM_is_vxworks EIF_TEST(EIF_OS==EIF_OS_VXWORKS)
153 #ifdef EIF_IL_DLL
154 #define eif_builtin_PLATFORM_is_dotnet EIF_TRUE
155 #else
156 #define eif_builtin_PLATFORM_is_dotnet EIF_FALSE
157 #endif
158 #define eif_builtin_PLATFORM_boolean_bytes sizeof(EIF_BOOLEAN)
159 #define eif_builtin_PLATFORM_character_bytes sizeof(EIF_CHARACTER_8)
160 #define eif_builtin_PLATFORM_wide_character_bytes sizeof(EIF_CHARACTER_32)
161 #define eif_builtin_PLATFORM_integer_bytes sizeof(EIF_INTEGER_32)
162 #define eif_builtin_PLATFORM_real_bytes sizeof(EIF_REAL_32)
163 #define eif_builtin_PLATFORM_double_bytes sizeof(EIF_REAL_64)
164 #define eif_builtin_PLATFORM_pointer_bytes sizeof(EIF_POINTER)
165
166 #define eif_builtin_REAL_32_REF_nan eif_real_32_nan
167 #define eif_builtin_REAL_32_REF_negative_infinity eif_real_32_negative_infinity
168 #define eif_builtin_REAL_32_REF_positive_infinity eif_real_32_positive_infinity
169
170 #define eif_builtin_REAL_64_REF_nan eif_real_64_nan
171 #define eif_builtin_REAL_64_REF_negative_infinity eif_real_64_negative_infinity
172 #define eif_builtin_REAL_64_REF_positive_infinity eif_real_64_positive_infinity
173
174 /* SPECIAL class */
175 #define eif_builtin_SPECIAL_aliased_resized_area(area, n) arycpy (area, n, RT_SPECIAL_COUNT (area))
176 #define eif_builtin_SPECIAL_base_address(area) (EIF_POINTER) (area)
177 #define eif_builtin_SPECIAL_capacity(area) RT_SPECIAL_CAPACITY(area)
178 #define eif_builtin_SPECIAL_count(area) RT_SPECIAL_COUNT(area)
179 #define eif_builtin_SPECIAL_element_size(area) RT_SPECIAL_ELEM_SIZE(area)
180 #define eif_builtin_SPECIAL_set_count(area,n) RT_SPECIAL_COUNT(area) = n
181
182 /* TYPE class */
183 #define eif_builtin_TYPE_has_default(obj) eif_gen_has_default(eif_gen_param_id(Dftype(obj), 1))
184 #define eif_builtin_TYPE_is_expanded(obj) eif_gen_is_expanded(eif_gen_param_id(Dftype(obj), 1))
185 #define eif_builtin_TYPE_type_id(obj) eif_gen_param_id(Dftype(obj), 1)
186 #define eif_builtin_TYPE_runtime_name(obj) eif_gen_typename_of_type(eif_gen_param_id(Dftype(obj), 1))
187 #define eif_builtin_TYPE_generic_parameter_type(obj,i) RTLNTY(eif_gen_param_id(eif_gen_param_id(Dftype(obj), 1), i))
188 #define eif_builtin_TYPE_generic_parameter_count(obj) eif_gen_count_with_dftype(eif_gen_param_id(Dftype(obj), 1))
189
190 /* TUPLE class */
191 #define eif_builtin_TUPLE_count(area) (RT_SPECIAL_COUNT(area) - 1) /* - 1 because first argument is for object_comparison */
192
193 /* WEL_IDENTIFIED class */
194 #define eif_builtin_WEL_IDENTIFIED_eif_current_object_id(object) eif_reference_id(object)
195 #define eif_builtin_WEL_IDENTIFIED_eif_is_object_id_of_current(object,id) EIF_TEST(eif_id_object(id) == object)
196
197 /* EQA_EXTERNALS class */
198 #ifdef WORKBENCH
199 #define eif_builtin_EQA_EXTERNALS_invoke_routine(obj, body_id) eif_invoke_test_routine(obj,body_id)
200 #define eif_builtin_EQA_EXTERNALS_override_byte_code_of_body(body_id, pattern_id, byte_code, length) eif_override_byte_code_of_body((int) body_id, (int) pattern_id, (unsigned char *) byte_code, (int)length)
201 #else
202 #define eif_builtin_EQA_EXTERNALS_invoke_routine(obj, body_id)
203 #define eif_builtin_EQA_EXTERNALS_override_byte_code_of_body(body_id, pattern_id, byte_code, length)
204 #endif
205
206
207 #ifdef __cplusplus
208 }
209 #endif
210
211 #endif

Properties

Name Value
svn:eol-style native
svn:keywords Author Date ID Revision

  ViewVC Help
Powered by ViewVC 1.1.23