1// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
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.
4
5#include "bin/builtin.h"
6#include "bin/dartutils.h"
7
8#include "include/dart_api.h"
9
10namespace dart {
11namespace bin {
12
13void FUNCTION_NAME(CLI_WaitForEvent)(Dart_NativeArguments args) {
14 int64_t timeout_millis;
15 Dart_Handle result = Dart_GetNativeIntegerArgument(args, 0, &timeout_millis);
16 if (Dart_IsError(result)) {
17 Dart_PropagateError(result);
18 }
19 result = Dart_WaitForEvent(timeout_millis);
20 if (Dart_IsError(result)) {
21 Dart_PropagateError(result);
22 }
23 Dart_SetReturnValue(args, result);
24}
25
26} // namespace bin
27} // namespace dart
28