diff options
author | Karl Williamson <khw@cpan.org> | 2021-03-20 11:02:14 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-06-12 09:50:10 -0600 |
commit | 8fd8ea433fb12e11f83365f8deb205f454abf46c (patch) | |
tree | a5433bb0265551e72435dccfdf71139b56692ca3 /handy.h | |
parent | 6d432bcf16b2ea3416cf326f79cd4f521601142d (diff) | |
download | perl-8fd8ea433fb12e11f83365f8deb205f454abf46c.tar.gz |
handy.h: Add isCASED_LC
As a convenience to other code.
Diffstat (limited to 'handy.h')
-rw-r--r-- | handy.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -1356,6 +1356,7 @@ change in future releases. XXX Still undocumented isVERTWS_uvchr and _utf8; it's unclear what their names really should be. Also toUPPER_LC and toFOLD_LC, which are subject to change, and aren't general purpose as they don't work on U+DF, and assert against that. +and isCASED_LC, as it really is more of an internal thing. Note that these macros are repeated in Devel::PPPort, so should also be patched there. The file as of this writing is cpan/Devel-PPPort/parts/inc/misc @@ -1932,6 +1933,8 @@ END_EXTERN_C #ifdef WIN32 # define isU8_ALPHA_LC(c) (isalpha((U8) (c)) && ! isU8_PUNCT_LC(c)) # define isU8_ALPHANUMERIC_LC(c) (isalnum((U8) (c)) && ! isU8_PUNCT_LC(c)) +# define isU8_CASED_LC(c) ((isupper((U8) (c)) || islower((U8) (c))) \ + && ! isU8_PUNCT_LC(c)) # define isU8_DIGIT_LC(c) (isdigit((U8) (c)) && ! isU8_PUNCT_LC(c)) # define isU8_GRAPH_LC(c) (isgraph((U8) (c)) && ! isU8_CNTRL_LC(c)) # define isU8_LOWER_LC(c) (islower((U8) (c)) && ! isU8_PUNCT_LC(c)) @@ -1946,6 +1949,7 @@ END_EXTERN_C # define isU8_ALPHA_LC(c) isalpha((U8) (c)) # define isU8_ALPHANUMERIC_LC(c) isalnum((U8) (c)) +# define isU8_CASED_LC(c) (islower((U8) (c)) || isupper((U8) (c))) # define isU8_DIGIT_LC(c) isdigit((U8) (c)) /* ... But it seems that IBM products treat NBSP as both a space and a @@ -1972,6 +1976,7 @@ END_EXTERN_C #define isALPHANUMERIC_LC(c) \ generic_LC_(c, CC_ALPHANUMERIC_, isU8_ALPHANUMERIC_LC) #define isBLANK_LC(c) generic_LC_(c, CC_BLANK_, isU8_BLANK_LC) +#define isCASED_LC(c) generic_LC_(c, CC_CASED_, isU8_CASED_LC) #define isCNTRL_LC(c) generic_LC_(c, CC_CNTRL_, isU8_CNTRL_LC) #define isDIGIT_LC(c) generic_LC_(c, CC_DIGIT_, isU8_DIGIT_LC) #define isGRAPH_LC(c) generic_LC_(c, CC_GRAPH_, isU8_GRAPH_LC) |