From 223b1056273f5d48d1c0bbfee75be7b82374d4eb Mon Sep 17 00:00:00 2001 From: pryazha Date: Sun, 12 Oct 2025 15:24:30 +0500 Subject: change identation, maybe will change back, add own gl functions loading, and glx example --- examples/sys.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 examples/sys.c (limited to 'examples/sys.c') diff --git a/examples/sys.c b/examples/sys.c new file mode 100644 index 0000000..881d2be --- /dev/null +++ b/examples/sys.c @@ -0,0 +1,30 @@ +#include "prb.h" +#include +#include + +i32 main(int c, char **v) +{ + info("os:"); + switch (os) { + case os_linux: + info("linux"); + break; + case os_windows: + info("windows"); + break; + default: + info("unsupported"); + return 1; + } + char *dir = dirname(*v); + info("bin directory \"%s\"", dir); + const char *filename = "build.sh"; + char path[1024] = {0}; + snprintf(path, 1024, "%s/%s", dir, filename); + struct arena arena = alloc_arena(megabytes(32)); + char *content = 0; + if (!(content = read_entire_file(&arena, 0, path))) + die("failed to read %s", path); + info("%s content:\n%s", path, content); + return 0; +} -- cgit v1.2.3-70-g09d2