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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/file.h ('k') | runtime/bin/file_impl.dart » ('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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #include "bin/file.h" 5 #include "bin/file.h"
6 6
7 #include "bin/builtin.h" 7 #include "bin/builtin.h"
8 #include "bin/dartutils.h" 8 #include "bin/dartutils.h"
9 9
10 #include "include/dart_api.h" 10 #include "include/dart_api.h"
11 11
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 Dart_EnterScope(); 317 Dart_EnterScope();
318 const char* str = 318 const char* str =
319 DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0)); 319 DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0));
320 char* path = File::GetCanonicalPath(str); 320 char* path = File::GetCanonicalPath(str);
321 if (path != NULL) { 321 if (path != NULL) {
322 Dart_SetReturnValue(args, Dart_NewString(path)); 322 Dart_SetReturnValue(args, Dart_NewString(path));
323 free(path); 323 free(path);
324 } 324 }
325 Dart_ExitScope(); 325 Dart_ExitScope();
326 } 326 }
327
328
329 void FUNCTION_NAME(File_OpenStdio)(Dart_NativeArguments args) {
330 Dart_EnterScope();
331 int fd = DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 0));
332 File* file = File::OpenStdio(fd);
333 Dart_SetReturnValue(args, Dart_NewInteger(reinterpret_cast<intptr_t>(file)));
334 Dart_ExitScope();
335 }
336
337
338 void FUNCTION_NAME(File_GetStdioHandleType)(Dart_NativeArguments args) {
339 Dart_EnterScope();
340 int fd = DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 0));
341 File::StdioHandleType type = File::GetStdioHandleType(fd);
342 Dart_SetReturnValue(args, Dart_NewInteger(type));
343 Dart_ExitScope();
344 }
OLDNEW
« 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