tisp

tiny lisp
git clone git://edryd.org/tisp
Log | Files | Refs | LICENSE

util.h (465B)


      1 /* See LICENSE file for copyright and license details. */
      2 
      3 #define MAX(A, B)         ((A) > (B) ? (A) : (B))
      4 #define MIN(A, B)         ((A) < (B) ? (A) : (B))
      5 #define BETWEEN(X, A, B)  ((A) <= (X) && (X) <= (B))
      6 #define LEN(X)            (sizeof(X) / sizeof((X)[0]))
      7 
      8 void *ecalloc(size_t nmemb, size_t size);
      9 void *emalloc(size_t size);
     10 void *erealloc(void *p, size_t size);
     11 char *estrdup(char *s);
     12 void  efree(void *p);
     13 
     14 void die(int eval, const char *fmt, ...);