diff options
| author | hachem <im@hachem.wtf> | 2026-08-30 01:31:15 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-08-30 01:31:15 +0200 |
| commit | d235876f94f84dca15520a20bb476b916b927afb (patch) | |
| tree | 3f87c62a55e76f0ba55efcc3ccb867f161ad2aa0 /src/main.c | |
| parent | 11d3e0294d6c4d657c45c6f8de23dd628b61680d (diff) | |
add: read files into memory
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -1,5 +1,6 @@ #include <stdio.h> +#include "io/file.h" #include "cli/args.h" int main(int argc, char** argv) @@ -12,11 +13,12 @@ int main(int argc, char** argv) if (result == PARSE_ERROR) return 1; - static const char* target_names[] = { "nasm", "fasm", "masm" }; + struct File source; + if (!read_file(args.input_path, &source)) + return 1; - printf("input: %s\n", args.input_path); - printf("output: %s\n", args.output_path != NULL ? args.output_path : "<stdout>"); - printf("target: %s\n", target_names[args.target]); + printf("read %zu bytes from %s\n", source.size, args.input_path); + free_file(&source); return 0; } |
