| 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 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1470 * | 1470 * |
| 1471 * \return A valid handle if no error occurs during the operation. | 1471 * \return A valid handle if no error occurs during the operation. |
| 1472 */ | 1472 */ |
| 1473 DART_EXPORT Dart_Handle Dart_StringToUTF8(Dart_Handle str, | 1473 DART_EXPORT Dart_Handle Dart_StringToUTF8(Dart_Handle str, |
| 1474 uint8_t** utf8_array, | 1474 uint8_t** utf8_array, |
| 1475 intptr_t* length); | 1475 intptr_t* length); |
| 1476 | 1476 |
| 1477 /** | 1477 /** |
| 1478 * Gets the data corresponding to the string object. This function returns | 1478 * Gets the data corresponding to the string object. This function returns |
| 1479 * the data only for Latin-1 (ISO-8859-1) string objects. For all other | 1479 * the data only for Latin-1 (ISO-8859-1) string objects. For all other |
| 1480 * string objects it return and error. | 1480 * string objects it returns an error. |
| 1481 * | 1481 * |
| 1482 * \param str A string. | 1482 * \param str A string. |
| 1483 * \param latin1_array An array allocated by the caller, used to return | 1483 * \param latin1_array An array allocated by the caller, used to return |
| 1484 * the string data. | 1484 * the string data. |
| 1485 * \param length Used to pass in the length of the provided array. | 1485 * \param length Used to pass in the length of the provided array. |
| 1486 * Used to return the length of the array which was actually used. | 1486 * Used to return the length of the array which was actually used. |
| 1487 * | 1487 * |
| 1488 * \return A valid handle if no error occurs during the operation. | 1488 * \return A valid handle if no error occurs during the operation. |
| 1489 */ | 1489 */ |
| 1490 DART_EXPORT Dart_Handle Dart_StringToLatin1(Dart_Handle str, | 1490 DART_EXPORT Dart_Handle Dart_StringToLatin1(Dart_Handle str, |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2099 * name/arity to a Dart_NativeFunction. If no function is found, the | 2099 * name/arity to a Dart_NativeFunction. If no function is found, the |
| 2100 * callback should return NULL. | 2100 * callback should return NULL. |
| 2101 * | 2101 * |
| 2102 * See Dart_SetNativeResolver. | 2102 * See Dart_SetNativeResolver. |
| 2103 */ | 2103 */ |
| 2104 typedef Dart_NativeFunction (*Dart_NativeEntryResolver)(Dart_Handle name, | 2104 typedef Dart_NativeFunction (*Dart_NativeEntryResolver)(Dart_Handle name, |
| 2105 int num_of_arguments); | 2105 int num_of_arguments); |
| 2106 /* TODO(turnidge): Consider renaming to NativeFunctionResolver or | 2106 /* TODO(turnidge): Consider renaming to NativeFunctionResolver or |
| 2107 * NativeResolver. */ | 2107 * NativeResolver. */ |
| 2108 | 2108 |
| 2109 /* |
| 2110 * =========== |
| 2111 * Environment |
| 2112 * =========== |
| 2113 */ |
| 2114 |
| 2115 /** |
| 2116 * An environment lookup callback function. |
| 2117 * |
| 2118 * \param name The name of the value to lookup in the environment. |
| 2119 * |
| 2120 * \return A valid handle to a string if the name exists in the |
| 2121 * current environment or Dart_Null() if not. |
| 2122 */ |
| 2123 typedef Dart_Handle (*Dart_EnvironmentCallback)(Dart_Handle name); |
| 2124 |
| 2125 /** |
| 2126 * Sets the environment callback for the current isolate. This |
| 2127 * callback is used to lookup environment values by name in the |
| 2128 * current environment. This enables the embedder to supply values for |
| 2129 * the const constructors bool.fromEnvironment, int.fromEnvironment |
| 2130 * and String.fromEnvironment. |
| 2131 */ |
| 2132 DART_EXPORT Dart_Handle Dart_SetEnvironmentCallback( |
| 2133 Dart_EnvironmentCallback callback); |
| 2134 |
| 2109 /** | 2135 /** |
| 2110 * Sets the callback used to resolve native functions for a library. | 2136 * Sets the callback used to resolve native functions for a library. |
| 2111 * | 2137 * |
| 2112 * \param library A library. | 2138 * \param library A library. |
| 2113 * \param resolver A native entry resolver. | 2139 * \param resolver A native entry resolver. |
| 2114 * | 2140 * |
| 2115 * \return A valid handle if the native resolver was set successfully. | 2141 * \return A valid handle if the native resolver was set successfully. |
| 2116 */ | 2142 */ |
| 2117 DART_EXPORT Dart_Handle Dart_SetNativeResolver( | 2143 DART_EXPORT Dart_Handle Dart_SetNativeResolver( |
| 2118 Dart_Handle library, | 2144 Dart_Handle library, |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2312 * | 2338 * |
| 2313 * \param object An object. | 2339 * \param object An object. |
| 2314 * \param peer A value to store in the peer field. | 2340 * \param peer A value to store in the peer field. |
| 2315 * | 2341 * |
| 2316 * \return Returns an error if 'object' is a subtype of Null, num, or | 2342 * \return Returns an error if 'object' is a subtype of Null, num, or |
| 2317 * bool. | 2343 * bool. |
| 2318 */ | 2344 */ |
| 2319 DART_EXPORT Dart_Handle Dart_SetPeer(Dart_Handle object, void* peer); | 2345 DART_EXPORT Dart_Handle Dart_SetPeer(Dart_Handle object, void* peer); |
| 2320 | 2346 |
| 2321 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ | 2347 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ |
| OLD | NEW |