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 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 typedef void (*Dart_FileReadCallback)(const uint8_t** data, | 717 typedef void (*Dart_FileReadCallback)(const uint8_t** data, |
718 intptr_t* file_length, | 718 intptr_t* file_length, |
719 void* stream); | 719 void* stream); |
720 | 720 |
721 typedef void (*Dart_FileWriteCallback)(const void* data, | 721 typedef void (*Dart_FileWriteCallback)(const void* data, |
722 intptr_t length, | 722 intptr_t length, |
723 void* stream); | 723 void* stream); |
724 | 724 |
725 typedef void (*Dart_FileCloseCallback)(void* stream); | 725 typedef void (*Dart_FileCloseCallback)(void* stream); |
726 | 726 |
| 727 typedef bool (*Dart_EntropySource)(uint8_t* buffer, size_t length); |
727 | 728 |
728 /** | 729 /** |
729 * Initializes the VM. | 730 * Initializes the VM. |
730 * | 731 * |
731 * \param create A function to be called during isolate creation. | 732 * \param create A function to be called during isolate creation. |
732 * See Dart_IsolateCreateCallback. | 733 * See Dart_IsolateCreateCallback. |
733 * \param interrupt A function to be called when an isolate is interrupted. | 734 * \param interrupt A function to be called when an isolate is interrupted. |
734 * See Dart_IsolateInterruptCallback. | 735 * See Dart_IsolateInterruptCallback. |
735 * \param unhandled_exception A function to be called if an isolate has an | 736 * \param unhandled_exception A function to be called if an isolate has an |
736 * unhandled exception. Set Dart_IsolateUnhandledExceptionCallback. | 737 * unhandled exception. Set Dart_IsolateUnhandledExceptionCallback. |
737 * \param shutdown A function to be called when an isolate is shutdown. | 738 * \param shutdown A function to be called when an isolate is shutdown. |
738 * See Dart_IsolateShutdownCallback. | 739 * See Dart_IsolateShutdownCallback. |
739 * | 740 * |
740 * \return True if initialization is successful. | 741 * \return True if initialization is successful. |
741 */ | 742 */ |
742 DART_EXPORT bool Dart_Initialize( | 743 DART_EXPORT bool Dart_Initialize( |
743 Dart_IsolateCreateCallback create, | 744 Dart_IsolateCreateCallback create, |
744 Dart_IsolateInterruptCallback interrupt, | 745 Dart_IsolateInterruptCallback interrupt, |
745 Dart_IsolateUnhandledExceptionCallback unhandled_exception, | 746 Dart_IsolateUnhandledExceptionCallback unhandled_exception, |
746 Dart_IsolateShutdownCallback shutdown, | 747 Dart_IsolateShutdownCallback shutdown, |
747 Dart_FileOpenCallback file_open, | 748 Dart_FileOpenCallback file_open, |
748 Dart_FileReadCallback file_read, | 749 Dart_FileReadCallback file_read, |
749 Dart_FileWriteCallback file_write, | 750 Dart_FileWriteCallback file_write, |
750 Dart_FileCloseCallback file_close); | 751 Dart_FileCloseCallback file_close, |
| 752 Dart_EntropySource entropy_source); |
751 | 753 |
752 /** | 754 /** |
753 * Cleanup state in the VM before process termination. | 755 * Cleanup state in the VM before process termination. |
754 * | 756 * |
755 * \return True if cleanup is successful. | 757 * \return True if cleanup is successful. |
756 */ | 758 */ |
757 DART_EXPORT bool Dart_Cleanup(); | 759 DART_EXPORT bool Dart_Cleanup(); |
758 | 760 |
759 /** | 761 /** |
760 * Sets command line flags. Should be called before Dart_Initialize. | 762 * Sets command line flags. Should be called before Dart_Initialize. |
(...skipping 1576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2337 * | 2339 * |
2338 * \param object An object. | 2340 * \param object An object. |
2339 * \param peer A value to store in the peer field. | 2341 * \param peer A value to store in the peer field. |
2340 * | 2342 * |
2341 * \return Returns an error if 'object' is a subtype of Null, num, or | 2343 * \return Returns an error if 'object' is a subtype of Null, num, or |
2342 * bool. | 2344 * bool. |
2343 */ | 2345 */ |
2344 DART_EXPORT Dart_Handle Dart_SetPeer(Dart_Handle object, void* peer); | 2346 DART_EXPORT Dart_Handle Dart_SetPeer(Dart_Handle object, void* peer); |
2345 | 2347 |
2346 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ | 2348 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ |
OLD | NEW |