scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

cc.h (639B)


      1 /* See LICENSE file for copyright and license details. */
      2 #include <sys/types.h>
      3 
      4 #ifndef NDEBUG
      5 extern int debug;
      6 #define DBG(fmt, ...) dbg(fmt, __VA_ARGS__)
      7 #define DBGON() (debug = 1)
      8 #else
      9 #define DBG(...)
     10 #define DBGON()
     11 #endif
     12 
     13 #ifndef PREFIX
     14 #define PREFIX "/usr/local/"
     15 #endif
     16 
     17 struct items {
     18 	char **s;
     19 	unsigned n;
     20 };
     21 
     22 extern void die(const char *fmt, ...);
     23 extern void dbg(const char *fmt, ...);
     24 extern void newitem(struct items *items, char *item);
     25 extern void *xmalloc(size_t size);
     26 extern void *xcalloc(size_t nmemb, size_t size);
     27 extern char *xstrdup(const char *s);
     28 extern void *xrealloc(void *buff, register size_t size);