diff options
| author | nasr <nsrddyn@gmail.com> | 2026-03-08 21:01:43 +0000 |
|---|---|---|
| committer | nasr <nsrddyn@gmail.com> | 2026-03-08 21:01:43 +0000 |
| commit | 71ced998122c357bc62e54d9bb4e124c88acf94b (patch) | |
| tree | 746fca3d71a8640478ad6b6f4429a19f4dfbbda8 /source/base/base_os.h | |
| parent | f8f24f8c67fe903e267ab29bb2fbb9d334a722de (diff) | |
refactor(main): worked on string handling in C and other stuff
Diffstat (limited to 'source/base/base_os.h')
| -rw-r--r-- | source/base/base_os.h | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/source/base/base_os.h b/source/base/base_os.h index 23587c6..abe8628 100644 --- a/source/base/base_os.h +++ b/source/base/base_os.h | |||
| @@ -1,21 +1,13 @@ | |||
| 1 | #ifndef BASE_OS_H | 1 | #ifndef BASE_OS_H |
| 2 | #define BASE_OS_H | 2 | #define BASE_OS_H |
| 3 | 3 | ||
| 4 | internal void | ||
| 5 | print(const char *str) | ||
| 6 | { | ||
| 7 | i32 len = 0; | ||
| 8 | while (str[len]) len++; | ||
| 9 | write(STDOUT_FILENO, str, len); | ||
| 10 | } | ||
| 11 | |||
| 12 | internal string8 | 4 | internal string8 |
| 13 | load_file(const char *path) | 5 | load_file(const char *path) |
| 14 | { | 6 | { |
| 15 | string8 result = {0}; | 7 | string8 result = {0}; |
| 16 | struct stat sbuf = {0}; | 8 | struct stat sbuf = {0}; |
| 17 | 9 | ||
| 18 | i32 file = open(path, O_RDONLY); | 10 | s32 file = open(path, O_RDONLY); |
| 19 | if(file == -1) return result; | 11 | if(file == -1) return result; |
| 20 | 12 | ||
| 21 | if(fstat(file, &sbuf) == -1) | 13 | if(fstat(file, &sbuf) == -1) |
