| 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 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 DART_EXPORT Dart_Port Dart_GetMainPortId(); | 492 DART_EXPORT Dart_Port Dart_GetMainPortId(); |
| 493 | 493 |
| 494 /** | 494 /** |
| 495 * Does the current isolate have live ReceivePorts? | 495 * Does the current isolate have live ReceivePorts? |
| 496 * | 496 * |
| 497 * A ReceivePort is live when it has not been closed. | 497 * A ReceivePort is live when it has not been closed. |
| 498 */ | 498 */ |
| 499 DART_EXPORT bool Dart_HasLivePorts(); | 499 DART_EXPORT bool Dart_HasLivePorts(); |
| 500 | 500 |
| 501 /** | 501 /** |
| 502 * Posts a message for some isolate. The message is built from a raw | |
| 503 * array. | |
| 504 * | |
| 505 * \param port The destination port. | |
| 506 * \param length The length of the data array. | |
| 507 * \param data A data array to be sent in the message. | |
| 508 * | |
| 509 * \return True if the message was posted. | |
| 510 */ | |
| 511 DART_EXPORT bool Dart_PostIntArray(Dart_Port port_id, | |
| 512 intptr_t length, | |
| 513 intptr_t* data); | |
| 514 // TODO(turnidge): Should this be intptr_t or some fixed length type? | |
| 515 // TODO(turnidge): Reverse length/data for consistency. | |
| 516 | |
| 517 /** | |
| 518 * Posts a message for some isolate. The message is a serialized | 502 * Posts a message for some isolate. The message is a serialized |
| 519 * object. | 503 * object. |
| 520 * | 504 * |
| 521 * Requires there to be a current isolate. | 505 * Requires there to be a current isolate. |
| 522 * | 506 * |
| 523 * \param port The destination port. | 507 * \param port The destination port. |
| 524 * \param object An object from the current isolate. | 508 * \param object An object from the current isolate. |
| 525 * | 509 * |
| 526 * \return True if the message was posted. | 510 * \return True if the message was posted. |
| 527 */ | 511 */ |
| (...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1443 * graph represented as Dart_CObject structures rooted as the provided | 1427 * graph represented as Dart_CObject structures rooted as the provided |
| 1444 * root. | 1428 * root. |
| 1445 * | 1429 * |
| 1446 * For information on the lifetime of this data, when provided in | 1430 * For information on the lifetime of this data, when provided in |
| 1447 * callbacks, see the documentation for the individual callbacks. | 1431 * callbacks, see the documentation for the individual callbacks. |
| 1448 */ | 1432 */ |
| 1449 struct Dart_CMessage { | 1433 struct Dart_CMessage { |
| 1450 Dart_CObject* root; | 1434 Dart_CObject* root; |
| 1451 }; | 1435 }; |
| 1452 | 1436 |
| 1437 /** |
| 1438 * Posts a message on some port. The message is built from a |
| 1439 * Dart_CMessage array. |
| 1440 * |
| 1441 * \param port_id The destination port. |
| 1442 * \param message The message to send. |
| 1443 * |
| 1444 * \return True if the message was posted. |
| 1445 */ |
| 1446 DART_EXPORT bool Dart_PostCMessage(Dart_Port port_id, |
| 1447 Dart_CMessage* message); |
| 1453 | 1448 |
| 1454 #endif // INCLUDE_DART_API_H_ | 1449 #endif // INCLUDE_DART_API_H_ |
| OLD | NEW |