| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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/dartutils.h" | 5 #include "bin/dartutils.h" |
| 6 #include "bin/process.h" | 6 #include "bin/process.h" |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 | 9 |
| 10 void FUNCTION_NAME(Process_Start)(Dart_NativeArguments args) { | 10 void FUNCTION_NAME(Process_Start)(Dart_NativeArguments args) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 DartUtils::SetIntegerInstanceField( | 54 DartUtils::SetIntegerInstanceField( |
| 55 status_handle, "_errorCode", error_code); | 55 status_handle, "_errorCode", error_code); |
| 56 DartUtils::SetStringInstanceField( | 56 DartUtils::SetStringInstanceField( |
| 57 status_handle, "_errorMessage", os_error_message); | 57 status_handle, "_errorMessage", os_error_message); |
| 58 } | 58 } |
| 59 delete[] string_args; | 59 delete[] string_args; |
| 60 Dart_SetReturnValue(args, Dart_NewBoolean(error_code == 0)); | 60 Dart_SetReturnValue(args, Dart_NewBoolean(error_code == 0)); |
| 61 Dart_ExitScope(); | 61 Dart_ExitScope(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 |
| 64 void FUNCTION_NAME(Process_Kill)(Dart_NativeArguments args) { | 65 void FUNCTION_NAME(Process_Kill)(Dart_NativeArguments args) { |
| 65 Dart_EnterScope(); | 66 Dart_EnterScope(); |
| 66 intptr_t pid = DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 1)); | 67 intptr_t pid = DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 1)); |
| 67 bool success = Process::Kill(pid); | 68 bool success = Process::Kill(pid); |
| 68 Dart_SetReturnValue(args, Dart_NewBoolean(success)); | 69 Dart_SetReturnValue(args, Dart_NewBoolean(success)); |
| 69 Dart_ExitScope(); | 70 Dart_ExitScope(); |
| 70 } | 71 } |
| 72 |
| 73 |
| 74 void FUNCTION_NAME(Process_Exit)(Dart_NativeArguments args) { |
| 75 Dart_EnterScope(); |
| 76 intptr_t pid = DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 1)); |
| 77 Process::Exit(pid); |
| 78 Dart_ExitScope(); |
| 79 } |
| OLD | NEW |