diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2014-08-23 11:20:14 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2014-08-23 11:20:14 +0200 |
| commit | 77f4da2d6d2face3e97130fc672ab35140da4499 (patch) | |
| tree | a3aa27925cee31002e7083e8601d99470f271b18 | |
| parent | 6013d47b7aeea5e5fc8ee15b43e4f42123b1f495 (diff) | |
| download | vis-77f4da2d6d2face3e97130fc672ab35140da4499.tar.gz vis-77f4da2d6d2face3e97130fc672ab35140da4499.tar.xz | |
Share common macros in util.h
| -rw-r--r-- | text.c | 8 | ||||
| -rw-r--r-- | util.h | 7 |
2 files changed, 8 insertions, 7 deletions
@@ -12,16 +12,10 @@ #include <sys/mman.h> #include "text.h" - -#define MAX(a, b) ((a) < (b) ? (b) : (a)) -#define MIN(a, b) ((a) > (b) ? (b) : (a)) -#define LENGTH(x) ((int)(sizeof (x) / sizeof *(x))) +#include "util.h" #define BUFFER_SIZE (1 << 20) -/* is c the start of a utf8 sequence? */ -#define isutf8(c) (((c)&0xC0)!=0x80) - struct Regex { const char *string; regex_t regex; @@ -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) |
