scc

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

scc.h (1174B)


      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 TUINT_MAX   ULLONG_MAX
     16 #define TINT_MAX    LLONG_MAX
     17 #define TFLOAT      double
     18 
     19 struct items {
     20 	char **s;
     21 	unsigned n;
     22 };
     23 
     24 typedef struct alloc Alloc;
     25 
     26 extern void die(const char *fmt, ...);
     27 extern void dbg(const char *fmt, ...);
     28 extern void newitem(struct items *items, char *item);
     29 extern void *xmalloc(size_t size);
     30 extern void *xcalloc(size_t nmemb, size_t size);
     31 extern char *xstrdup(const char *s);
     32 extern void *xrealloc(void *buff, register size_t size);
     33 extern Alloc *alloc(size_t size, size_t nmemb);
     34 extern void dealloc(Alloc *allocp);
     35 extern void *new(Alloc *allocp);
     36 extern void delete(Alloc *allocp, void *p);
     37 extern int casecmp(const char *s1, const char *s2);
     38 extern int lpack(unsigned char *dst, char *fmt, ...);
     39 extern int lunpack(unsigned char *src, char *fmt, ...);
     40 extern int bpack(unsigned char *dst, char *fmt, ...);
     41 extern int bunpack(unsigned char *src, char *fmt, ...);
     42 extern unsigned genhash(char *name);