diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2016-04-11 19:54:55 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2016-04-11 19:54:55 +0000 |
commit | abf221675b71c007d7d79df6e96b6c7cdc20da9e (patch) | |
tree | 2fd0e414e3915421b30112d11c2897319559c461 /lib/libedit/tokenizer.c | |
parent | a3c072d05eac61e126aa13c82d6288e290316dbd (diff) |
Move wrapper macros to the two files actually needing them:
FUNW, Strlen, Strdup, Strcmp, Strncmp, Strncpy, Strncat -> history.c
Strchr, tok_strdup -> tokenizer.c
FUN, TYPE, STR -> both of these files
OK martijn@
Also proofread by Christian Heckendorf <mbie at ulmus dot me>
who reported some whitespace issues in parse.c.
Diffstat (limited to 'lib/libedit/tokenizer.c')
-rw-r--r-- | lib/libedit/tokenizer.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/libedit/tokenizer.c b/lib/libedit/tokenizer.c index 6a026654eaf..1cdb9019d22 100644 --- a/lib/libedit/tokenizer.c +++ b/lib/libedit/tokenizer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tokenizer.c,v 1.17 2016/03/20 23:48:27 schwarze Exp $ */ +/* $OpenBSD: tokenizer.c,v 1.18 2016/04/11 19:54:54 schwarze Exp $ */ /* $NetBSD: tokenizer.c,v 1.23 2016/02/15 15:37:20 christos Exp $ */ /*- @@ -57,8 +57,19 @@ typedef enum { #define IFS STR("\t \n") -#define tok_strdup(a) Strdup(a) - +#ifdef NARROWCHAR +#define FUN(prefix, rest) prefix ## _ ## rest +#define TYPE(type) type +#define STR(x) x +#define Strchr(s, c) strchr(s, c) +#define tok_strdup(s) strdup(s) +#else +#define FUN(prefix, rest) prefix ## _w ## rest +#define TYPE(type) type ## W +#define STR(x) L ## x +#define Strchr(s, c) wcschr(s, c) +#define tok_strdup(s) wcsdup(s) +#endif struct TYPE(tokenizer) { Char *ifs; /* In field separator */ |