Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(751)

Side by Side Diff: runtime/bin/stdio.h

Issue 2585443002: Error checking for Stdio calls (Closed)
Patch Set: Fix Windows Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/bin/io_natives.cc ('k') | runtime/bin/stdio.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 RUNTIME_BIN_STDIO_H_ 5 #ifndef RUNTIME_BIN_STDIO_H_
6 #define RUNTIME_BIN_STDIO_H_ 6 #define RUNTIME_BIN_STDIO_H_
7 7
8 #if defined(DART_IO_DISABLED) 8 #if defined(DART_IO_DISABLED)
9 #error "stdio.h can only be included on builds with IO enabled" 9 #error "stdio.h can only be included on builds with IO enabled"
10 #endif 10 #endif
11 11
12 #include "bin/builtin.h" 12 #include "bin/builtin.h"
13 #include "bin/utils.h" 13 #include "bin/utils.h"
14 14
15 #include "platform/globals.h" 15 #include "platform/globals.h"
16 16
17 namespace dart { 17 namespace dart {
18 namespace bin { 18 namespace bin {
19 19
20 class Stdin { 20 class Stdin {
21 public: 21 public:
22 static int ReadByte(); 22 static bool ReadByte(int* byte);
23 23
24 static bool GetEchoMode(); 24 static bool GetEchoMode(bool* enabled);
25 static void SetEchoMode(bool enabled); 25 static bool SetEchoMode(bool enabled);
26 26
27 static bool GetLineMode(); 27 static bool GetLineMode(bool* enabled);
28 static void SetLineMode(bool enabled); 28 static bool SetLineMode(bool enabled);
29 29
30 private: 30 private:
31 DISALLOW_ALLOCATION(); 31 DISALLOW_ALLOCATION();
32 DISALLOW_IMPLICIT_CONSTRUCTORS(Stdin); 32 DISALLOW_IMPLICIT_CONSTRUCTORS(Stdin);
33 }; 33 };
34 34
35 35
36 class Stdout { 36 class Stdout {
37 public: 37 public:
38 static bool GetTerminalSize(intptr_t fd, int size[2]); 38 static bool GetTerminalSize(intptr_t fd, int size[2]);
39 39
40 private: 40 private:
41 DISALLOW_ALLOCATION(); 41 DISALLOW_ALLOCATION();
42 DISALLOW_IMPLICIT_CONSTRUCTORS(Stdout); 42 DISALLOW_IMPLICIT_CONSTRUCTORS(Stdout);
43 }; 43 };
44 44
45 } // namespace bin 45 } // namespace bin
46 } // namespace dart 46 } // namespace dart
47 47
48 #endif // RUNTIME_BIN_STDIO_H_ 48 #endif // RUNTIME_BIN_STDIO_H_
OLDNEW
« no previous file with comments | « runtime/bin/io_natives.cc ('k') | runtime/bin/stdio.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698