From 4a6b99649a641f98d1d740b8dfd916f2e7ee3085 Mon Sep 17 00:00:00 2001 From: ame Date: Mon, 4 Mar 2024 12:21:56 -0600 Subject: parser almost done --- src/util.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/util.c') diff --git a/src/util.c b/src/util.c index f1b9881..f8ab836 100644 --- a/src/util.c +++ b/src/util.c @@ -1,7 +1,9 @@ #include "util.h" #include #include +#include #include "lua.h" +#include "net.h" int gen_parse(char* inp, int len, parray_t** _table){ str* current = str_init(""), *last = NULL; @@ -55,11 +57,13 @@ char* strnstr(const char *s1, const char *s2, size_t n) { return NULL; } -void p_fatal(const char* m){ - fprintf(stderr, "%s[ fatal ] %s %s\n",color_red, m, color_reset); +void _p_fatal(const char* m, int line, const char* file, const char* function){ + fprintf(stderr, "%s[fatal] %s \n" + "\tthread: %i/%i\n" + "\tat: %s:%s(%i) %s\n",color_red, m, pthread_self(), threads, file, function, line, color_reset); exit(EXIT_FAILURE); } void p_error(const char* m){ - fprintf(stderr, "%s[ error ]%s %s\n",color_red, color_reset, m); + fprintf(stderr, "%s[error]%s %s\n",color_red, color_reset, m); } -- cgit v1.2.3