| 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 #include <stdlib.h> | 5 #include <stdlib.h> |
| 6 #include <stdio.h> | 6 #include <stdio.h> |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "include/dart_api.h" | 9 #include "include/dart_api.h" |
| 10 #include "include/dart_tools_api.h" | 10 #include "include/dart_tools_api.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 // Lists the native functions implementing basic functionality in | 24 // Lists the native functions implementing basic functionality in |
| 25 // standalone dart, such as printing, file I/O, and platform information. | 25 // standalone dart, such as printing, file I/O, and platform information. |
| 26 // Advanced I/O classes like sockets and process management are implemented | 26 // Advanced I/O classes like sockets and process management are implemented |
| 27 // using functions listed in io_natives.cc. | 27 // using functions listed in io_natives.cc. |
| 28 #define BUILTIN_NATIVE_LIST(V) \ | 28 #define BUILTIN_NATIVE_LIST(V) \ |
| 29 V(Builtin_PrintString, 1) \ | 29 V(Builtin_PrintString, 1) \ |
| 30 V(Builtin_LoadSource, 4) \ | 30 V(Builtin_LoadSource, 4) \ |
| 31 V(Builtin_AsyncLoadError, 3) \ | 31 V(Builtin_AsyncLoadError, 3) \ |
| 32 V(Builtin_DoneLoading, 0) \ | 32 V(Builtin_DoneLoading, 0) \ |
| 33 V(Builtin_NativeLibraryExtension, 0) \ | |
| 34 V(Builtin_GetCurrentDirectory, 0) \ | 33 V(Builtin_GetCurrentDirectory, 0) \ |
| 35 | 34 |
| 36 | 35 |
| 37 BUILTIN_NATIVE_LIST(DECLARE_FUNCTION); | 36 BUILTIN_NATIVE_LIST(DECLARE_FUNCTION); |
| 38 | 37 |
| 39 static struct NativeEntries { | 38 static struct NativeEntries { |
| 40 const char* name_; | 39 const char* name_; |
| 41 Dart_NativeFunction function_; | 40 Dart_NativeFunction function_; |
| 42 int argument_count_; | 41 int argument_count_; |
| 43 } BuiltinEntries[] = { | 42 } BuiltinEntries[] = { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // For now we report print output on the Stdout stream. | 100 // For now we report print output on the Stdout stream. |
| 102 uint8_t newline[] = { '\n' }; | 101 uint8_t newline[] = { '\n' }; |
| 103 Dart_ServiceSendDataEvent("Stdout", "WriteEvent", chars, length); | 102 Dart_ServiceSendDataEvent("Stdout", "WriteEvent", chars, length); |
| 104 Dart_ServiceSendDataEvent("Stdout", "WriteEvent", | 103 Dart_ServiceSendDataEvent("Stdout", "WriteEvent", |
| 105 newline, sizeof(newline)); | 104 newline, sizeof(newline)); |
| 106 } | 105 } |
| 107 } | 106 } |
| 108 | 107 |
| 109 } // namespace bin | 108 } // namespace bin |
| 110 } // namespace dart | 109 } // namespace dart |
| OLD | NEW |