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 * | |
srdjan
2014/01/06 21:22:19
Document return value as well.
siva
2014/01/06 21:27:02
Done.
| |
2136 * See Dart_SetNativeResolver. | 2148 * See Dart_SetNativeResolver. |
2137 */ | 2149 */ |
2138 typedef Dart_NativeFunction (*Dart_NativeEntryResolver)(Dart_Handle name, | 2150 typedef Dart_NativeFunction (*Dart_NativeEntryResolver)(Dart_Handle name, |
2139 int num_of_arguments, | 2151 int num_of_arguments, |
2140 bool* auto_setup_scope); | 2152 bool* auto_setup_scope); |
2141 /* TODO(turnidge): Consider renaming to NativeFunctionResolver or | 2153 /* TODO(turnidge): Consider renaming to NativeFunctionResolver or |
2142 * NativeResolver. */ | 2154 * NativeResolver. */ |
2143 | 2155 |
2144 /* | 2156 /* |
2145 * =========== | 2157 * =========== |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2372 * | 2384 * |
2373 * \param object An object. | 2385 * \param object An object. |
2374 * \param peer A value to store in the peer field. | 2386 * \param peer A value to store in the peer field. |
2375 * | 2387 * |
2376 * \return Returns an error if 'object' is a subtype of Null, num, or | 2388 * \return Returns an error if 'object' is a subtype of Null, num, or |
2377 * bool. | 2389 * bool. |
2378 */ | 2390 */ |
2379 DART_EXPORT Dart_Handle Dart_SetPeer(Dart_Handle object, void* peer); | 2391 DART_EXPORT Dart_Handle Dart_SetPeer(Dart_Handle object, void* peer); |
2380 | 2392 |
2381 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ | 2393 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ |
OLD | NEW |