speedwm-personal/util.h
speedie a258afba18 Add IPC patch, add as an option. Will likely simplify this soon but for
now, edit config,mk and enable it in toggle.h. It is enabled by default
but not compatible with BSD so comment the lines if you use that.
2022-08-26 11:41:11 +02:00

23 lines
616 B
C

/* 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))
#ifdef USEIPC
#ifdef _DEBUG
#define DEBUG(...) fprintf(stderr, __VA_ARGS__)
#else
#define DEBUG(...)
#endif
#endif
void die(const char *fmt, ...);
void *ecalloc(size_t nmemb, size_t size);
#ifdef USEIPC
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);
#endif