| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef INCLUDE_DART_API_H_ | 5 #ifndef INCLUDE_DART_API_H_ |
| 6 #define INCLUDE_DART_API_H_ | 6 #define INCLUDE_DART_API_H_ |
| 7 | 7 |
| 8 /** \mainpage Dart Embedding API Reference | 8 /** \mainpage Dart Embedding API Reference |
| 9 * | 9 * |
| 10 * Dart is a class-based programming language for creating structured | 10 * Dart is a class-based programming language for creating structured |
| (...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1131 // --- Scripts and Libraries --- | 1131 // --- Scripts and Libraries --- |
| 1132 // TODO(turnidge): Finish documenting this section. | 1132 // TODO(turnidge): Finish documenting this section. |
| 1133 | 1133 |
| 1134 typedef enum { | 1134 typedef enum { |
| 1135 kLibraryTag = 0, | 1135 kLibraryTag = 0, |
| 1136 kImportTag, | 1136 kImportTag, |
| 1137 kSourceTag, | 1137 kSourceTag, |
| 1138 kCanonicalizeUrl, | 1138 kCanonicalizeUrl, |
| 1139 } Dart_LibraryTag; | 1139 } Dart_LibraryTag; |
| 1140 | 1140 |
| 1141 // TODO(turnidge): Document. |
| 1141 typedef Dart_Handle (*Dart_LibraryTagHandler)(Dart_LibraryTag tag, | 1142 typedef Dart_Handle (*Dart_LibraryTagHandler)(Dart_LibraryTag tag, |
| 1142 Dart_Handle library, | 1143 Dart_Handle library, |
| 1143 Dart_Handle url); | 1144 Dart_Handle url); |
| 1144 | 1145 |
| 1145 /** | 1146 /** |
| 1146 * Loads the root script for the current isolate. | 1147 * Loads the root script for the current isolate. |
| 1147 * | 1148 * |
| 1148 * TODO(turnidge): Document. | 1149 * TODO(turnidge): Document. |
| 1149 */ | 1150 */ |
| 1150 DART_EXPORT Dart_Handle Dart_LoadScript(Dart_Handle url, | 1151 DART_EXPORT Dart_Handle Dart_LoadScript(Dart_Handle url, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1165 DART_EXPORT bool Dart_IsLibrary(Dart_Handle object); | 1166 DART_EXPORT bool Dart_IsLibrary(Dart_Handle object); |
| 1166 | 1167 |
| 1167 /** | 1168 /** |
| 1168 * Lookup a class by name from a Library. | 1169 * Lookup a class by name from a Library. |
| 1169 * | 1170 * |
| 1170 * \return If no error occurs, the Library is returned. Otherwise an | 1171 * \return If no error occurs, the Library is returned. Otherwise an |
| 1171 * error handle is returned. | 1172 * error handle is returned. |
| 1172 */ | 1173 */ |
| 1173 DART_EXPORT Dart_Handle Dart_GetClass(Dart_Handle library, Dart_Handle name); | 1174 DART_EXPORT Dart_Handle Dart_GetClass(Dart_Handle library, Dart_Handle name); |
| 1174 | 1175 |
| 1176 DART_EXPORT Dart_Handle Dart_LibraryUrl(Dart_Handle library); |
| 1177 |
| 1178 DART_EXPORT Dart_Handle Dart_LoadLibrary(Dart_Handle url, |
| 1179 Dart_Handle source); |
| 1180 |
| 1175 DART_EXPORT Dart_Handle Dart_LookupLibrary(Dart_Handle url); | 1181 DART_EXPORT Dart_Handle Dart_LookupLibrary(Dart_Handle url); |
| 1176 | 1182 |
| 1177 DART_EXPORT Dart_Handle Dart_LibraryUrl(Dart_Handle library); | 1183 |
| 1178 DART_EXPORT Dart_Handle Dart_LibraryImportLibrary(Dart_Handle library, | 1184 DART_EXPORT Dart_Handle Dart_LibraryImportLibrary(Dart_Handle library, |
| 1179 Dart_Handle import); | 1185 Dart_Handle import); |
| 1180 | 1186 |
| 1181 DART_EXPORT Dart_Handle Dart_LoadLibrary(Dart_Handle url, | |
| 1182 Dart_Handle source); | |
| 1183 DART_EXPORT Dart_Handle Dart_LoadSource(Dart_Handle library, | 1187 DART_EXPORT Dart_Handle Dart_LoadSource(Dart_Handle library, |
| 1184 Dart_Handle url, | 1188 Dart_Handle url, |
| 1185 Dart_Handle source); | 1189 Dart_Handle source); |
| 1190 // TODO(turnidge): Rename to Dart_LibraryLoadSource? |
| 1186 | 1191 |
| 1187 /** | 1192 /** |
| 1188 * Sets the callback used to resolve native functions for a library. | 1193 * Sets the callback used to resolve native functions for a library. |
| 1189 * | 1194 * |
| 1190 * \param library A library. | 1195 * \param library A library. |
| 1191 * \param resolver A native entry resolver. | 1196 * \param resolver A native entry resolver. |
| 1192 * | 1197 * |
| 1193 * \return A valid handle if the native resolver was set successfully. | 1198 * \return A valid handle if the native resolver was set successfully. |
| 1194 */ | 1199 */ |
| 1195 DART_EXPORT Dart_Handle Dart_SetNativeResolver( | 1200 DART_EXPORT Dart_Handle Dart_SetNativeResolver( |
| 1196 Dart_Handle library, | 1201 Dart_Handle library, |
| 1197 Dart_NativeEntryResolver resolver); | 1202 Dart_NativeEntryResolver resolver); |
| 1203 // TODO(turnidge): Rename to Dart_LibrarySetNativeResolver? |
| 1204 |
| 1198 | 1205 |
| 1199 // --- Profiling support ---- | 1206 // --- Profiling support ---- |
| 1200 | 1207 |
| 1201 // External pprof support for gathering and dumping symbolic | 1208 // External pprof support for gathering and dumping symbolic |
| 1202 // information that can be used for better profile reports for | 1209 // information that can be used for better profile reports for |
| 1203 // dynamically generated code. | 1210 // dynamically generated code. |
| 1204 DART_EXPORT void Dart_InitPprofSupport(); | 1211 DART_EXPORT void Dart_InitPprofSupport(); |
| 1205 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); | 1212 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); |
| 1206 | 1213 |
| 1207 #endif // INCLUDE_DART_API_H_ | 1214 #endif // INCLUDE_DART_API_H_ |
| OLD | NEW |