aboutsummaryrefslogtreecommitdiff
path: root/core/runtime
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2019-03-30 14:51:42 +0000
committergingerBill <bill@gingerbill.org>2019-03-30 14:51:42 +0000
commit68d4bde82fe58150871feb91e7c3dbc0de4e7662 (patch)
tree67c3f3e549f66ce58e356e47d40a5cc7942ff5dc /core/runtime
parenta019059975736fa099958b00f3927f57a6240613 (diff)
Overrideable stdin, stdout, stderr at the `context` level
Diffstat (limited to 'core/runtime')
-rw-r--r--core/runtime/core.odin8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/runtime/core.odin b/core/runtime/core.odin
index 187573557..5932d57c5 100644
--- a/core/runtime/core.odin
+++ b/core/runtime/core.odin
@@ -213,6 +213,10 @@ Context :: struct {
assertion_failure_proc: Assertion_Failure_Proc,
logger: log.Logger,
+ stdin: os.Handle,
+ stdout: os.Handle,
+ stderr: os.Handle,
+
thread_id: int,
user_data: any,
@@ -350,6 +354,10 @@ __init_context :: proc "contextless" (c: ^Context) {
c.logger.procedure = log.nil_logger_proc;
c.logger.data = nil;
+
+ c.stdin = os.stdin;
+ c.stdout = os.stdout;
+ c.stderr = os.stderr;
}
@builtin