| 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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 * representation as a Dart_CObject. | 544 * representation as a Dart_CObject. |
| 545 */ | 545 */ |
| 546 struct Dart_CObject { | 546 struct Dart_CObject { |
| 547 enum Type { | 547 enum Type { |
| 548 kNull = 0, | 548 kNull = 0, |
| 549 kBool, | 549 kBool, |
| 550 kInt32, | 550 kInt32, |
| 551 kDouble, | 551 kDouble, |
| 552 kString, | 552 kString, |
| 553 kArray, | 553 kArray, |
| 554 kByteArray, |
| 554 kNumberOfTypes | 555 kNumberOfTypes |
| 555 }; | 556 }; |
| 556 Type type; | 557 Type type; |
| 557 union { | 558 union { |
| 558 bool as_bool; | 559 bool as_bool; |
| 559 int32_t as_int32; | 560 int32_t as_int32; |
| 560 double as_double; | 561 double as_double; |
| 561 char* as_string; | 562 char* as_string; |
| 562 struct { | 563 struct { |
| 563 int length; | 564 int length; |
| 564 Dart_CObject** values; | 565 Dart_CObject** values; |
| 565 } as_array; | 566 } as_array; |
| 567 struct { |
| 568 int length; |
| 569 uint8_t* values; |
| 570 } as_byte_array; |
| 566 } value; | 571 } value; |
| 567 }; | 572 }; |
| 568 | 573 |
| 569 /** | 574 /** |
| 570 * Posts a message on some port. The message will contain the | 575 * Posts a message on some port. The message will contain the |
| 571 * Dart_CObject object graph rooted in 'message'. | 576 * Dart_CObject object graph rooted in 'message'. |
| 572 * | 577 * |
| 573 * While the message is being sent the state of the graph of | 578 * While the message is being sent the state of the graph of |
| 574 * Dart_CObject structures rooted in 'message' should not be accessed, | 579 * Dart_CObject structures rooted in 'message' should not be accessed, |
| 575 * as the message generation will make temporary modifications to the | 580 * as the message generation will make temporary modifications to the |
| (...skipping 11 matching lines...) Expand all Loading... |
| 587 * A native message handler. | 592 * A native message handler. |
| 588 * | 593 * |
| 589 * This handler is associated with a native port by calling | 594 * This handler is associated with a native port by calling |
| 590 * Dart_NewNativePort. | 595 * Dart_NewNativePort. |
| 591 * | 596 * |
| 592 * The message received is decoded into the message structure. The | 597 * The message received is decoded into the message structure. The |
| 593 * lifetime of the message data is controlled by the caller. All the | 598 * lifetime of the message data is controlled by the caller. All the |
| 594 * data references from the message are allocated by the caller and | 599 * data references from the message are allocated by the caller and |
| 595 * will be reclaimed when returning to it. | 600 * will be reclaimed when returning to it. |
| 596 */ | 601 */ |
| 597 | |
| 598 typedef void (*Dart_NativeMessageHandler)(Dart_Port dest_port_id, | 602 typedef void (*Dart_NativeMessageHandler)(Dart_Port dest_port_id, |
| 599 Dart_Port reply_port_id, | 603 Dart_Port reply_port_id, |
| 600 Dart_CObject* message); | 604 Dart_CObject* message); |
| 601 | 605 |
| 602 /** | 606 /** |
| 603 * Creates a new native port. When messages are received on this | 607 * Creates a new native port. When messages are received on this |
| 604 * native port, then they will be dispatched to the provided native | 608 * native port, then they will be dispatched to the provided native |
| 605 * message handler. | 609 * message handler. |
| 606 * | 610 * |
| 607 * \param name The name of this port in debugging messages. | 611 * \param name The name of this port in debugging messages. |
| (...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1461 | 1465 |
| 1462 // --- Profiling support ---- | 1466 // --- Profiling support ---- |
| 1463 | 1467 |
| 1464 // External pprof support for gathering and dumping symbolic | 1468 // External pprof support for gathering and dumping symbolic |
| 1465 // information that can be used for better profile reports for | 1469 // information that can be used for better profile reports for |
| 1466 // dynamically generated code. | 1470 // dynamically generated code. |
| 1467 DART_EXPORT void Dart_InitPprofSupport(); | 1471 DART_EXPORT void Dart_InitPprofSupport(); |
| 1468 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); | 1472 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); |
| 1469 | 1473 |
| 1470 #endif // INCLUDE_DART_API_H_ | 1474 #endif // INCLUDE_DART_API_H_ |
| OLD | NEW |