OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 "bin/io_natives.h" | 5 #include "bin/io_natives.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include "bin/builtin.h" | 10 #include "bin/builtin.h" |
11 #include "bin/dartutils.h" | 11 #include "bin/dartutils.h" |
12 #include "include/dart_api.h" | 12 #include "include/dart_api.h" |
13 #include "platform/assert.h" | 13 #include "platform/assert.h" |
14 | 14 |
15 | 15 |
16 namespace dart { | 16 namespace dart { |
17 namespace bin { | 17 namespace bin { |
18 | 18 |
19 // Lists the native functions implementing advanced dart:io classes. | 19 // Lists the native functions implementing advanced dart:io classes. |
20 // Some classes, like File and Directory, list their implementations in | 20 // Some classes, like File and Directory, list their implementations in |
21 // builtin_natives.cc instead. | 21 // builtin_natives.cc instead. |
22 #define IO_NATIVE_LIST(V) \ | 22 #define IO_NATIVE_LIST(V) \ |
23 V(Common_IsBuiltinList, 1) \ | 23 V(Common_IsBuiltinList, 1) \ |
24 V(Common_GetVersion, 1) \ | |
25 V(Crypto_GetRandomBytes, 1) \ | 24 V(Crypto_GetRandomBytes, 1) \ |
26 V(EventHandler_Start, 1) \ | 25 V(EventHandler_Start, 1) \ |
27 V(EventHandler_SendData, 4) \ | 26 V(EventHandler_SendData, 4) \ |
28 V(Filter_CreateZLibDeflate, 3) \ | 27 V(Filter_CreateZLibDeflate, 3) \ |
29 V(Filter_CreateZLibInflate, 1) \ | 28 V(Filter_CreateZLibInflate, 1) \ |
30 V(Filter_End, 1) \ | 29 V(Filter_End, 1) \ |
31 V(Filter_Process, 2) \ | 30 V(Filter_Process, 2) \ |
32 V(Filter_Processed, 3) \ | 31 V(Filter_Processed, 3) \ |
33 V(InternetAddress_Fixed, 1) \ | 32 V(InternetAddress_Fixed, 1) \ |
34 V(Platform_NumberOfProcessors, 0) \ | 33 V(Platform_NumberOfProcessors, 0) \ |
35 V(Platform_OperatingSystem, 0) \ | 34 V(Platform_OperatingSystem, 0) \ |
36 V(Platform_PathSeparator, 0) \ | 35 V(Platform_PathSeparator, 0) \ |
37 V(Platform_LocalHostname, 0) \ | 36 V(Platform_LocalHostname, 0) \ |
38 V(Platform_Environment, 0) \ | 37 V(Platform_Environment, 0) \ |
| 38 V(Platform_GetVersion, 0) \ |
39 V(Process_Start, 10) \ | 39 V(Process_Start, 10) \ |
40 V(Process_Kill, 3) \ | 40 V(Process_Kill, 3) \ |
41 V(Process_SetExitCode, 1) \ | 41 V(Process_SetExitCode, 1) \ |
42 V(Process_Exit, 1) \ | 42 V(Process_Exit, 1) \ |
43 V(Process_Sleep, 1) \ | 43 V(Process_Sleep, 1) \ |
44 V(Process_Pid, 1) \ | 44 V(Process_Pid, 1) \ |
45 V(ServerSocket_CreateBindListen, 5) \ | 45 V(ServerSocket_CreateBindListen, 5) \ |
46 V(ServerSocket_Accept, 2) \ | 46 V(ServerSocket_Accept, 2) \ |
47 V(Socket_CreateConnect, 3) \ | 47 V(Socket_CreateConnect, 3) \ |
48 V(Socket_Available, 1) \ | 48 V(Socket_Available, 1) \ |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 if (!strcmp(function_name, entry->name_) && | 93 if (!strcmp(function_name, entry->name_) && |
94 (entry->argument_count_ == argument_count)) { | 94 (entry->argument_count_ == argument_count)) { |
95 return reinterpret_cast<Dart_NativeFunction>(entry->function_); | 95 return reinterpret_cast<Dart_NativeFunction>(entry->function_); |
96 } | 96 } |
97 } | 97 } |
98 return NULL; | 98 return NULL; |
99 } | 99 } |
100 | 100 |
101 } // namespace bin | 101 } // namespace bin |
102 } // namespace dart | 102 } // namespace dart |
OLD | NEW |