aboutsummaryrefslogtreecommitdiff
path: root/snag/util.h
blob: 6f236074bedcedbdb639d7145df9ac7966a32370 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#ifndef UTIL_H
#define 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