diff options
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 |
