From ea598e719d557a876a52d0cbecb21c1fb8ff917f Mon Sep 17 00:00:00 2001 From: Jack Jamison Date: Tue, 21 Jul 2026 09:17:56 -0400 Subject: add a bunch of util and clean up --- snag/util.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'snag/util.h') diff --git a/snag/util.h b/snag/util.h index 88906cc..6f23607 100644 --- a/snag/util.h +++ b/snag/util.h @@ -1,6 +1,16 @@ #ifndef UTIL_H #define UTIL_H -#include -#define vstrcat(dest, ...) vstrcat_(dest, __VA_ARGS__, NULL) -void vstrcat_(char* dest, ...); -#endif // UTIL_H + +#include +#include + +// utility for errors +void eprintf(const char *format, ...) __attribute__((format(printf, 1, 2))); +void error_out(const char *format, ...) __attribute__((format(printf, 1, 2))); // panic, as the kids say +void* emalloc(size_t size, char* alloc_reason); + +// string functions +char* vastrcat_(int dummy, ...); +#define vastrcat(...) vastrcat_(0, __VA_ARGS__, NULL) + +#endif -- cgit v1.2.3