| OLD | NEW |
| 1 // Copyright (c) 2012, 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 <stdlib.h> | 5 #include <stdlib.h> |
| 6 #include <stdio.h> | 6 #include <stdio.h> |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "include/dart_api.h" | 9 #include "include/dart_api.h" |
| 10 | 10 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 V(File_RenameLink, 2) \ | 56 V(File_RenameLink, 2) \ |
| 57 V(File_ResolveSymbolicLinks, 1) \ | 57 V(File_ResolveSymbolicLinks, 1) \ |
| 58 V(File_OpenStdio, 1) \ | 58 V(File_OpenStdio, 1) \ |
| 59 V(File_GetStdioHandleType, 1) \ | 59 V(File_GetStdioHandleType, 1) \ |
| 60 V(File_GetType, 2) \ | 60 V(File_GetType, 2) \ |
| 61 V(File_AreIdentical, 2) \ | 61 V(File_AreIdentical, 2) \ |
| 62 V(FileSystemWatcher_IsSupported, 0) \ | 62 V(FileSystemWatcher_IsSupported, 0) \ |
| 63 V(FileSystemWatcher_ReadEvents, 1) \ | 63 V(FileSystemWatcher_ReadEvents, 1) \ |
| 64 V(FileSystemWatcher_UnwatchPath, 1) \ | 64 V(FileSystemWatcher_UnwatchPath, 1) \ |
| 65 V(FileSystemWatcher_WatchPath, 4) \ | 65 V(FileSystemWatcher_WatchPath, 4) \ |
| 66 V(DartAPI_SendPriority, 2) \ |
| 66 V(Logger_PrintString, 1) | 67 V(Logger_PrintString, 1) |
| 67 | 68 |
| 68 BUILTIN_NATIVE_LIST(DECLARE_FUNCTION); | 69 BUILTIN_NATIVE_LIST(DECLARE_FUNCTION); |
| 69 | 70 |
| 70 static struct NativeEntries { | 71 static struct NativeEntries { |
| 71 const char* name_; | 72 const char* name_; |
| 72 Dart_NativeFunction function_; | 73 Dart_NativeFunction function_; |
| 73 int argument_count_; | 74 int argument_count_; |
| 74 } BuiltinEntries[] = { | 75 } BuiltinEntries[] = { |
| 75 BUILTIN_NATIVE_LIST(REGISTER_FUNCTION) | 76 BUILTIN_NATIVE_LIST(REGISTER_FUNCTION) |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 // TODO(turnidge): Consider propagating some errors here. What if | 109 // TODO(turnidge): Consider propagating some errors here. What if |
| 109 // an isolate gets interrupted by the embedder in the middle of | 110 // an isolate gets interrupted by the embedder in the middle of |
| 110 // Dart_StringToUTF8? We need to make sure not to swallow the | 111 // Dart_StringToUTF8? We need to make sure not to swallow the |
| 111 // interrupt. | 112 // interrupt. |
| 112 Platform::PrintBlocking(stdout, "%s\n", Dart_GetError(result)); | 113 Platform::PrintBlocking(stdout, "%s\n", Dart_GetError(result)); |
| 113 } else { | 114 } else { |
| 114 Platform::PrintBlocking(stdout, "%.*s\n", static_cast<int>(length), chars); | 115 Platform::PrintBlocking(stdout, "%.*s\n", static_cast<int>(length), chars); |
| 115 } | 116 } |
| 116 } | 117 } |
| 117 | 118 |
| 119 |
| 120 void FUNCTION_NAME(DartAPI_SendPriority)(Dart_NativeArguments args) { |
| 121 Dart_Handle port = Dart_GetNativeArgument(args, 0); |
| 122 Dart_Handle msg = Dart_GetNativeArgument(args, 1); |
| 123 Dart_Handle id = Dart_GetField(port, DartUtils::NewString("_id")); |
| 124 Dart_Port port_id = DartUtils::GetIntegerValue(id); |
| 125 Dart_PostPriority(port_id, msg); |
| 126 } |
| 127 |
| 118 } // namespace bin | 128 } // namespace bin |
| 119 } // namespace dart | 129 } // namespace dart |
| OLD | NEW |