| 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(Crypto_GetRandomBytes, 1) \ |
| 24 V(Directory_Exists, 1) \ |
| 25 V(Directory_Create, 1) \ |
| 26 V(Directory_Current, 0) \ |
| 27 V(Directory_SetCurrent, 1) \ |
| 28 V(Directory_SystemTemp, 0) \ |
| 29 V(Directory_CreateTemp, 1) \ |
| 30 V(Directory_Delete, 2) \ |
| 31 V(Directory_Rename, 2) \ |
| 32 V(Directory_List, 3) \ |
| 23 V(EventHandler_SendData, 3) \ | 33 V(EventHandler_SendData, 3) \ |
| 34 V(File_Open, 2) \ |
| 35 V(File_Exists, 1) \ |
| 36 V(File_GetFD, 1) \ |
| 37 V(File_Close, 1) \ |
| 38 V(File_ReadByte, 1) \ |
| 39 V(File_WriteByte, 2) \ |
| 40 V(File_Read, 2) \ |
| 41 V(File_ReadInto, 4) \ |
| 42 V(File_WriteFrom, 4) \ |
| 43 V(File_Position, 1) \ |
| 44 V(File_SetPosition, 2) \ |
| 45 V(File_Truncate, 2) \ |
| 46 V(File_Length, 1) \ |
| 47 V(File_LengthFromPath, 1) \ |
| 48 V(File_Stat, 1) \ |
| 49 V(File_LastModified, 1) \ |
| 50 V(File_Flush, 1) \ |
| 51 V(File_Lock, 4) \ |
| 52 V(File_Create, 1) \ |
| 53 V(File_CreateLink, 2) \ |
| 54 V(File_LinkTarget, 1) \ |
| 55 V(File_Delete, 1) \ |
| 56 V(File_DeleteLink, 1) \ |
| 57 V(File_Rename, 2) \ |
| 58 V(File_Copy, 2) \ |
| 59 V(File_RenameLink, 2) \ |
| 60 V(File_ResolveSymbolicLinks, 1) \ |
| 61 V(File_OpenStdio, 1) \ |
| 62 V(File_GetStdioHandleType, 1) \ |
| 63 V(File_GetType, 2) \ |
| 64 V(File_AreIdentical, 2) \ |
| 24 V(FileSystemWatcher_CloseWatcher, 1) \ | 65 V(FileSystemWatcher_CloseWatcher, 1) \ |
| 25 V(FileSystemWatcher_GetSocketId, 2) \ | 66 V(FileSystemWatcher_GetSocketId, 2) \ |
| 26 V(FileSystemWatcher_InitWatcher, 0) \ | 67 V(FileSystemWatcher_InitWatcher, 0) \ |
| 27 V(FileSystemWatcher_IsSupported, 0) \ | 68 V(FileSystemWatcher_IsSupported, 0) \ |
| 28 V(FileSystemWatcher_ReadEvents, 2) \ | 69 V(FileSystemWatcher_ReadEvents, 2) \ |
| 29 V(FileSystemWatcher_UnwatchPath, 2) \ | 70 V(FileSystemWatcher_UnwatchPath, 2) \ |
| 30 V(FileSystemWatcher_WatchPath, 4) \ | 71 V(FileSystemWatcher_WatchPath, 4) \ |
| 31 V(Filter_CreateZLibDeflate, 8) \ | 72 V(Filter_CreateZLibDeflate, 8) \ |
| 32 V(Filter_CreateZLibInflate, 4) \ | 73 V(Filter_CreateZLibInflate, 4) \ |
| 33 V(Filter_End, 1) \ | 74 V(Filter_End, 1) \ |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 struct NativeEntries* entry = &(IOEntries[i]); | 177 struct NativeEntries* entry = &(IOEntries[i]); |
| 137 if (reinterpret_cast<Dart_NativeFunction>(entry->function_) == nf) { | 178 if (reinterpret_cast<Dart_NativeFunction>(entry->function_) == nf) { |
| 138 return reinterpret_cast<const uint8_t*>(entry->name_); | 179 return reinterpret_cast<const uint8_t*>(entry->name_); |
| 139 } | 180 } |
| 140 } | 181 } |
| 141 return NULL; | 182 return NULL; |
| 142 } | 183 } |
| 143 | 184 |
| 144 } // namespace bin | 185 } // namespace bin |
| 145 } // namespace dart | 186 } // namespace dart |
| OLD | NEW |