scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

scc.h (966B)


      1 #include <stddef.h>
      2 
      3 extern int debug;
      4 
      5 #ifndef NDEBUG
      6 #define DBG(...) dbg(__VA_ARGS__)
      7 #define DBGON() (debug = 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 TFLOAT      double
     16 
     17 struct items {
     18 	char **s;
     19 	unsigned n;
     20 };
     21 
     22 typedef struct alloc Alloc;
     23 
     24 extern void die(const char *fmt, ...);
     25 extern void dbg(const char *fmt, ...);
     26 extern void newitem(struct items *items, char *item);
     27 extern void *xmalloc(size_t size);
     28 extern void *xcalloc(size_t nmemb, size_t size);
     29 extern char *xstrdup(const char *s);
     30 extern void *xrealloc(void *buff, register size_t size);
     31 extern Alloc *alloc(size_t size, size_t nmemb);
     32 extern void dealloc(Alloc *allocp);
     33 extern void *new(Alloc *allocp);
     34 extern void delete(Alloc *allocp, void *p);
     35 extern int casecmp(const char *s1, const char *s2);
     36 extern int lpack(unsigned char *dst, char *fmt, ...);
     37 extern int lunpack(unsigned char *src, char *fmt, ...);