2022-08-28 02:59:08 -07:00
|
|
|
/* See LICENSE file for copyright and license details. */
|
|
|
|
|
|
|
|
#define MAX(A, B) ((A) > (B) ? (A) : (B))
|
|
|
|
#define MIN(A, B) ((A) < (B) ? (A) : (B))
|
|
|
|
#define BETWEEN(X, A, B) ((A) <= (X) && (X) <= (B))
|
|
|
|
|
2023-09-16 02:39:17 -07:00
|
|
|
#ifdef _DEBUG
|
|
|
|
#define DEBUG(...) fprintf(stderr, __VA_ARGS__)
|
|
|
|
#else
|
|
|
|
#define DEBUG(...)
|
|
|
|
#endif
|
|
|
|
|
2022-08-28 02:59:08 -07:00
|
|
|
void die(const char *fmt, ...);
|
|
|
|
void *ecalloc(size_t nmemb, size_t size);
|
2023-09-16 02:39:17 -07:00
|
|
|
int normalizepath(const char *path, char **normal);
|
|
|
|
int mkdirp(const char *path);
|
|
|
|
int parentdir(const char *path, char **parent);
|
|
|
|
int nullterminate(char **str, size_t *len);
|