shithub: scc

ref: fa392c44270193bb1f0e3c3570e903a68703c9d0
dir: /inc/cc.h/

View raw version
/* See LICENSE file for copyright and license details. */
#include <sys/types.h>

#ifndef NDEBUG
extern int debug;
#define DBG(fmt, ...) dbg(fmt, __VA_ARGS__)
#define DBGON() (debug = 1)
#else
#define DBG(...)
#define DBGON()
#endif

#ifndef PREFIX
#define PREFIX "/usr/local/"
#endif

struct items {
	char **s;
	int n;
};

extern void die(const char *fmt, ...);
extern void dbg(const char *fmt, ...);
extern char **newitem(char **array, int num, char *item);
extern void *xmalloc(size_t size);
extern void *xcalloc(size_t nmemb, size_t size);
extern char *xstrdup(const char *s);
extern void *xrealloc(void *buff, register size_t size);