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 #ifndef BIN_IO_SERVICE_H_ | 5 #ifndef BIN_IO_SERVICE_H_ |
6 #define BIN_IO_SERVICE_H_ | 6 #define BIN_IO_SERVICE_H_ |
7 | 7 |
8 #include "bin/builtin.h" | 8 #include "bin/builtin.h" |
9 #include "bin/utils.h" | 9 #include "bin/utils.h" |
10 | 10 |
11 | 11 |
12 namespace dart { | 12 namespace dart { |
13 namespace bin { | 13 namespace bin { |
14 | 14 |
15 // This list must be kept in sync with the list in sdk/lib/io/io_service.dart | 15 // This list must be kept in sync with the list in sdk/lib/io/io_service.dart |
16 #define IO_SERVICE_REQUEST_LIST(V) \ | 16 #define IO_SERVICE_REQUEST_LIST(V) \ |
17 V(File, Exists, 0) \ | 17 V(File, Exists, 0) \ |
18 V(File, Create, 1) \ | 18 V(File, Create, 1) \ |
19 V(File, Delete, 2) \ | 19 V(File, Delete, 2) \ |
20 V(File, Rename, 3) \ | 20 V(File, Rename, 3) \ |
21 V(File, Open, 4) \ | 21 V(File, Copy, 4) \ |
22 V(File, ResolveSymbolicLinks, 5) \ | 22 V(File, Open, 5) \ |
23 V(File, Close, 6) \ | 23 V(File, ResolveSymbolicLinks, 6) \ |
24 V(File, Position, 7) \ | 24 V(File, Close, 7) \ |
25 V(File, SetPosition, 8) \ | 25 V(File, Position, 8) \ |
26 V(File, Truncate, 9) \ | 26 V(File, SetPosition, 9) \ |
27 V(File, Length, 10) \ | 27 V(File, Truncate, 10) \ |
28 V(File, LengthFromPath, 11) \ | 28 V(File, Length, 11) \ |
29 V(File, LastModified, 12) \ | 29 V(File, LengthFromPath, 12) \ |
30 V(File, Flush, 13) \ | 30 V(File, LastModified, 13) \ |
31 V(File, ReadByte, 14) \ | 31 V(File, Flush, 14) \ |
32 V(File, WriteByte, 15) \ | 32 V(File, ReadByte, 15) \ |
33 V(File, Read, 16) \ | 33 V(File, WriteByte, 16) \ |
34 V(File, ReadInto, 17) \ | 34 V(File, Read, 17) \ |
35 V(File, WriteFrom, 18) \ | 35 V(File, ReadInto, 18) \ |
36 V(File, CreateLink, 19) \ | 36 V(File, WriteFrom, 19) \ |
37 V(File, DeleteLink, 20) \ | 37 V(File, CreateLink, 20) \ |
38 V(File, RenameLink, 21) \ | 38 V(File, DeleteLink, 21) \ |
39 V(File, LinkTarget, 22) \ | 39 V(File, RenameLink, 22) \ |
40 V(File, Type, 23) \ | 40 V(File, LinkTarget, 23) \ |
41 V(File, Identical, 24) \ | 41 V(File, Type, 24) \ |
42 V(File, Stat, 25) \ | 42 V(File, Identical, 25) \ |
43 V(Socket, Lookup, 26) \ | 43 V(File, Stat, 26) \ |
44 V(Socket, ListInterfaces, 27) \ | 44 V(Socket, Lookup, 27) \ |
45 V(Socket, ReverseLookup, 28) \ | 45 V(Socket, ListInterfaces, 28) \ |
46 V(Directory, Create, 29) \ | 46 V(Socket, ReverseLookup, 29) \ |
47 V(Directory, Delete, 30) \ | 47 V(Directory, Create, 30) \ |
48 V(Directory, Exists, 31) \ | 48 V(Directory, Delete, 31) \ |
49 V(Directory, CreateTemp, 32) \ | 49 V(Directory, Exists, 32) \ |
50 V(Directory, ListStart, 33) \ | 50 V(Directory, CreateTemp, 33) \ |
51 V(Directory, ListNext, 34) \ | 51 V(Directory, ListStart, 34) \ |
52 V(Directory, ListStop, 35) \ | 52 V(Directory, ListNext, 35) \ |
53 V(Directory, Rename, 36) \ | 53 V(Directory, ListStop, 36) \ |
54 V(SSLFilter, ProcessFilter, 37) | 54 V(Directory, Rename, 37) \ |
| 55 V(SSLFilter, ProcessFilter, 38) |
55 | 56 |
56 #define DECLARE_REQUEST(type, method, id) \ | 57 #define DECLARE_REQUEST(type, method, id) \ |
57 k##type##method##Request = id, | 58 k##type##method##Request = id, |
58 | 59 |
59 class IOService { | 60 class IOService { |
60 public: | 61 public: |
61 enum { | 62 enum { |
62 IO_SERVICE_REQUEST_LIST(DECLARE_REQUEST) | 63 IO_SERVICE_REQUEST_LIST(DECLARE_REQUEST) |
63 }; | 64 }; |
64 | 65 |
65 static Dart_Port GetServicePort(); | 66 static Dart_Port GetServicePort(); |
66 }; | 67 }; |
67 | 68 |
68 } // namespace bin | 69 } // namespace bin |
69 } // namespace dart | 70 } // namespace dart |
70 | 71 |
71 #endif // BIN_IO_SERVICE_H_ | 72 #endif // BIN_IO_SERVICE_H_ |
OLD | NEW |