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 * Configurations | |
Ivan Posva
2013/10/29 21:42:59
Environment here and everywhere else.
Please see
Søren Gjesse
2013/10/30 11:44:02
Done.
| |
2112 * ============== | |
2113 */ | |
2114 | |
2115 typedef enum { | |
2116 kStringConfig = 0, | |
2117 kIntegerConfig, | |
2118 kBoolConfig | |
2119 } Dart_ConfigType; | |
2120 | |
2121 /** | |
2122 * A configuration callback function. | |
2123 * | |
2124 * \param type The type used when asking for the configuration parameter. | |
2125 * \param name The name of the configuration parameter. | |
2126 * | |
2127 * \return A valid handle to a string if the configuration parameter exists. | |
2128 * A string must be returned for all configuration types as the Vm will parse | |
2129 * the value returned. If the configuration parameter does not exist return | |
2130 * Dart_Null(). | |
2131 */ | |
2132 typedef Dart_Handle (*Dart_ConfigCallback)(Dart_ConfigType type, | |
2133 Dart_Handle name); | |
2134 | |
2135 /** | |
2136 * Sets the configuration callback for the current isolate. This callback is | |
2137 * used to lookup configuration values by name in the current environment. | |
2138 */ | |
2139 DART_EXPORT Dart_Handle Dart_SetConfigCallback(Dart_ConfigCallback callback); | |
2140 | |
2109 /** | 2141 /** |
2110 * Sets the callback used to resolve native functions for a library. | 2142 * Sets the callback used to resolve native functions for a library. |
2111 * | 2143 * |
2112 * \param library A library. | 2144 * \param library A library. |
2113 * \param resolver A native entry resolver. | 2145 * \param resolver A native entry resolver. |
2114 * | 2146 * |
2115 * \return A valid handle if the native resolver was set successfully. | 2147 * \return A valid handle if the native resolver was set successfully. |
2116 */ | 2148 */ |
2117 DART_EXPORT Dart_Handle Dart_SetNativeResolver( | 2149 DART_EXPORT Dart_Handle Dart_SetNativeResolver( |
2118 Dart_Handle library, | 2150 Dart_Handle library, |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2312 * | 2344 * |
2313 * \param object An object. | 2345 * \param object An object. |
2314 * \param peer A value to store in the peer field. | 2346 * \param peer A value to store in the peer field. |
2315 * | 2347 * |
2316 * \return Returns an error if 'object' is a subtype of Null, num, or | 2348 * \return Returns an error if 'object' is a subtype of Null, num, or |
2317 * bool. | 2349 * bool. |
2318 */ | 2350 */ |
2319 DART_EXPORT Dart_Handle Dart_SetPeer(Dart_Handle object, void* peer); | 2351 DART_EXPORT Dart_Handle Dart_SetPeer(Dart_Handle object, void* peer); |
2320 | 2352 |
2321 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ | 2353 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ |
OLD | NEW |