Add standard streams
All checks were successful
Release / release (push) Successful in 3s

This commit is contained in:
2026-05-17 11:13:40 +01:00
parent 70997f091f
commit 8061692801
2 changed files with 11 additions and 3 deletions

View File

@@ -12,9 +12,9 @@ BEGIN_C_LINKAGE
#endif // !WAPP_PLATFORM_CPP
typedef struct WFile WFile;
// wapp_extern WFile *WF_STDIN;
// wapp_extern WFile *WF_STDOUT;
// wapp_extern WFile *WF_STDERR;
wapp_extern WFile *WF_STDIN;
wapp_extern WFile *WF_STDOUT;
wapp_extern WFile *WF_STDERR;
typedef enum {
WAPP_ACCESS_READ, // Equivalent to r

View File

@@ -49,6 +49,14 @@ 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 *WF_STDIN = &_STDIN;
WFile *WF_STDOUT = &_STDOUT;
WFile *WF_STDERR = &_STDERR;
WFile *_file_open(const Allocator *allocator, Str8RO *filepath, FileAccessMode mode) {
wapp_persist c8 tmp[WAPP_PATH_MAX] = {0};
memset(tmp, 0, WAPP_PATH_MAX);