| Index: runtime/bin/stdin.cc
|
| diff --git a/runtime/bin/stdin.cc b/runtime/bin/stdin.cc
|
| index 6dba2130ad8e9526c2fe8b4092ebf565038e828c..2c2ebde8c896b754214ce086f6c1b191311f399e 100644
|
| --- a/runtime/bin/stdin.cc
|
| +++ b/runtime/bin/stdin.cc
|
| @@ -4,8 +4,8 @@
|
|
|
| #include "bin/builtin.h"
|
| #include "bin/dartutils.h"
|
| -#include "bin/thread.h"
|
| #include "bin/utils.h"
|
| +#include "bin/stdin.h"
|
|
|
| #include "platform/globals.h"
|
| #include "platform/thread.h"
|
| @@ -19,11 +19,25 @@ namespace bin {
|
|
|
| void FUNCTION_NAME(Stdin_ReadByte)(Dart_NativeArguments args) {
|
| Dart_EnterScope();
|
| - int c = getchar();
|
| - if (c == EOF) {
|
| - c = -1;
|
| - }
|
| - Dart_SetReturnValue(args, Dart_NewInteger(c));
|
| + Dart_SetReturnValue(args, Dart_NewInteger(Stdin::ReadByte()));
|
| + Dart_ExitScope();
|
| +}
|
| +
|
| +
|
| +void FUNCTION_NAME(Stdin_SetEchoMode)(Dart_NativeArguments args) {
|
| + Dart_EnterScope();
|
| + bool enabled = DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 1));
|
| + Stdin::setEchoMode(enabled);
|
| + Dart_SetReturnValue(args, Dart_Null());
|
| + Dart_ExitScope();
|
| +}
|
| +
|
| +
|
| +void FUNCTION_NAME(Stdin_SetLineMode)(Dart_NativeArguments args) {
|
| + Dart_EnterScope();
|
| + bool enabled = DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 1));
|
| + Stdin::setLineMode(enabled);
|
| + Dart_SetReturnValue(args, Dart_Null());
|
| Dart_ExitScope();
|
| }
|
|
|
|
|