2012-12-08 09:13:01 +00: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))
|
2015-03-06 04:26:11 +00:00
|
|
|
#define BETWEEN(X, A, B) ((A) <= (X) && (X) <= (B))
|
2012-12-08 09:13:01 +00:00
|
|
|
|
2023-08-04 19:23:37 +00:00
|
|
|
#ifdef _DEBUG
|
|
|
|
#define DEBUG(...) fprintf(stderr, __VA_ARGS__)
|
|
|
|
#else
|
|
|
|
#define DEBUG(...)
|
|
|
|
#endif
|
|
|
|
|
2016-05-22 20:33:56 +00:00
|
|
|
void die(const char *fmt, ...);
|
|
|
|
void *ecalloc(size_t nmemb, size_t size);
|
2023-08-04 19:23:37 +00: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);
|