diff options
| author | nasr <nsrddyn@gmail.com> | 2026-04-17 13:35:00 +0200 |
|---|---|---|
| committer | nasr <nsrddyn@gmail.com> | 2026-04-17 13:35:00 +0200 |
| commit | d184ac5bd33dfa02b5c157d086b7dd0491aa5b1a (patch) | |
| tree | 77fc3ffc75e5d80638c2eef4d3c075ec15257a79 /source/scb/scb.h | |
| parent | 154bf6f53529e88dfa03d6ff5034b575f92cdbb5 (diff) | |
checkpointmain
Diffstat (limited to 'source/scb/scb.h')
| -rw-r--r-- | source/scb/scb.h | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/source/scb/scb.h b/source/scb/scb.h index 39f5e89..09c4852 100644 --- a/source/scb/scb.h +++ b/source/scb/scb.h | |||
| @@ -13,23 +13,30 @@ struct config { | |||
| 13 | string8 flags[]; | 13 | string8 flags[]; |
| 14 | }; | 14 | }; |
| 15 | 15 | ||
| 16 | 16 | typedef struct file_metad file_metad; | |
| 17 | internal void | 17 | struct file_metad |
| 18 | self_rebuild(const char *binary_path) | ||
| 19 | { | 18 | { |
| 19 | string8 name; | ||
| 20 | u32 time; | ||
| 21 | }; | ||
| 20 | 22 | ||
| 21 | struct stat scb_binary_stats; | 23 | internal b32 |
| 22 | assert_msg((lstat(binary_path), &sb == -1),"\nlstat failed to initialize\n"); | 24 | is_file_modified(const char *path) |
| 25 | { | ||
| 26 | struct stat scb_bstats; | ||
| 27 | s8 err = lstat(path, &scb_bstats); | ||
| 28 | assert_msg((err), "lstat failed."); | ||
| 23 | 29 | ||
| 24 | if(ctime(&sb.st_mtime)) | 30 | if(scb_bstats.st_mtime) |
| 25 | { | 31 | { |
| 26 | 32 | ||
| 27 | } | 33 | } |
| 34 | return 0; | ||
| 28 | } | 35 | } |
| 29 | 36 | ||
| 30 | //@documentatie: hebfjlberln | 37 | //@documentatie: hebfjlberln |
| 31 | internal void | 38 | internal void |
| 32 | init(int argument_count, char **argument, char **env) | 39 | init(int argument_count, char **argument, char **env) |
| 33 | { | 40 | { |
| 34 | mem_arena *global_arena = arena_create(KiB(2)); | 41 | mem_arena *global_arena = arena_create(KiB(2)); |
| 35 | assert_msg(argument_count > 2, "no program passed"); | 42 | assert_msg(argument_count > 2, "no program passed"); |
| @@ -41,20 +48,22 @@ init(int argument_count, char **argument, char **env) | |||
| 41 | 48 | ||
| 42 | //- load files into buffer | 49 | //- load files into buffer |
| 43 | { | 50 | { |
| 44 | 51 | if(is_file_modified) | |
| 45 | 52 | { | |
| 53 | self_rebuild(); | ||
| 54 | } | ||
| 46 | 55 | ||
| 47 | //- TODO(nasr): ... | 56 | //- TODO(nasr): ... |
| 48 | } | 57 | } |
| 49 | 58 | ||
| 50 | if(string8_cmp(command, StringCast("doc", 3))) | 59 | if(string8_cmp(command, StringCastUTF8("doc", 3))) |
| 51 | { | 60 | { |
| 52 | //- run meta program that builds tool documentation | 61 | //- run meta program that builds tool documentation |
| 53 | //- hmmm how do i store the documentation | 62 | //- hmmm how do i store the documentation |
| 54 | { | 63 | { |
| 55 | } | 64 | } |
| 56 | } | 65 | } |
| 57 | else if(string8_cmp(command, StringCast("build", 5))) | 66 | else if(string8_cmp(command, StringCast("build", 5))) |
| 58 | { | 67 | { |
| 59 | 68 | ||
| 60 | 69 | ||
| @@ -75,8 +84,10 @@ init(int argument_count, char **argument, char **env) | |||
| 75 | 84 | ||
| 76 | } | 85 | } |
| 77 | } | 86 | } |
| 78 | else if(string8_cmp(command, StringCast("meta", 5))) | 87 | else if(string8_cmp(command, StringCast("meta", 5))) |
| 79 | { | 88 | { |
| 80 | //- run the meta program | 89 | //- run the meta program |
| 81 | } | 90 | } |
| 91 | |||
| 92 | return; | ||
| 82 | } | 93 | } |
