OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "bin/io_natives.h" | 5 #include "bin/io_natives.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include "bin/builtin.h" | 10 #include "bin/builtin.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 V(X509_Issuer, 1) \ | 150 V(X509_Issuer, 1) \ |
151 V(X509_StartValidity, 1) \ | 151 V(X509_StartValidity, 1) \ |
152 V(X509_EndValidity, 1) | 152 V(X509_EndValidity, 1) |
153 | 153 |
154 IO_NATIVE_LIST(DECLARE_FUNCTION); | 154 IO_NATIVE_LIST(DECLARE_FUNCTION); |
155 | 155 |
156 static struct NativeEntries { | 156 static struct NativeEntries { |
157 const char* name_; | 157 const char* name_; |
158 Dart_NativeFunction function_; | 158 Dart_NativeFunction function_; |
159 int argument_count_; | 159 int argument_count_; |
160 } IOEntries[] = { | 160 } IOEntries[] = {IO_NATIVE_LIST(REGISTER_FUNCTION)}; |
161 IO_NATIVE_LIST(REGISTER_FUNCTION) | |
162 }; | |
163 | 161 |
164 | 162 |
165 Dart_NativeFunction IONativeLookup(Dart_Handle name, | 163 Dart_NativeFunction IONativeLookup(Dart_Handle name, |
166 int argument_count, | 164 int argument_count, |
167 bool* auto_setup_scope) { | 165 bool* auto_setup_scope) { |
168 const char* function_name = NULL; | 166 const char* function_name = NULL; |
169 Dart_Handle result = Dart_StringToCString(name, &function_name); | 167 Dart_Handle result = Dart_StringToCString(name, &function_name); |
170 DART_CHECK_VALID(result); | 168 DART_CHECK_VALID(result); |
171 ASSERT(function_name != NULL); | 169 ASSERT(function_name != NULL); |
172 ASSERT(auto_setup_scope != NULL); | 170 ASSERT(auto_setup_scope != NULL); |
(...skipping 16 matching lines...) Expand all Loading... |
189 struct NativeEntries* entry = &(IOEntries[i]); | 187 struct NativeEntries* entry = &(IOEntries[i]); |
190 if (reinterpret_cast<Dart_NativeFunction>(entry->function_) == nf) { | 188 if (reinterpret_cast<Dart_NativeFunction>(entry->function_) == nf) { |
191 return reinterpret_cast<const uint8_t*>(entry->name_); | 189 return reinterpret_cast<const uint8_t*>(entry->name_); |
192 } | 190 } |
193 } | 191 } |
194 return NULL; | 192 return NULL; |
195 } | 193 } |
196 | 194 |
197 } // namespace bin | 195 } // namespace bin |
198 } // namespace dart | 196 } // namespace dart |
OLD | NEW |