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 | 10 |
11 #include "platform/assert.h" | 11 #include "platform/assert.h" |
12 | 12 |
13 #include "bin/builtin.h" | 13 #include "bin/builtin.h" |
14 #include "bin/dartutils.h" | 14 #include "bin/dartutils.h" |
15 #include "bin/io_natives.h" | 15 #include "bin/io_natives.h" |
16 #include "bin/platform.h" | 16 #include "bin/platform.h" |
17 | 17 |
18 namespace dart { | 18 namespace dart { |
19 namespace bin { | 19 namespace bin { |
20 | 20 |
21 // Lists the native functions implementing basic functionality in | 21 // Lists the native functions implementing basic functionality in |
22 // standalone dart, such as printing, file I/O, and platform information. | 22 // standalone dart, such as printing, file I/O, and platform information. |
23 // Advanced I/O classes like sockets and process management are implemented | 23 // Advanced I/O classes like sockets and process management are implemented |
24 // using functions listed in io_natives.cc. | 24 // using functions listed in io_natives.cc. |
25 #define BUILTIN_NATIVE_LIST(V) \ | 25 #define BUILTIN_NATIVE_LIST(V) \ |
26 V(Directory_Exists, 1) \ | 26 V(Directory_Exists, 1) \ |
27 V(Directory_Create, 1) \ | 27 V(Directory_Create, 1) \ |
28 V(Directory_Current, 0) \ | 28 V(Directory_Current, 0) \ |
29 V(Directory_SetCurrent, 1) \ | 29 V(Directory_SetCurrent, 1) \ |
30 V(Directory_CreateTemp, 2) \ | 30 V(Directory_SystemTemp, 0) \ |
| 31 V(Directory_CreateTemp, 1) \ |
31 V(Directory_Delete, 2) \ | 32 V(Directory_Delete, 2) \ |
32 V(Directory_Rename, 2) \ | 33 V(Directory_Rename, 2) \ |
33 V(Directory_List, 3) \ | 34 V(Directory_List, 3) \ |
34 V(File_Open, 2) \ | 35 V(File_Open, 2) \ |
35 V(File_Exists, 1) \ | 36 V(File_Exists, 1) \ |
36 V(File_Close, 1) \ | 37 V(File_Close, 1) \ |
37 V(File_ReadByte, 1) \ | 38 V(File_ReadByte, 1) \ |
38 V(File_WriteByte, 2) \ | 39 V(File_WriteByte, 2) \ |
39 V(File_Read, 2) \ | 40 V(File_Read, 2) \ |
40 V(File_ReadInto, 4) \ | 41 V(File_ReadInto, 4) \ |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 // Dart_StringToUTF8? We need to make sure not to swallow the | 111 // Dart_StringToUTF8? We need to make sure not to swallow the |
111 // interrupt. | 112 // interrupt. |
112 Platform::PrintBlocking(stdout, "%s\n", Dart_GetError(result)); | 113 Platform::PrintBlocking(stdout, "%s\n", Dart_GetError(result)); |
113 } else { | 114 } else { |
114 Platform::PrintBlocking(stdout, "%.*s\n", static_cast<int>(length), chars); | 115 Platform::PrintBlocking(stdout, "%.*s\n", static_cast<int>(length), chars); |
115 } | 116 } |
116 } | 117 } |
117 | 118 |
118 } // namespace bin | 119 } // namespace bin |
119 } // namespace dart | 120 } // namespace dart |
OLD | NEW |