aboutsummaryrefslogtreecommitdiff
path: root/util.h
blob: 2992bea88d1310db6278a5fb14afca1682395067 (plain) (blame)
1
2
3
4
5
6
7
#define LENGTH(x)  ((int)(sizeof (x) / sizeof *(x)))
#define MIN(a, b)  ((a) > (b) ? (b) : (a))
#define MAX(a, b)  ((a) < (b) ? (b) : (a))

/* is c the start of a utf8 sequence? */
#define isutf8(c) (((c)&0xC0)!=0x80)
#define ISASCII(ch)   ((unsigned char)ch < 0x80)