Implement functions to get stdin, stdout & stderr
Release / release (push) Successful in 2s

This commit is contained in:
2026-05-17 12:21:23 +01:00
parent 515493b963
commit 2e5163ba33
3 changed files with 34 additions and 9 deletions
+13 -6
View File
@@ -49,13 +49,20 @@ wapp_intern i32 file_seek_origins[FILE_SEEK_ORIGIN_COUNT] = {
[WAPP_SEEK_END] = SEEK_END,
};
wapp_intern WFile _STDIN = { .fd = STDIN_FILENO };
wapp_intern WFile _STDOUT = { .fd = STDOUT_FILENO };
wapp_intern WFile _STDERR = { .fd = STDERR_FILENO };
WFile *wapp_file_stdin(void) {
wapp_persist WFile _stdin = { .fd = STDIN_FILENO };
return &_stdin;
}
WFile *WF_STDIN = &_STDIN;
WFile *WF_STDOUT = &_STDOUT;
WFile *WF_STDERR = &_STDERR;
WFile *wapp_file_stdout(void) {
wapp_persist WFile _stdout = { .fd = STDOUT_FILENO };
return &_stdout;
}
WFile *wapp_file_stderr(void) {
wapp_persist WFile _stderr = { .fd = STDERR_FILENO };
return &_stderr;
}
WFile *_file_open(const Allocator *allocator, Str8RO *filepath, FileAccessMode mode) {
wapp_persist c8 tmp[WAPP_PATH_MAX] = {0};