aboutsummaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorame <[email protected]>2024-03-04 12:21:56 -0600
committerame <[email protected]>2024-03-04 12:21:56 -0600
commit4b86d0780ef2bee48b1b1d8719adbcedeccf1ea2 (patch)
tree1fce22a997d32969940f8ab42cbb7fc96f23ca1a /src/util.c
parent1d2c4b59879a6f96edd2f8f86d6313a97c856d26 (diff)
parser almost done
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c10
1 files changed, 7 insertions, 3 deletions
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 <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);
}