| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 #if !defined(DART_IO_DISABLED) |
| 6 |
| 7 #include "bin/process.h" |
| 8 |
| 5 #include "bin/dartutils.h" | 9 #include "bin/dartutils.h" |
| 6 #include "bin/io_buffer.h" | 10 #include "bin/io_buffer.h" |
| 7 #include "bin/log.h" | 11 #include "bin/log.h" |
| 8 #include "bin/platform.h" | 12 #include "bin/platform.h" |
| 9 #include "bin/process.h" | |
| 10 #include "bin/socket.h" | 13 #include "bin/socket.h" |
| 11 #include "bin/utils.h" | 14 #include "bin/utils.h" |
| 12 | 15 |
| 13 #include "include/dart_api.h" | 16 #include "include/dart_api.h" |
| 14 | 17 |
| 15 namespace dart { | 18 namespace dart { |
| 16 namespace bin { | 19 namespace bin { |
| 17 | 20 |
| 18 static const int kProcessIdNativeField = 0; | 21 static const int kProcessIdNativeField = 0; |
| 19 | 22 |
| 20 int Process::global_exit_code_ = 0; | |
| 21 Mutex* Process::global_exit_code_mutex_ = new Mutex(); | |
| 22 | |
| 23 // Extract an array of C strings from a list of Dart strings. | 23 // Extract an array of C strings from a list of Dart strings. |
| 24 static char** ExtractCStringList(Dart_Handle strings, | 24 static char** ExtractCStringList(Dart_Handle strings, |
| 25 Dart_Handle status_handle, | 25 Dart_Handle status_handle, |
| 26 const char* error_msg, | 26 const char* error_msg, |
| 27 intptr_t* length) { | 27 intptr_t* length) { |
| 28 static const intptr_t kMaxArgumentListLength = 1024 * 1024; | 28 static const intptr_t kMaxArgumentListLength = 1024 * 1024; |
| 29 ASSERT(Dart_IsList(strings)); | 29 ASSERT(Dart_IsList(strings)); |
| 30 intptr_t len = 0; | 30 intptr_t len = 0; |
| 31 Dart_Handle result = Dart_ListLength(strings, &len); | 31 Dart_Handle result = Dart_ListLength(strings, &len); |
| 32 if (Dart_IsError(result)) { | 32 if (Dart_IsError(result)) { |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 uint8_t* buffer = NULL; | 360 uint8_t* buffer = NULL; |
| 361 Dart_Handle external_array = IOBuffer::Allocate(system_len, &buffer); | 361 Dart_Handle external_array = IOBuffer::Allocate(system_len, &buffer); |
| 362 if (!Dart_IsError(external_array)) { | 362 if (!Dart_IsError(external_array)) { |
| 363 memmove(buffer, system_string, system_len); | 363 memmove(buffer, system_string, system_len); |
| 364 } | 364 } |
| 365 Dart_SetReturnValue(args, external_array); | 365 Dart_SetReturnValue(args, external_array); |
| 366 } | 366 } |
| 367 | 367 |
| 368 } // namespace bin | 368 } // namespace bin |
| 369 } // namespace dart | 369 } // namespace dart |
| 370 |
| 371 #endif // !defined(DART_IO_DISABLED) |
| OLD | NEW |