summaryrefslogtreecommitdiff
path: root/source/base/base_io.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/base/base_io.h')
-rw-r--r--source/base/base_io.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/source/base/base_io.h b/source/base/base_io.h
index ece4d7c..85fedc7 100644
--- a/source/base/base_io.h
+++ b/source/base/base_io.h
@@ -1,11 +1,38 @@
1#ifndef BASE_IO_H 1#ifndef BASE_IO_H
2#define BASE_IO_H 2#define BASE_IO_H
3 3
4#define STDIN_FD 0
5#define STDOUT_FD 1
6#define STDERR_FD 2
7
8internal s64
9os_write(s32 fd, void const *buf, u64 count)
10{
11 return syscall(SYS_write, fd, buf, count);
12}
13
14internal s64
15os_read(s32 fd, void *buf, u64 count)
16{
17 return syscall(SYS_read, fd, buf, count);
18}
19
4internal void 20internal void
5input_read() 21print_s8(string8 s)
6{ 22{
23 os_write(STDOUT_FILENO, s.data, s.size);
24}
7 25
26internal void
27print(const char *str)
28{
29 s32 len = 0;
30 while (str[len]) len++;
31 os_write(STDOUT_FILENO, str, len);
8 32
9} 33}
10 34
35#define Os_read(buffer, buffer_count)
36
37
11#endif /* BASE_IO_H */ 38#endif /* BASE_IO_H */