scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

scc.h (978B)


      1 #include <stddef.h>
      2 
      3 extern int enadebug;
      4 
      5 #ifndef NDEBUG
      6 #define DBG(...) dbg(__VA_ARGS__)
      7 #define DBGON() (enadebug = 1)
      8 #else
      9 #define DBG(...)
     10 #define DBGON()
     11 #endif
     12 
     13 #define TINT        long long
     14 #define TUINT       unsigned long long
     15 #define TUINT_MAX   ULLONG_MAX
     16 #define TINT_MAX    LLONG_MAX
     17 #define TFLOAT      double
     18 #define SIZET       size_t
     19 
     20 struct items {
     21 	char **s;
     22 	unsigned n;
     23 };
     24 
     25 typedef struct alloc Alloc;
     26 
     27 extern void die(const char *fmt, ...);
     28 extern void dbg(const char *fmt, ...);
     29 extern void newitem(struct items *items, char *item);
     30 extern void *xmalloc(size_t size);
     31 extern void *xcalloc(size_t nmemb, size_t size);
     32 extern char *xstrdup(const char *s);
     33 extern void *xrealloc(void *buff, size_t size);
     34 extern Alloc *alloc(size_t size, size_t nmemb);
     35 extern void dealloc(Alloc *allocp);
     36 extern void *new(Alloc *allocp);
     37 extern void delete(Alloc *allocp, void *p);
     38 extern int casecmp(const char *s1, const char *s2);
     39 extern unsigned genhash(char *name);