added Result struct

This commit is contained in:
2025-07-21 16:22:57 +03:00
parent 7e5b1ea9bb
commit 8999fda11c
2 changed files with 36 additions and 0 deletions

10
src/errors.c Executable file
View File

@@ -0,0 +1,10 @@
#include "tlibc/errors.h"
#define ERRMSG_LENGTH 1024
char* _genErrorMessage(cstr file, i32 line, cstr func, char* msg, bool free_msg){
char* result = sprintf_malloc(1024, "[%s:%i] %s() throwed error: %s", file, line, func, msg);
if(free_msg)
free(msg);
return result;
}