diff options
| author | Jack Jamison <jackqjamison@gmail.com> | 2026-07-21 09:17:56 -0400 |
|---|---|---|
| committer | Jack Jamison <jackqjamison@gmail.com> | 2026-07-21 09:17:56 -0400 |
| commit | ea598e719d557a876a52d0cbecb21c1fb8ff917f (patch) | |
| tree | f81bd793d686e2a6c7784e25c7118f351d3be7a7 /snag/util.h | |
| parent | 013a332a5ad21b4faea1644a6ad38b144ef22901 (diff) | |
add a bunch of util and clean up
Diffstat (limited to 'snag/util.h')
| -rw-r--r-- | snag/util.h | 18 |
1 files changed, 14 insertions, 4 deletions
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 <stdlib.h> -#define vstrcat(dest, ...) vstrcat_(dest, __VA_ARGS__, NULL) -void vstrcat_(char* dest, ...); -#endif // UTIL_H + +#include <stdarg.h> +#include <stddef.h> + +// 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 |
