summaryrefslogtreecommitdiff
path: root/handy.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2021-03-20 11:02:14 -0600
committerKarl Williamson <khw@cpan.org>2022-06-12 09:50:10 -0600
commit8fd8ea433fb12e11f83365f8deb205f454abf46c (patch)
treea5433bb0265551e72435dccfdf71139b56692ca3 /handy.h
parent6d432bcf16b2ea3416cf326f79cd4f521601142d (diff)
downloadperl-8fd8ea433fb12e11f83365f8deb205f454abf46c.tar.gz
handy.h: Add isCASED_LC
As a convenience to other code.
Diffstat (limited to 'handy.h')
-rw-r--r--handy.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/handy.h b/handy.h
index 03f2350811..0904722bd1 100644
--- a/handy.h
+++ b/handy.h
@@ -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)