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

Unified Diff: runtime/bin/stdio.cc

Issue 102123010: Add getter for hasTerminal, terminalColumns and terminalLines on stdout. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add include of thread.h and fix io_patch. Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/stdio.h ('k') | runtime/bin/stdio_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/stdio.cc
diff --git a/runtime/bin/stdin.cc b/runtime/bin/stdio.cc
similarity index 75%
rename from runtime/bin/stdin.cc
rename to runtime/bin/stdio.cc
index ef7904af9a6cb3cd73849f12741ca7b9159560fa..916a3b8208f18fe434a43c6b02199c9f4c7588c6 100644
--- a/runtime/bin/stdin.cc
+++ b/runtime/bin/stdio.cc
@@ -5,7 +5,7 @@
#include "bin/builtin.h"
#include "bin/dartutils.h"
#include "bin/utils.h"
-#include "bin/stdin.h"
+#include "bin/stdio.h"
#include "platform/globals.h"
#include "platform/thread.h"
@@ -43,5 +43,18 @@ void FUNCTION_NAME(Stdin_SetLineMode)(Dart_NativeArguments args) {
Stdin::SetLineMode(enabled);
}
+
+void FUNCTION_NAME(Stdout_GetTerminalSize)(Dart_NativeArguments args) {
+ int size[2];
+ if (Stdout::GetTerminalSize(size)) {
+ Dart_Handle list = Dart_NewList(2);
+ Dart_ListSetAt(list, 0, Dart_NewInteger(size[0]));
+ Dart_ListSetAt(list, 1, Dart_NewInteger(size[1]));
+ Dart_SetReturnValue(args, list);
+ } else {
+ Dart_SetReturnValue(args, DartUtils::NewDartOSError());
+ }
+}
+
} // namespace bin
} // namespace dart
« no previous file with comments | « runtime/bin/stdio.h ('k') | runtime/bin/stdio_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698