diff options
| author | ame <[email protected]> | 2024-03-04 12:21:56 -0600 |
|---|---|---|
| committer | ame <[email protected]> | 2024-03-04 12:21:56 -0600 |
| commit | 4a6b99649a641f98d1d740b8dfd916f2e7ee3085 (patch) | |
| tree | 1fce22a997d32969940f8ab42cbb7fc96f23ca1a /src/util.c | |
| parent | 7465fa182f3ed748184ed7e10999a5e02f722aef (diff) | |
parser almost done
Diffstat (limited to 'src/util.c')
| -rw-r--r-- | src/util.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -1,7 +1,9 @@ #include "util.h" #include <stdio.h> #include <stdlib.h> +#include <pthread.h> #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); } |
