OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 2 * Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
3 * for details. All rights reserved. Use of this source code is governed by a | 3 * for details. All rights reserved. Use of this source code is governed by a |
4 * BSD-style license that can be found in the LICENSE file. | 4 * BSD-style license that can be found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 #ifndef INCLUDE_DART_API_H_ | 7 #ifndef INCLUDE_DART_API_H_ |
8 #define INCLUDE_DART_API_H_ | 8 #define INCLUDE_DART_API_H_ |
9 | 9 |
10 /** \mainpage Dart Embedding API Reference | 10 /** \mainpage Dart Embedding API Reference |
(...skipping 2115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2126 typedef void (*Dart_NativeFunction)(Dart_NativeArguments arguments); | 2126 typedef void (*Dart_NativeFunction)(Dart_NativeArguments arguments); |
2127 | 2127 |
2128 /** | 2128 /** |
2129 * Native entry resolution callback. | 2129 * Native entry resolution callback. |
2130 * | 2130 * |
2131 * For libraries and scripts which have native functions, the embedder | 2131 * For libraries and scripts which have native functions, the embedder |
2132 * can provide a native entry resolver. This callback is used to map a | 2132 * can provide a native entry resolver. This callback is used to map a |
2133 * name/arity to a Dart_NativeFunction. If no function is found, the | 2133 * name/arity to a Dart_NativeFunction. If no function is found, the |
2134 * callback should return NULL. | 2134 * callback should return NULL. |
2135 * | 2135 * |
| 2136 * The parameters to the native resolver function are: |
| 2137 * \param name a Dart string which is the name of the native function. |
| 2138 * \param num_of_arguments is the number of arguments expected by the |
| 2139 * native function. |
| 2140 * \param auto_setup_scope is a boolean flag that can be set by the resolver |
| 2141 * to indicate if this function needs a Dart API scope (see Dart_EnterScope/ |
| 2142 * Dart_ExitScope) to be setup automatically by the VM before calling into |
| 2143 * the native function. By default most native functions would require this |
| 2144 * to be true but some light weight native functions which do not call back |
| 2145 * into the VM through the Dart API may not require a Dart scope to be |
| 2146 * setup automatically. |
| 2147 * |
| 2148 * \return A valid Dart_NativeFunction which resolves to a native entry point |
| 2149 * for the native function. |
| 2150 * |
2136 * See Dart_SetNativeResolver. | 2151 * See Dart_SetNativeResolver. |
2137 */ | 2152 */ |
2138 typedef Dart_NativeFunction (*Dart_NativeEntryResolver)(Dart_Handle name, | 2153 typedef Dart_NativeFunction (*Dart_NativeEntryResolver)(Dart_Handle name, |
2139 int num_of_arguments, | 2154 int num_of_arguments, |
2140 bool* auto_setup_scope); | 2155 bool* auto_setup_scope); |
2141 /* TODO(turnidge): Consider renaming to NativeFunctionResolver or | 2156 /* TODO(turnidge): Consider renaming to NativeFunctionResolver or |
2142 * NativeResolver. */ | 2157 * NativeResolver. */ |
2143 | 2158 |
2144 /* | 2159 /* |
2145 * =========== | 2160 * =========== |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2372 * | 2387 * |
2373 * \param object An object. | 2388 * \param object An object. |
2374 * \param peer A value to store in the peer field. | 2389 * \param peer A value to store in the peer field. |
2375 * | 2390 * |
2376 * \return Returns an error if 'object' is a subtype of Null, num, or | 2391 * \return Returns an error if 'object' is a subtype of Null, num, or |
2377 * bool. | 2392 * bool. |
2378 */ | 2393 */ |
2379 DART_EXPORT Dart_Handle Dart_SetPeer(Dart_Handle object, void* peer); | 2394 DART_EXPORT Dart_Handle Dart_SetPeer(Dart_Handle object, void* peer); |
2380 | 2395 |
2381 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ | 2396 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ |
OLD | NEW |