OLD | NEW |
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 /// Access to the operating system. Only supported when Dartino is running on a | 5 /// Access to the operating system. Only supported when Dartino is running on a |
6 /// Posix platform. | 6 /// Posix platform. |
7 /// | 7 /// |
8 /// Usage | 8 /// Usage |
9 /// ----- | 9 /// ----- |
10 /// ```dart | 10 /// ```dart |
11 /// import 'package:os/os.dart'; | 11 /// import 'package:os/os.dart'; |
12 /// | 12 /// |
13 /// main() { | 13 /// main() { |
14 /// SystemInformation si = sys.info(); | 14 /// SystemInformation si = sys.info(); |
15 /// print('Hello from ${si.operatingSystemName} running on ${si.nodeName}.'); | 15 /// print('Hello from ${si.operatingSystemName} running on ${si.nodeName}.'); |
16 /// } | 16 /// } |
17 /// ``` | 17 /// ``` |
18 /// | 18 /// |
19 /// Reporting issues | 19 /// Reporting issues |
20 /// ---------------- | 20 /// ---------------- |
21 /// Please file an issue [in the issue | 21 /// Please file an issue [in the issue |
22 /// tracker](https://github.com/dartino/sdk/issues/new?title=Add%20title&labels=
Area-Package&body=%3Cissue%20description%3E%0A%3Crepro%20steps%3E%0A%3Cexpected%
20outcome%3E%0A%3Cactual%20outcome%3E). | 22 /// tracker](https://github.com/dartino/sdk/issues/new?title=Add%20title&labels=
Area-Package&body=%3Cissue%20description%3E%0A%3Crepro%20steps%3E%0A%3Cexpected%
20outcome%3E%0A%3Cactual%20outcome%3E). |
23 library os; | 23 library os; |
24 | 24 |
25 import 'dart:fletch'; | 25 import 'dart:dartino'; |
26 import 'dart:fletch.ffi'; | 26 import 'dart:dartino.ffi'; |
27 import 'dart:fletch.os' as os; | 27 import 'dart:dartino.os' as os; |
28 import 'dart:typed_data'; | 28 import 'dart:typed_data'; |
29 import 'package:ffi/ffi.dart'; | 29 import 'package:ffi/ffi.dart'; |
30 | 30 |
31 part 'errno.dart'; | 31 part 'errno.dart'; |
32 | 32 |
33 part 'net_structs.dart'; | 33 part 'net_structs.dart'; |
34 part 'net_structs_android.dart'; | 34 part 'net_structs_android.dart'; |
35 part 'net_structs_linux.dart'; | 35 part 'net_structs_linux.dart'; |
36 part 'net_structs_macos.dart'; | 36 part 'net_structs_macos.dart'; |
37 part 'net_structs_posix.dart'; | 37 part 'net_structs_posix.dart'; |
38 | 38 |
39 part 'system.dart'; | 39 part 'system.dart'; |
40 part 'system_linux.dart'; | 40 part 'system_linux.dart'; |
41 part 'system_macos.dart'; | 41 part 'system_macos.dart'; |
42 part 'system_posix.dart'; | 42 part 'system_posix.dart'; |
43 | 43 |
44 abstract class InternetAddress { | 44 abstract class InternetAddress { |
45 factory InternetAddress(List<int> bytes) = _InternetAddress; | 45 factory InternetAddress(List<int> bytes) = _InternetAddress; |
46 bool get isIP4; | 46 bool get isIP4; |
47 } | 47 } |
48 | 48 |
49 // TODO(ajohnsen): Take a Duration? | 49 // TODO(ajohnsen): Take a Duration? |
50 void sleep(int milliseconds) => sys.sleep(milliseconds); | 50 void sleep(int milliseconds) => sys.sleep(milliseconds); |
51 int errno() => sys.errno(); | 51 int errno() => sys.errno(); |
OLD | NEW |