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 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1459 * | 1459 * |
1460 * \return A valid handle if no error occurs during the operation. | 1460 * \return A valid handle if no error occurs during the operation. |
1461 */ | 1461 */ |
1462 DART_EXPORT Dart_Handle Dart_StringToUTF8(Dart_Handle str, | 1462 DART_EXPORT Dart_Handle Dart_StringToUTF8(Dart_Handle str, |
1463 uint8_t** utf8_array, | 1463 uint8_t** utf8_array, |
1464 intptr_t* length); | 1464 intptr_t* length); |
1465 | 1465 |
1466 /** | 1466 /** |
1467 * Gets the data corresponding to the string object. This function returns | 1467 * Gets the data corresponding to the string object. This function returns |
1468 * the data only for Latin-1 (ISO-8859-1) string objects. For all other | 1468 * the data only for Latin-1 (ISO-8859-1) string objects. For all other |
1469 * string objects it return and error. | 1469 * string objects it returns an error. |
1470 * | 1470 * |
1471 * \param str A string. | 1471 * \param str A string. |
1472 * \param latin1_array An array allocated by the caller, used to return | 1472 * \param latin1_array An array allocated by the caller, used to return |
1473 * the string data. | 1473 * the string data. |
1474 * \param length Used to pass in the length of the provided array. | 1474 * \param length Used to pass in the length of the provided array. |
1475 * Used to return the length of the array which was actually used. | 1475 * Used to return the length of the array which was actually used. |
1476 * | 1476 * |
1477 * \return A valid handle if no error occurs during the operation. | 1477 * \return A valid handle if no error occurs during the operation. |
1478 */ | 1478 */ |
1479 DART_EXPORT Dart_Handle Dart_StringToLatin1(Dart_Handle str, | 1479 DART_EXPORT Dart_Handle Dart_StringToLatin1(Dart_Handle str, |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2064 * name/arity to a Dart_NativeFunction. If no function is found, the | 2064 * name/arity to a Dart_NativeFunction. If no function is found, the |
2065 * callback should return NULL. | 2065 * callback should return NULL. |
2066 * | 2066 * |
2067 * See Dart_SetNativeResolver. | 2067 * See Dart_SetNativeResolver. |
2068 */ | 2068 */ |
2069 typedef Dart_NativeFunction (*Dart_NativeEntryResolver)(Dart_Handle name, | 2069 typedef Dart_NativeFunction (*Dart_NativeEntryResolver)(Dart_Handle name, |
2070 int num_of_arguments); | 2070 int num_of_arguments); |
2071 /* TODO(turnidge): Consider renaming to NativeFunctionResolver or | 2071 /* TODO(turnidge): Consider renaming to NativeFunctionResolver or |
2072 * NativeResolver. */ | 2072 * NativeResolver. */ |
2073 | 2073 |
| 2074 /* |
| 2075 * ============== |
| 2076 * Configurations |
| 2077 * ============== |
| 2078 */ |
| 2079 |
| 2080 typedef enum { |
| 2081 kStringConfig = 0, |
| 2082 kIntegerConfig, |
| 2083 kBoolConfig |
| 2084 } Dart_ConfigType; |
| 2085 |
| 2086 /* TODO(iposva): Document. */ |
| 2087 typedef Dart_Handle (*Dart_ConfigCallback)(Dart_ConfigType type, |
| 2088 Dart_Handle name); |
| 2089 |
| 2090 /** |
| 2091 * Sets the configuration callback for the current isolate. This callback is |
| 2092 * used to lookup configuration values by name in the current environment. |
| 2093 */ |
| 2094 DART_EXPORT Dart_Handle Dart_SetConfigCallback(Dart_ConfigCallback callback); |
| 2095 |
2074 /** | 2096 /** |
2075 * Sets the callback used to resolve native functions for a library. | 2097 * Sets the callback used to resolve native functions for a library. |
2076 * | 2098 * |
2077 * \param library A library. | 2099 * \param library A library. |
2078 * \param resolver A native entry resolver. | 2100 * \param resolver A native entry resolver. |
2079 * | 2101 * |
2080 * \return A valid handle if the native resolver was set successfully. | 2102 * \return A valid handle if the native resolver was set successfully. |
2081 */ | 2103 */ |
2082 DART_EXPORT Dart_Handle Dart_SetNativeResolver( | 2104 DART_EXPORT Dart_Handle Dart_SetNativeResolver( |
2083 Dart_Handle library, | 2105 Dart_Handle library, |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2277 * | 2299 * |
2278 * \param object An object. | 2300 * \param object An object. |
2279 * \param peer A value to store in the peer field. | 2301 * \param peer A value to store in the peer field. |
2280 * | 2302 * |
2281 * \return Returns an error if 'object' is a subtype of Null, num, or | 2303 * \return Returns an error if 'object' is a subtype of Null, num, or |
2282 * bool. | 2304 * bool. |
2283 */ | 2305 */ |
2284 DART_EXPORT Dart_Handle Dart_SetPeer(Dart_Handle object, void* peer); | 2306 DART_EXPORT Dart_Handle Dart_SetPeer(Dart_Handle object, void* peer); |
2285 | 2307 |
2286 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ | 2308 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ |
OLD | NEW |