Skip to content

Commit

Permalink
handy.h: Add isCASED_LC
Browse files Browse the repository at this point in the history
As a convenience to other code.
  • Loading branch information
khwilliamson committed May 9, 2021
1 parent a4acf0b commit 656e454
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions handy.h
Expand Up @@ -1355,6 +1355,7 @@ C<toTITLE_utf8_safe> is now just a different spelling of plain C<toTITLE_utf8>
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
Expand Down Expand Up @@ -1922,6 +1923,7 @@ 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))
Expand All @@ -1937,6 +1939,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))
# define isU8_GRAPH_LC(c) isgraph((U8) (c))
# define isU8_LOWER_LC(c) islower((U8) (c))
Expand All @@ -1954,6 +1957,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)
Expand Down

0 comments on commit 656e454

Please sign in to comment.