| 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" |
| 11 | 11 |
| 12 #include "platform/assert.h" | 12 #include "platform/assert.h" |
| 13 | 13 |
| 14 #include "bin/builtin.h" | 14 #include "bin/builtin.h" |
| 15 #include "bin/dartutils.h" | 15 #include "bin/dartutils.h" |
| 16 #include "bin/embedded_dart_io.h" | 16 #include "bin/embedded_dart_io.h" |
| 17 #include "bin/file.h" | 17 #include "bin/file.h" |
| 18 #include "bin/io_natives.h" | 18 #include "bin/io_natives.h" |
| 19 #include "bin/platform.h" | 19 #include "bin/platform.h" |
| 20 | 20 |
| 21 namespace dart { | 21 namespace dart { |
| 22 namespace bin { | 22 namespace bin { |
| 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) \ | |
| 31 V(Builtin_AsyncLoadError, 3) \ | |
| 32 V(Builtin_DoneLoading, 0) \ | |
| 33 V(Builtin_GetCurrentDirectory, 0) \ | 30 V(Builtin_GetCurrentDirectory, 0) \ |
| 34 | 31 |
| 35 | 32 |
| 36 BUILTIN_NATIVE_LIST(DECLARE_FUNCTION); | 33 BUILTIN_NATIVE_LIST(DECLARE_FUNCTION); |
| 37 | 34 |
| 38 static struct NativeEntries { | 35 static struct NativeEntries { |
| 39 const char* name_; | 36 const char* name_; |
| 40 Dart_NativeFunction function_; | 37 Dart_NativeFunction function_; |
| 41 int argument_count_; | 38 int argument_count_; |
| 42 } BuiltinEntries[] = { | 39 } BuiltinEntries[] = { |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // For now we report print output on the Stdout stream. | 108 // For now we report print output on the Stdout stream. |
| 112 uint8_t newline[] = { '\n' }; | 109 uint8_t newline[] = { '\n' }; |
| 113 Dart_ServiceSendDataEvent("Stdout", "WriteEvent", chars, length); | 110 Dart_ServiceSendDataEvent("Stdout", "WriteEvent", chars, length); |
| 114 Dart_ServiceSendDataEvent("Stdout", "WriteEvent", | 111 Dart_ServiceSendDataEvent("Stdout", "WriteEvent", |
| 115 newline, sizeof(newline)); | 112 newline, sizeof(newline)); |
| 116 } | 113 } |
| 117 } | 114 } |
| 118 | 115 |
| 119 } // namespace bin | 116 } // namespace bin |
| 120 } // namespace dart | 117 } // namespace dart |
| OLD | NEW |