From 77f4da2d6d2face3e97130fc672ab35140da4499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sat, 23 Aug 2014 11:20:14 +0200 Subject: Share common macros in util.h --- util.h | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 util.h (limited to 'util.h') diff --git a/util.h b/util.h new file mode 100644 index 0000000..2992bea --- /dev/null +++ b/util.h @@ -0,0 +1,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) -- cgit v1.2.3