diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2006-04-09 21:47:21 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2006-04-09 21:47:21 +0000 |
commit | ef330a5dfddc763b83fe2406a91c61519279de68 (patch) | |
tree | a443ed27b17283591c3bd51e2938659ac03f6687 /Src/zsh.h | |
parent | 82dc72e03462d2f0ebae2f6f4794fbb941cb3c8c (diff) | |
download | zsh-ef330a5dfddc763b83fe2406a91c61519279de68.tar.gz zsh-ef330a5dfddc763b83fe2406a91c61519279de68.tar.xz zsh-ef330a5dfddc763b83fe2406a91c61519279de68.zip |
22408: support for multibyte characters in patterns
Diffstat (limited to 'Src/zsh.h')
-rw-r--r-- | Src/zsh.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Src/zsh.h b/Src/zsh.h index e1e53f6b3..6a6ff2fe4 100644 --- a/Src/zsh.h +++ b/Src/zsh.h @@ -1161,6 +1161,7 @@ struct patprog { #define GF_IGNCASE 0x0200 #define GF_BACKREF 0x0400 #define GF_MATCHREF 0x0800 +#define GF_MULTIBYTE 0x1000 /* Use multibyte if supported by build */ /* Dummy Patprog pointers. Used mainly in executable code, but the * pattern code needs to know about it, too. */ @@ -1596,6 +1597,7 @@ enum { MARKDIRS, MENUCOMPLETE, MONITOR, + MULTIBYTE, MULTIOS, NOMATCH, NOTIFY, @@ -1924,4 +1926,26 @@ typedef char *(*ZleGetLineFn) _((int *, int *)); #define MB_INCOMPLETE ((size_t)-2) #define MB_INVALID ((size_t)-1) + +/* + * MB_CUR_MAX is the maximum number of bytes that a single wide + * character will convert into. We use it to keep strings + * sufficiently long. It should always be defined, but if it isn't + * just assume we are using Unicode which requires 6 characters. + * (Note that it's not necessarily defined to a constant.) + */ +#ifndef MB_CUR_MAX +#define MB_CUR_MAX 6 +#endif + +/* Convert character or string to wide character or string */ +#define ZWC(c) L ## c +#define ZWS(s) L ## s + +#else + +/* Leave character or string as is. */ +#define ZWC(c) c +#define ZWS(s) s + #endif |