@@ -1957,27 +1957,27 @@ END_EXTERN_C
1957
1957
* The first two aren't in C89, so the fallback is to use the non-locale
1958
1958
* sensitive versions; these are the same for all platforms */
1959
1959
#if defined(HAS_ISASCII )
1960
- # define is_base_ASCII (c ) isascii((U8) (c))
1960
+ # define is_posix_ASCII (c ) isascii((U8) (c))
1961
1961
#else
1962
- # define is_base_ASCII (c ) isASCII(c)
1962
+ # define is_posix_ASCII (c ) isASCII(c)
1963
1963
#endif
1964
1964
1965
1965
#if defined(HAS_ISBLANK )
1966
- # define is_base_BLANK (c ) isblank((U8) (c))
1966
+ # define is_posix_BLANK (c ) isblank((U8) (c))
1967
1967
#else
1968
- # define is_base_BLANK (c ) isBLANK(c)
1968
+ # define is_posix_BLANK (c ) isBLANK(c)
1969
1969
#endif
1970
1970
1971
1971
/* The next few are the same in all platforms. */
1972
- #define is_base_CNTRL (c ) iscntrl((U8) (c))
1973
- #define is_base_IDFIRST (c ) (UNLIKELY((c) == '_') || is_base_ALPHA (c))
1974
- #define is_base_SPACE (c ) isspace((U8) (c))
1975
- #define is_base_WORDCHAR (c ) (UNLIKELY((c) == '_') || is_base_ALPHANUMERIC (c))
1972
+ #define is_posix_CNTRL (c ) iscntrl((U8) (c))
1973
+ #define is_posix_IDFIRST (c ) (UNLIKELY((c) == '_') || is_posix_ALPHA (c))
1974
+ #define is_posix_SPACE (c ) isspace((U8) (c))
1975
+ #define is_posix_WORDCHAR (c ) (UNLIKELY((c) == '_') || is_posix_ALPHANUMERIC (c))
1976
1976
1977
1977
/* The base-level case changing macros are also the same in all platforms */
1978
- #define to_base_LOWER (c ) tolower((U8) (c))
1979
- #define to_base_UPPER (c ) toupper((U8) (c))
1980
- #define to_base_FOLD (c ) to_base_LOWER (c)
1978
+ #define to_posix_LOWER (c ) tolower((U8) (c))
1979
+ #define to_posix_UPPER (c ) toupper((U8) (c))
1980
+ #define to_posix_FOLD (c ) to_posix_LOWER (c)
1981
1981
1982
1982
#ifdef WIN32
1983
1983
@@ -1991,48 +1991,48 @@ END_EXTERN_C
1991
1991
* ispunct(), and things that are \W, like ispunct(), arent't controls. Not
1992
1992
* all possible weirdnesses are checked for, just ones that were detected on
1993
1993
* actual Microsoft code pages */
1994
- # define is_base_ALPHA (c ) \
1995
- (isalpha((U8) (c)) && ! is_base_PUNCT (c))
1996
- # define is_base_ALPHANUMERIC (c ) \
1997
- (isalnum((U8) (c)) && ! is_base_PUNCT (c))
1998
- # define is_base_CASED (c ) \
1999
- ((isupper((U8) (c)) || islower((U8) (c))) && ! is_base_PUNCT (c))
2000
- # define is_base_DIGIT (c ) \
2001
- (isdigit((U8) (c)) && ! is_base_PUNCT (c))
2002
- # define is_base_GRAPH (c ) \
2003
- (isgraph((U8) (c)) && ! is_base_CNTRL (c))
2004
- # define is_base_LOWER (c ) \
2005
- (islower((U8) (c)) && ! is_base_PUNCT (c))
2006
- # define is_base_PRINT (c ) \
2007
- (isprint((U8) (c)) && ! is_base_CNTRL (c))
2008
- # define is_base_PUNCT (c ) \
2009
- (ispunct((U8) (c)) && ! is_base_CNTRL (c))
2010
- # define is_base_UPPER (c ) \
2011
- (isupper((U8) (c)) && ! is_base_PUNCT (c))
2012
- # define is_base_XDIGIT (c ) \
2013
- (isxdigit((U8) (c)) && ! is_base_PUNCT (c))
1994
+ # define is_posix_ALPHA (c ) \
1995
+ (isalpha((U8) (c)) && ! is_posix_PUNCT (c))
1996
+ # define is_posix_ALPHANUMERIC (c ) \
1997
+ (isalnum((U8) (c)) && ! is_posix_PUNCT (c))
1998
+ # define is_posix_CASED (c ) \
1999
+ ((isupper((U8) (c)) || islower((U8) (c))) && ! is_posix_PUNCT (c))
2000
+ # define is_posix_DIGIT (c ) \
2001
+ (isdigit((U8) (c)) && ! is_posix_PUNCT (c))
2002
+ # define is_posix_GRAPH (c ) \
2003
+ (isgraph((U8) (c)) && ! is_posix_CNTRL (c))
2004
+ # define is_posix_LOWER (c ) \
2005
+ (islower((U8) (c)) && ! is_posix_PUNCT (c))
2006
+ # define is_posix_PRINT (c ) \
2007
+ (isprint((U8) (c)) && ! is_posix_CNTRL (c))
2008
+ # define is_posix_PUNCT (c ) \
2009
+ (ispunct((U8) (c)) && ! is_posix_CNTRL (c))
2010
+ # define is_posix_UPPER (c ) \
2011
+ (isupper((U8) (c)) && ! is_posix_PUNCT (c))
2012
+ # define is_posix_XDIGIT (c ) \
2013
+ (isxdigit((U8) (c)) && ! is_posix_PUNCT (c))
2014
2014
#else
2015
2015
2016
2016
/* For all other platforms, as far as we know, isdigit(), etc. work sanely
2017
2017
* enough */
2018
- # define is_base_ALPHA (c ) isalpha((U8) (c))
2019
- # define is_base_ALPHANUMERIC (c ) isalnum((U8) (c))
2020
- # define is_base_CASED (c ) (islower((U8) (c)) || isupper((U8) (c)))
2021
- # define is_base_DIGIT (c ) isdigit((U8) (c))
2018
+ # define is_posix_ALPHA (c ) isalpha((U8) (c))
2019
+ # define is_posix_ALPHANUMERIC (c ) isalnum((U8) (c))
2020
+ # define is_posix_CASED (c ) (islower((U8) (c)) || isupper((U8) (c)))
2021
+ # define is_posix_DIGIT (c ) isdigit((U8) (c))
2022
2022
2023
2023
/* ... But it seems that IBM products treat NBSP as both a space and a
2024
2024
* graphic; these are the two platforms that we have active test beds for.
2025
2025
*/
2026
2026
# if defined(OS390 ) || defined(_AIX )
2027
- # define is_base_GRAPH (c ) (isgraph((U8) (c)) && ! isspace((U8) (c)))
2027
+ # define is_posix_GRAPH (c ) (isgraph((U8) (c)) && ! isspace((U8) (c)))
2028
2028
# else
2029
- # define is_base_GRAPH (c ) isgraph((U8) (c))
2029
+ # define is_posix_GRAPH (c ) isgraph((U8) (c))
2030
2030
# endif
2031
- # define is_base_LOWER (c ) islower((U8) (c))
2032
- # define is_base_PRINT (c ) isprint((U8) (c))
2033
- # define is_base_PUNCT (c ) ispunct((U8) (c))
2034
- # define is_base_UPPER (c ) isupper((U8) (c))
2035
- # define is_base_XDIGIT (c ) isxdigit((U8) (c))
2031
+ # define is_posix_LOWER (c ) islower((U8) (c))
2032
+ # define is_posix_PRINT (c ) isprint((U8) (c))
2033
+ # define is_posix_PUNCT (c ) ispunct((U8) (c))
2034
+ # define is_posix_UPPER (c ) isupper((U8) (c))
2035
+ # define is_posix_XDIGIT (c ) isxdigit((U8) (c))
2036
2036
#endif
2037
2037
2038
2038
/* Below is the next level up, which currently expands to nothing more
@@ -2047,28 +2047,28 @@ END_EXTERN_C
2047
2047
* (Note, proper general operation of the bare libc functons requires you to
2048
2048
* cast to U8. These do that for you automatically.) */
2049
2049
2050
- # define WRAP_U8_LC_ (c , classnum , base ) base (c)
2050
+ # define WRAP_U8_LC_ (c , classnum , posix ) posix (c)
2051
2051
2052
2052
#define isU8_ALPHANUMERIC_LC (c ) \
2053
- WRAP_U8_LC_((c), CC_ALPHANUMERIC_, is_base_ALPHANUMERIC )
2054
- #define isU8_ALPHA_LC (c ) WRAP_U8_LC_((c), CC_ALPHA_, is_base_ALPHA )
2055
- #define isU8_ASCII_LC (c ) WRAP_U8_LC_((c), CC_ASCII_, is_base_ASCII )
2056
- #define isU8_BLANK_LC (c ) WRAP_U8_LC_((c), CC_BLANK_, is_base_BLANK )
2057
- #define isU8_CASED_LC (c ) WRAP_U8_LC_((c), CC_CASED_, is_base_CASED )
2058
- #define isU8_CNTRL_LC (c ) WRAP_U8_LC_((c), CC_CNTRL_, is_base_CNTRL )
2059
- #define isU8_DIGIT_LC (c ) WRAP_U8_LC_((c), CC_DIGIT_, is_base_DIGIT )
2060
- #define isU8_GRAPH_LC (c ) WRAP_U8_LC_((c), CC_GRAPH_, is_base_GRAPH )
2061
- #define isU8_IDFIRST_LC (c ) WRAP_U8_LC_((c), CC_IDFIRST_, is_base_IDFIRST )
2062
- #define isU8_LOWER_LC (c ) WRAP_U8_LC_((c), CC_LOWER_, is_base_LOWER )
2063
- #define isU8_PRINT_LC (c ) WRAP_U8_LC_((c), CC_PRINT_, is_base_PRINT )
2064
- #define isU8_PUNCT_LC (c ) WRAP_U8_LC_((c), CC_PUNCT_, is_base_PUNCT )
2065
- #define isU8_SPACE_LC (c ) WRAP_U8_LC_((c), CC_SPACE_, is_base_SPACE )
2066
- #define isU8_UPPER_LC (c ) WRAP_U8_LC_((c), CC_UPPER_, is_base_UPPER )
2067
- #define isU8_WORDCHAR_LC (c ) WRAP_U8_LC_((c), CC_WORDCHAR_, is_base_WORDCHAR )
2068
- #define isU8_XDIGIT_LC (c ) WRAP_U8_LC_((c), CC_XDIGIT_, is_base_XDIGIT )
2069
-
2070
- #define toU8_LOWER_LC (c ) WRAP_U8_LC_((c), CC_TOLOWER_, to_base_LOWER )
2071
- #define toU8_UPPER_LC (c ) WRAP_U8_LC_((c), CC_TOUPPER_, to_base_UPPER )
2053
+ WRAP_U8_LC_((c), CC_ALPHANUMERIC_, is_posix_ALPHANUMERIC )
2054
+ #define isU8_ALPHA_LC (c ) WRAP_U8_LC_((c), CC_ALPHA_, is_posix_ALPHA )
2055
+ #define isU8_ASCII_LC (c ) WRAP_U8_LC_((c), CC_ASCII_, is_posix_ASCII )
2056
+ #define isU8_BLANK_LC (c ) WRAP_U8_LC_((c), CC_BLANK_, is_posix_BLANK )
2057
+ #define isU8_CASED_LC (c ) WRAP_U8_LC_((c), CC_CASED_, is_posix_CASED )
2058
+ #define isU8_CNTRL_LC (c ) WRAP_U8_LC_((c), CC_CNTRL_, is_posix_CNTRL )
2059
+ #define isU8_DIGIT_LC (c ) WRAP_U8_LC_((c), CC_DIGIT_, is_posix_DIGIT )
2060
+ #define isU8_GRAPH_LC (c ) WRAP_U8_LC_((c), CC_GRAPH_, is_posix_GRAPH )
2061
+ #define isU8_IDFIRST_LC (c ) WRAP_U8_LC_((c), CC_IDFIRST_, is_posix_IDFIRST )
2062
+ #define isU8_LOWER_LC (c ) WRAP_U8_LC_((c), CC_LOWER_, is_posix_LOWER )
2063
+ #define isU8_PRINT_LC (c ) WRAP_U8_LC_((c), CC_PRINT_, is_posix_PRINT )
2064
+ #define isU8_PUNCT_LC (c ) WRAP_U8_LC_((c), CC_PUNCT_, is_posix_PUNCT )
2065
+ #define isU8_SPACE_LC (c ) WRAP_U8_LC_((c), CC_SPACE_, is_posix_SPACE )
2066
+ #define isU8_UPPER_LC (c ) WRAP_U8_LC_((c), CC_UPPER_, is_posix_UPPER )
2067
+ #define isU8_WORDCHAR_LC (c ) WRAP_U8_LC_((c), CC_WORDCHAR_, is_posix_WORDCHAR )
2068
+ #define isU8_XDIGIT_LC (c ) WRAP_U8_LC_((c), CC_XDIGIT_, is_posix_XDIGIT )
2069
+
2070
+ #define toU8_LOWER_LC (c ) WRAP_U8_LC_((c), CC_TOLOWER_, to_posix_LOWER )
2071
+ #define toU8_UPPER_LC (c ) WRAP_U8_LC_((c), CC_TOUPPER_, to_posix_UPPER )
2072
2072
#define toU8_FOLD_LC (c ) toU8_LOWER_LC(c)
2073
2073
2074
2074
/* The definitions below use the ones above to create versions in which the
0 commit comments