| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1328 typedef enum { | 1328 typedef enum { |
| 1329 kLibraryTag = 0, | 1329 kLibraryTag = 0, |
| 1330 kImportTag, | 1330 kImportTag, |
| 1331 kSourceTag, | 1331 kSourceTag, |
| 1332 kCanonicalizeUrl, | 1332 kCanonicalizeUrl, |
| 1333 } Dart_LibraryTag; | 1333 } Dart_LibraryTag; |
| 1334 | 1334 |
| 1335 // TODO(turnidge): Document. | 1335 // TODO(turnidge): Document. |
| 1336 typedef Dart_Handle (*Dart_LibraryTagHandler)(Dart_LibraryTag tag, | 1336 typedef Dart_Handle (*Dart_LibraryTagHandler)(Dart_LibraryTag tag, |
| 1337 Dart_Handle library, | 1337 Dart_Handle library, |
| 1338 Dart_Handle url); | 1338 Dart_Handle url, |
| 1339 Dart_Handle import_map); |
| 1339 | 1340 |
| 1340 /** | 1341 /** |
| 1341 * Loads the root script for the current isolate. | 1342 * Loads the root script for the current isolate. |
| 1342 * | 1343 * |
| 1343 * TODO(turnidge): Document. | 1344 * TODO(turnidge): Document. |
| 1344 */ | 1345 */ |
| 1345 DART_EXPORT Dart_Handle Dart_LoadScript(Dart_Handle url, | 1346 DART_EXPORT Dart_Handle Dart_LoadScript(Dart_Handle url, |
| 1346 Dart_Handle source, | 1347 Dart_Handle source, |
| 1347 Dart_LibraryTagHandler handler); | 1348 Dart_LibraryTagHandler handler, |
| 1349 Dart_Handle import_map); |
| 1348 | 1350 |
| 1349 /** | 1351 /** |
| 1350 * Loads the root script for current isolate from a snapshot. | 1352 * Loads the root script for current isolate from a snapshot. |
| 1351 * | 1353 * |
| 1352 * \param buffer A buffer which contains a snapshot of the script. | 1354 * \param buffer A buffer which contains a snapshot of the script. |
| 1353 * | 1355 * |
| 1354 * \return If no error occurs, the Library object corresponding to the root | 1356 * \return If no error occurs, the Library object corresponding to the root |
| 1355 * script is returned. Otherwise an error handle is returned. | 1357 * script is returned. Otherwise an error handle is returned. |
| 1356 **/ | 1358 **/ |
| 1357 DART_EXPORT Dart_Handle Dart_LoadScriptFromSnapshot(const uint8_t* buffer); | 1359 DART_EXPORT Dart_Handle Dart_LoadScriptFromSnapshot(const uint8_t* buffer); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1375 * \return If no error occurs, the Library is returned. Otherwise an | 1377 * \return If no error occurs, the Library is returned. Otherwise an |
| 1376 * error handle is returned. | 1378 * error handle is returned. |
| 1377 */ | 1379 */ |
| 1378 DART_EXPORT Dart_Handle Dart_GetClass(Dart_Handle library, Dart_Handle name); | 1380 DART_EXPORT Dart_Handle Dart_GetClass(Dart_Handle library, Dart_Handle name); |
| 1379 | 1381 |
| 1380 DART_EXPORT Dart_Handle Dart_LibraryUrl(Dart_Handle library); | 1382 DART_EXPORT Dart_Handle Dart_LibraryUrl(Dart_Handle library); |
| 1381 | 1383 |
| 1382 DART_EXPORT Dart_Handle Dart_LookupLibrary(Dart_Handle url); | 1384 DART_EXPORT Dart_Handle Dart_LookupLibrary(Dart_Handle url); |
| 1383 | 1385 |
| 1384 DART_EXPORT Dart_Handle Dart_LoadLibrary(Dart_Handle url, | 1386 DART_EXPORT Dart_Handle Dart_LoadLibrary(Dart_Handle url, |
| 1385 Dart_Handle source); | 1387 Dart_Handle source, |
| 1388 Dart_Handle import_map); |
| 1386 | 1389 |
| 1387 | 1390 |
| 1388 DART_EXPORT Dart_Handle Dart_LibraryImportLibrary(Dart_Handle library, | 1391 DART_EXPORT Dart_Handle Dart_LibraryImportLibrary(Dart_Handle library, |
| 1389 Dart_Handle import); | 1392 Dart_Handle import); |
| 1390 | 1393 |
| 1391 DART_EXPORT Dart_Handle Dart_LoadSource(Dart_Handle library, | 1394 DART_EXPORT Dart_Handle Dart_LoadSource(Dart_Handle library, |
| 1392 Dart_Handle url, | 1395 Dart_Handle url, |
| 1393 Dart_Handle source); | 1396 Dart_Handle source); |
| 1394 // TODO(turnidge): Rename to Dart_LibraryLoadSource? | 1397 // TODO(turnidge): Rename to Dart_LibraryLoadSource? |
| 1395 | 1398 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1456 * restored. | 1459 * restored. |
| 1457 * | 1460 * |
| 1458 * \param port_id The destination port. | 1461 * \param port_id The destination port. |
| 1459 * \param message The message to send. | 1462 * \param message The message to send. |
| 1460 * | 1463 * |
| 1461 * \return True if the message was posted. | 1464 * \return True if the message was posted. |
| 1462 */ | 1465 */ |
| 1463 DART_EXPORT bool Dart_PostCObject(Dart_Port port_id, Dart_CObject* message); | 1466 DART_EXPORT bool Dart_PostCObject(Dart_Port port_id, Dart_CObject* message); |
| 1464 | 1467 |
| 1465 #endif // INCLUDE_DART_API_H_ | 1468 #endif // INCLUDE_DART_API_H_ |
| OLD | NEW |