| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |