From 5e35cb6721954197beb8ffc6bdc0fceb05463e1e Mon Sep 17 00:00:00 2001 From: timerix Date: Fri, 28 Oct 2022 11:57:43 +0600 Subject: [PATCH] path_concat --- src/Filesystem/filesystem.c | 38 +++++++++++++++++++++++++++++++++++++ src/Filesystem/filesystem.h | 22 +++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 src/Filesystem/filesystem.c create mode 100644 src/Filesystem/filesystem.h diff --git a/src/Filesystem/filesystem.c b/src/Filesystem/filesystem.c new file mode 100644 index 0000000..fe535da --- /dev/null +++ b/src/Filesystem/filesystem.c @@ -0,0 +1,38 @@ +#include "filesystem.h" + +char* __path_concat(uint16 n, char* prev_part, ...){ + char** parts=(char**)malloc(n*sizeof(char*)); + uint32* lengths=malloc(n*sizeof(uint32)); + uint32 totalLength=0; + + // reading args from va_list + va_list vl; + va_start(vl, prev_part); + for(uint16 i=0; i