aoc-2025/day-xy/day-xy.c
2025-12-02 22:46:16 +01:00

44 lines
1.0 KiB
C

#include "guf_common.h"
#include "guf_alloc_libc.h"
#include "guf_str.h"
/*
- Part 1: (Example)
- Part 2: (Example: )
*/
guf_allocator g_allocator;
guf_libc_alloc_ctx g_allocator_ctx;
int solution(guf_str_view input, bool part_two)
{
return 0;
}
int main(int argc, const char **argv)
{
g_allocator_ctx.zero_init = false;
guf_alloc_tracker_init(&g_allocator_ctx.tracker, 1, "Day-1 heap allocator", NULL, stderr);
guf_libc_allocator_init(&g_allocator, &g_allocator_ctx);
if (argc < 2) {
printf("No input file given.\n");
return EXIT_FAILURE;
}
guf_str input_str = GUF_STR_UNINITIALISED;
guf_str_init_empty(&input_str, &g_allocator);
guf_str_append_file(&input_str, argv[1]);
const int p1_result = solution(guf_str_view_from_str(&input_str), false);
printf("Part one: %d\n", p1_result);
const int p2_result = solution(guf_str_view_from_str(&input_str), true);
printf("Part two: %d\n", p2_result);
guf_str_free(&input_str, NULL);
return EXIT_SUCCESS;
}