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

Unified Diff: runtime/bin/file.cc

Issue 9360040: Handle stdio redirection in standalone VM (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revert test change Created 8 years, 10 months 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/file.h ('k') | runtime/bin/file_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file.cc
diff --git a/runtime/bin/file.cc b/runtime/bin/file.cc
index 75e9d9232665eefa961714fc6b3cb026108eef72..9eedc8579206a092f6931360747e25c844317c87 100644
--- a/runtime/bin/file.cc
+++ b/runtime/bin/file.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -324,3 +324,21 @@ void FUNCTION_NAME(File_FullPath)(Dart_NativeArguments args) {
}
Dart_ExitScope();
}
+
+
+void FUNCTION_NAME(File_OpenStdio)(Dart_NativeArguments args) {
+ Dart_EnterScope();
+ int fd = DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 0));
+ File* file = File::OpenStdio(fd);
+ Dart_SetReturnValue(args, Dart_NewInteger(reinterpret_cast<intptr_t>(file)));
+ Dart_ExitScope();
+}
+
+
+void FUNCTION_NAME(File_GetStdioHandleType)(Dart_NativeArguments args) {
+ Dart_EnterScope();
+ int fd = DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 0));
+ File::StdioHandleType type = File::GetStdioHandleType(fd);
+ Dart_SetReturnValue(args, Dart_NewInteger(type));
+ Dart_ExitScope();
+}
« no previous file with comments | « runtime/bin/file.h ('k') | runtime/bin/file_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698