Chromium Code Reviews| 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 21 matching lines...) Expand all Loading... | |
| 32 #endif | 32 #endif |
| 33 // Define integer types. | 33 // Define integer types. |
| 34 typedef signed __int8 int8_t; | 34 typedef signed __int8 int8_t; |
| 35 typedef signed __int16 int16_t; | 35 typedef signed __int16 int16_t; |
| 36 typedef signed __int32 int32_t; | 36 typedef signed __int32 int32_t; |
| 37 typedef signed __int64 int64_t; | 37 typedef signed __int64 int64_t; |
| 38 typedef unsigned __int8 uint8_t; | 38 typedef unsigned __int8 uint8_t; |
| 39 typedef unsigned __int16 uint16_t; | 39 typedef unsigned __int16 uint16_t; |
| 40 typedef unsigned __int32 uint32_t; | 40 typedef unsigned __int32 uint32_t; |
| 41 typedef unsigned __int64 uint64_t; | 41 typedef unsigned __int64 uint64_t; |
| 42 #define CHECK_RESULT | |
|
Ivan Posva
2015/08/17 13:35:51
?
zra
2015/08/18 06:23:14
Removed
| |
| 42 #if defined(DART_SHARED_LIB) | 43 #if defined(DART_SHARED_LIB) |
| 43 #define DART_EXPORT DART_EXTERN_C __declspec(dllexport) | 44 #define DART_EXPORT DART_EXTERN_C __declspec(dllexport) |
| 44 #else | 45 #else |
| 45 #define DART_EXPORT DART_EXTERN_C | 46 #define DART_EXPORT DART_EXTERN_C |
| 46 #endif | 47 #endif |
| 47 #else | 48 #else |
| 48 /* __STDC_FORMAT_MACROS has to be defined before including <inttypes.h> to | 49 /* __STDC_FORMAT_MACROS has to be defined before including <inttypes.h> to |
| 49 * enable platform independent printf format specifiers. */ | 50 * enable platform independent printf format specifiers. */ |
| 50 #ifndef __STDC_FORMAT_MACROS | 51 #ifndef __STDC_FORMAT_MACROS |
| 51 #define __STDC_FORMAT_MACROS | 52 #define __STDC_FORMAT_MACROS |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 361 */ | 362 */ |
| 362 #define DART_CHECK_VALID(handle) \ | 363 #define DART_CHECK_VALID(handle) \ |
| 363 { \ | 364 { \ |
| 364 Dart_Handle __handle = handle; \ | 365 Dart_Handle __handle = handle; \ |
| 365 if (Dart_IsError((__handle))) { \ | 366 if (Dart_IsError((__handle))) { \ |
| 366 _Dart_ReportErrorHandle(__FILE__, __LINE__, \ | 367 _Dart_ReportErrorHandle(__FILE__, __LINE__, \ |
| 367 #handle, Dart_GetError(__handle)); \ | 368 #handle, Dart_GetError(__handle)); \ |
| 368 } \ | 369 } \ |
| 369 } \ | 370 } \ |
| 370 | 371 |
| 371 | |
| 372 /** | 372 /** |
| 373 * Converts an object to a string. | 373 * Converts an object to a string. |
| 374 * | 374 * |
| 375 * May generate an unhandled exception error. | 375 * May generate an unhandled exception error. |
| 376 * | 376 * |
| 377 * \return The converted string if no error occurs during | 377 * \return The converted string if no error occurs during |
| 378 * the conversion. If an error does occur, an error handle is | 378 * the conversion. If an error does occur, an error handle is |
| 379 * returned. | 379 * returned. |
| 380 */ | 380 */ |
| 381 DART_EXPORT Dart_Handle Dart_ToString(Dart_Handle object); | 381 DART_EXPORT Dart_Handle Dart_ToString(Dart_Handle object); |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 854 * or NULL if no snapshot is provided. | 854 * or NULL if no snapshot is provided. |
| 855 * \param create A function to be called during isolate creation. | 855 * \param create A function to be called during isolate creation. |
| 856 * See Dart_IsolateCreateCallback. | 856 * See Dart_IsolateCreateCallback. |
| 857 * \param interrupt A function to be called when an isolate is interrupted. | 857 * \param interrupt A function to be called when an isolate is interrupted. |
| 858 * See Dart_IsolateInterruptCallback. | 858 * See Dart_IsolateInterruptCallback. |
| 859 * \param unhandled_exception A function to be called if an isolate has an | 859 * \param unhandled_exception A function to be called if an isolate has an |
| 860 * unhandled exception. Set Dart_IsolateUnhandledExceptionCallback. | 860 * unhandled exception. Set Dart_IsolateUnhandledExceptionCallback. |
| 861 * \param shutdown A function to be called when an isolate is shutdown. | 861 * \param shutdown A function to be called when an isolate is shutdown. |
| 862 * See Dart_IsolateShutdownCallback. | 862 * See Dart_IsolateShutdownCallback. |
| 863 * | 863 * |
| 864 * \return True if initialization is successful. | 864 * \return NULL if initialization is successful. Returns an error message |
| 865 * otherwise. The caller is responsible for freeing the error message. | |
| 865 */ | 866 */ |
| 866 DART_EXPORT bool Dart_Initialize( | 867 DART_EXPORT char* Dart_Initialize( |
|
Ivan Posva
2015/08/17 13:35:51
const char*
zra
2015/08/18 06:23:14
See above.
| |
| 867 const uint8_t* vm_isolate_snapshot, | 868 const uint8_t* vm_isolate_snapshot, |
| 868 Dart_IsolateCreateCallback create, | 869 Dart_IsolateCreateCallback create, |
| 869 Dart_IsolateInterruptCallback interrupt, | 870 Dart_IsolateInterruptCallback interrupt, |
| 870 Dart_IsolateUnhandledExceptionCallback unhandled_exception, | 871 Dart_IsolateUnhandledExceptionCallback unhandled_exception, |
| 871 Dart_IsolateShutdownCallback shutdown, | 872 Dart_IsolateShutdownCallback shutdown, |
| 872 Dart_FileOpenCallback file_open, | 873 Dart_FileOpenCallback file_open, |
| 873 Dart_FileReadCallback file_read, | 874 Dart_FileReadCallback file_read, |
| 874 Dart_FileWriteCallback file_write, | 875 Dart_FileWriteCallback file_write, |
| 875 Dart_FileCloseCallback file_close, | 876 Dart_FileCloseCallback file_close, |
| 876 Dart_EntropySource entropy_source); | 877 Dart_EntropySource entropy_source); |
| 877 | 878 |
| 878 /** | 879 /** |
| 879 * Cleanup state in the VM before process termination. | 880 * Cleanup state in the VM before process termination. |
| 880 * | 881 * |
| 881 * \return True if cleanup is successful. | 882 * \return NULL if cleanup is successful. Returns an error message otherwise. |
| 883 * The caller is responsible for freeing the error message. | |
| 882 */ | 884 */ |
| 883 DART_EXPORT bool Dart_Cleanup(); | 885 DART_EXPORT char* Dart_Cleanup(); |
|
Ivan Posva
2015/08/17 13:35:51
const char*
zra
2015/08/18 06:23:14
See above.
| |
| 884 | 886 |
| 885 /** | 887 /** |
| 886 * Sets command line flags. Should be called before Dart_Initialize. | 888 * Sets command line flags. Should be called before Dart_Initialize. |
| 887 * | 889 * |
| 888 * \param argc The length of the arguments array. | 890 * \param argc The length of the arguments array. |
| 889 * \param argv An array of arguments. | 891 * \param argv An array of arguments. |
| 890 * | 892 * |
| 891 * \return True if VM flags set successfully. | 893 * \return True if VM flags set successfully. |
| 892 */ | 894 */ |
| 893 DART_EXPORT bool Dart_SetVMFlags(int argc, const char** argv); | 895 DART_EXPORT bool Dart_SetVMFlags(int argc, const char** argv); |
| (...skipping 1939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2833 | 2835 |
| 2834 /** | 2836 /** |
| 2835 * Returns the port that script load requests should be sent on. | 2837 * Returns the port that script load requests should be sent on. |
| 2836 * | 2838 * |
| 2837 * \return Returns the port for load requests or ILLEGAL_PORT if the service | 2839 * \return Returns the port for load requests or ILLEGAL_PORT if the service |
| 2838 * isolate failed to startup or does not support load requests. | 2840 * isolate failed to startup or does not support load requests. |
| 2839 */ | 2841 */ |
| 2840 DART_EXPORT Dart_Port Dart_ServiceWaitForLoadPort(); | 2842 DART_EXPORT Dart_Port Dart_ServiceWaitForLoadPort(); |
| 2841 | 2843 |
| 2842 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ | 2844 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ |
| OLD | NEW |