| 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" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 V(Platform_PathSeparator, 0) \ | 34 V(Platform_PathSeparator, 0) \ |
| 35 V(Platform_LocalHostname, 0) \ | 35 V(Platform_LocalHostname, 0) \ |
| 36 V(Platform_Environment, 0) \ | 36 V(Platform_Environment, 0) \ |
| 37 V(Platform_GetVersion, 0) \ | 37 V(Platform_GetVersion, 0) \ |
| 38 V(Process_Start, 10) \ | 38 V(Process_Start, 10) \ |
| 39 V(Process_Kill, 3) \ | 39 V(Process_Kill, 3) \ |
| 40 V(Process_SetExitCode, 1) \ | 40 V(Process_SetExitCode, 1) \ |
| 41 V(Process_Exit, 1) \ | 41 V(Process_Exit, 1) \ |
| 42 V(Process_Sleep, 1) \ | 42 V(Process_Sleep, 1) \ |
| 43 V(Process_Pid, 1) \ | 43 V(Process_Pid, 1) \ |
| 44 V(SecureSocket_Connect, 9) \ |
| 45 V(SecureSocket_Destroy, 1) \ |
| 46 V(SecureSocket_Handshake, 1) \ |
| 47 V(SecureSocket_Init, 1) \ |
| 48 V(SecureSocket_PeerCertificate, 1) \ |
| 49 V(SecureSocket_RegisterBadCertificateCallback, 2) \ |
| 50 V(SecureSocket_RegisterHandshakeCompleteCallback, 2) \ |
| 51 V(SecureSocket_InitializeLibrary, 3) \ |
| 52 V(SecureSocket_NewServicePort, 0) \ |
| 53 V(SecureSocket_FilterPointer, 1) \ |
| 44 V(ServerSocket_CreateBindListen, 5) \ | 54 V(ServerSocket_CreateBindListen, 5) \ |
| 45 V(ServerSocket_Accept, 2) \ | 55 V(ServerSocket_Accept, 2) \ |
| 46 V(Socket_CreateConnect, 3) \ | 56 V(Socket_CreateConnect, 3) \ |
| 47 V(Socket_Available, 1) \ | 57 V(Socket_Available, 1) \ |
| 48 V(Socket_Read, 2) \ | 58 V(Socket_Read, 2) \ |
| 49 V(Socket_WriteList, 4) \ | 59 V(Socket_WriteList, 4) \ |
| 50 V(Socket_GetPort, 1) \ | 60 V(Socket_GetPort, 1) \ |
| 51 V(Socket_GetRemotePeer, 1) \ | 61 V(Socket_GetRemotePeer, 1) \ |
| 52 V(Socket_GetError, 1) \ | 62 V(Socket_GetError, 1) \ |
| 53 V(Socket_GetStdioHandle, 2) \ | 63 V(Socket_GetStdioHandle, 2) \ |
| 54 V(Socket_NewServicePort, 0) \ | 64 V(Socket_NewServicePort, 0) \ |
| 55 V(Socket_GetType, 1) \ | 65 V(Socket_GetType, 1) \ |
| 56 V(Socket_SetOption, 3) \ | 66 V(Socket_SetOption, 3) \ |
| 57 V(SecureSocket_Connect, 9) \ | 67 V(Stdin_ReadByte, 1) \ |
| 58 V(SecureSocket_Destroy, 1) \ | |
| 59 V(SecureSocket_Handshake, 1) \ | |
| 60 V(SecureSocket_Init, 1) \ | |
| 61 V(SecureSocket_PeerCertificate, 1) \ | |
| 62 V(SecureSocket_RegisterBadCertificateCallback, 2) \ | |
| 63 V(SecureSocket_RegisterHandshakeCompleteCallback, 2) \ | |
| 64 V(SecureSocket_InitializeLibrary, 3) \ | |
| 65 V(SecureSocket_NewServicePort, 0) \ | |
| 66 V(SecureSocket_FilterPointer, 1) \ | |
| 67 V(StringToSystemEncoding, 1) \ | 68 V(StringToSystemEncoding, 1) \ |
| 68 V(SystemEncodingToString, 1) | 69 V(SystemEncodingToString, 1) |
| 69 | 70 |
| 70 | 71 |
| 71 IO_NATIVE_LIST(DECLARE_FUNCTION); | 72 IO_NATIVE_LIST(DECLARE_FUNCTION); |
| 72 | 73 |
| 73 static struct NativeEntries { | 74 static struct NativeEntries { |
| 74 const char* name_; | 75 const char* name_; |
| 75 Dart_NativeFunction function_; | 76 Dart_NativeFunction function_; |
| 76 int argument_count_; | 77 int argument_count_; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 91 if (!strcmp(function_name, entry->name_) && | 92 if (!strcmp(function_name, entry->name_) && |
| 92 (entry->argument_count_ == argument_count)) { | 93 (entry->argument_count_ == argument_count)) { |
| 93 return reinterpret_cast<Dart_NativeFunction>(entry->function_); | 94 return reinterpret_cast<Dart_NativeFunction>(entry->function_); |
| 94 } | 95 } |
| 95 } | 96 } |
| 96 return NULL; | 97 return NULL; |
| 97 } | 98 } |
| 98 | 99 |
| 99 } // namespace bin | 100 } // namespace bin |
| 100 } // namespace dart | 101 } // namespace dart |
| OLD | NEW |