From d235876f94f84dca15520a20bb476b916b927afb Mon Sep 17 00:00:00 2001 From: hachem Date: Sun, 30 Aug 2026 01:31:15 +0200 Subject: add: read files into memory --- src/main.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index a14d2ba..1d97acb 100644 --- a/src/main.c +++ b/src/main.c @@ -1,5 +1,6 @@ #include +#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 : ""); - 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; } -- cgit v1.3