dwm/util.h

19 lines
574 B
C
Raw Normal View History

2022-07-17 06:29:39 +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))
#define BETWEEN(X, A, B) ((A) <= (X) && (X) <= (B))
2022-08-16 20:58:39 +00:00
#ifdef _DEBUG
#define DEBUG(...) fprintf(stderr, __VA_ARGS__)
#else
#define DEBUG(...)
#endif
2022-07-17 06:29:39 +00:00
void die(const char *fmt, ...);
void *ecalloc(size_t nmemb, size_t size);
2022-08-16 20:58:39 +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);