stacinhtml

Static C in HTML - simple static site generator
git clone git://git.kocotian.pl/stacinhtml.git
Log | Files | Refs | README | LICENSE

util.h (744B)


      1 /* See licenses/LIBSL file for copyright and license details. */
      2 
      3 #ifndef _UTIL_H
      4 #define _UTIL_H
      5 
      6 #define MAX(A, B)               ((signed)(A) > (signed)(B) ? (signed)(A) : (signed)(B))
      7 #define MIN(A, B)               ((signed)(A) < (signed)(B) ? (signed)(A) : (signed)(B))
      8 #define BETWEEN(X, A, B)        ((signed)(A) <= (signed)(X) && (signed)(X) <= (signed)(B))
      9 
     10 #define UMAX(A, B)               ((unsigned)(A) > (unsigned)(B) ? (unsigned)(A) : (unsigned)(B))
     11 #define UMIN(A, B)               ((unsigned)(A) < (unsigned)(B) ? (unsigned)(A) : (unsigned)(B))
     12 #define UBETWEEN(X, A, B)        ((unsigned)(A) <= (unsigned)(X) && (unsigned)(X) <= (unsigned)(B))
     13 
     14 void die(const char *fmt, ...);
     15 void *ecalloc(size_t nmemb, size_t size);
     16 
     17 #endif