Lines Matching defs:c
645 =for apidoc Am|bool|memCHRs|"list"|char c
646 Returns the position of the first occurrence of the byte C<c> in the literal
647 string C<"list">, or NULL if C<c> doesn't appear in C<"list">. All bytes are
648 treated as unsigned char. Thus this macro can be used to determine if C<c> is
649 in a set of particular characters. Unlike L<strchr(3)>, it works even if C<c>
743 #define memCHRs(s1,c) ((const char *) memchr(ASSERT_IS_LITERAL(s1) , c, sizeof(s1)-1))
1442 /* FITS_IN_8_BITS(c) returns true if c doesn't have a bit set other than in
1446 * sure that the machine has an 8-bit byte, so if c is stored in a byte, the
1454 /* The '| 0' part in ASSERT_NOT_PTR ensures a compiler error if c is not
1456 # define FITS_IN_8_BITS(c) ( (sizeof(c) == 1) \
1457 || (((WIDEST_UTYPE) ASSERT_NOT_PTR(c)) >> 8) == 0)
1459 # define FITS_IN_8_BITS(c) (1)
1462 /* Returns true if l <= c <= (l + n), where 'l' and 'n' are non-negative
1467 #define withinCOUNT(c, l, n) (__ASSERT_((NV) (l) >= 0) \
1469 withinCOUNT_KNOWN_VALID_((c), (l), (n)))
1476 #define withinCOUNT_KNOWN_VALID_(c, l, n) \
1477 ((((WIDEST_UTYPE) (c)) - ASSERT_NOT_PTR(l)) \
1480 /* Returns true if c is in the range l..u, where 'l' is non-negative
1483 #define inRANGE(c, l, u) (__ASSERT_((NV) (l) >= 0) __ASSERT_((u) >= (l)) \
1484 ( (sizeof(c) == sizeof(U8)) ? inRANGE_helper_(U8, (c), (l), ((u))) \
1485 : (sizeof(c) == sizeof(U16)) ? inRANGE_helper_(U16,(c), (l), ((u))) \
1486 : (sizeof(c) == sizeof(U32)) ? inRANGE_helper_(U32,(c), (l), ((u))) \
1487 : (__ASSERT_(sizeof(c) == sizeof(WIDEST_UTYPE)) \
1488 inRANGE_helper_(WIDEST_UTYPE,(c), (l), ((u))))))
1493 #define inRANGE_helper_(cast, c, l, u) \
1494 withinCOUNT_KNOWN_VALID_(((cast) (c)), (l), ((u) - (l)))
1507 * The cast here is used instead of '(c) >= 0', because some compilers emit
1510 * && ((c) == '\0' || (c) > 0)
1513 # define isASCII(c) (((WIDEST_UTYPE) ASSERT_NOT_PTR(c)) < 128)
1519 #define isOCTAL_A(c) ((((WIDEST_UTYPE) ASSERT_NOT_PTR(c)) & ~7) == '0')
1532 * (in reginclass() in regexec.c). Except \v should be last, as it isn't a
1559 * structures in regcomp.[ch] and regexec.c. */
1623 # define generic_isCC_(c, classnum) cBOOL(FITS_IN_8_BITS(c) \
1624 && (PL_charclass[(U8) (c)] & CC_mask_(classnum)))
1633 # define generic_isCC_A_(c, classnum) (FITS_IN_8_BITS(c) \
1634 && ((PL_charclass[(U8) (c)] & CC_mask_A_(classnum)) \
1640 # define isALPHA_A(c) generic_isCC_A_(c, CC_ALPHA_)
1641 # define isGRAPH_A(c) generic_isCC_A_(c, CC_GRAPH_)
1642 # define isLOWER_A(c) generic_isCC_A_(c, CC_LOWER_)
1643 # define isPRINT_A(c) generic_isCC_A_(c, CC_PRINT_)
1644 # define isUPPER_A(c) generic_isCC_A_(c, CC_UPPER_)
1647 # define isALPHA_A(c) inRANGE((~('A' ^ 'a') & (c)), 'A', 'Z')
1648 # define isGRAPH_A(c) inRANGE(c, ' ' + 1, 0x7e)
1649 # define isLOWER_A(c) inRANGE(c, 'a', 'z')
1650 # define isPRINT_A(c) inRANGE(c, ' ', 0x7e)
1651 # define isUPPER_A(c) inRANGE(c, 'A', 'Z')
1653 # define isALPHANUMERIC_A(c) generic_isCC_A_(c, CC_ALPHANUMERIC_)
1654 # define isBLANK_A(c) generic_isCC_A_(c, CC_BLANK_)
1655 # define isCNTRL_A(c) generic_isCC_A_(c, CC_CNTRL_)
1656 # define isDIGIT_A(c) inRANGE(c, '0', '9')
1657 # define isPUNCT_A(c) generic_isCC_A_(c, CC_PUNCT_)
1658 # define isSPACE_A(c) generic_isCC_A_(c, CC_SPACE_)
1659 # define isWORDCHAR_A(c) generic_isCC_A_(c, CC_WORDCHAR_)
1660 # define isXDIGIT_A(c) generic_isCC_(c, CC_XDIGIT_) /* No non-ASCII xdigits */
1661 # define isIDFIRST_A(c) generic_isCC_A_(c, CC_IDFIRST_)
1662 # define isALPHA_L1(c) generic_isCC_(c, CC_ALPHA_)
1663 # define isALPHANUMERIC_L1(c) generic_isCC_(c, CC_ALPHANUMERIC_)
1664 # define isBLANK_L1(c) generic_isCC_(c, CC_BLANK_)
1667 # define isCHARNAME_CONT(c) generic_isCC_(c, CC_CHARNAME_CONT_)
1669 # define isCNTRL_L1(c) generic_isCC_(c, CC_CNTRL_)
1670 # define isGRAPH_L1(c) generic_isCC_(c, CC_GRAPH_)
1671 # define isLOWER_L1(c) generic_isCC_(c, CC_LOWER_)
1672 # define isPRINT_L1(c) generic_isCC_(c, CC_PRINT_)
1673 # define isPSXSPC_L1(c) isSPACE_L1(c)
1674 # define isPUNCT_L1(c) generic_isCC_(c, CC_PUNCT_)
1675 # define isSPACE_L1(c) generic_isCC_(c, CC_SPACE_)
1676 # define isUPPER_L1(c) generic_isCC_(c, CC_UPPER_)
1677 # define isWORDCHAR_L1(c) generic_isCC_(c, CC_WORDCHAR_)
1678 # define isIDFIRST_L1(c) generic_isCC_(c, CC_IDFIRST_)
1681 # define isASCII(c) generic_isCC_(c, CC_ASCII_)
1686 # define HAS_NONLATIN1_SIMPLE_FOLD_CLOSURE(c) \
1687 (( ! cBOOL(FITS_IN_8_BITS(c))) \
1688 || (PL_charclass[(U8) (c)] & CC_mask_(CC_NONLATIN1_SIMPLE_FOLD_)))
1690 # define IS_NON_FINAL_FOLD(c) generic_isCC_(c, CC_NON_FINAL_FOLD_)
1691 # define IS_IN_SOME_FOLD_L1(c) generic_isCC_(c, CC_IS_IN_SOME_FOLD_)
1695 # define HAS_NONLATIN1_FOLD_CLOSURE(c) \
1696 ( (! cBOOL(FITS_IN_8_BITS(c))) \
1697 || (PL_charclass[(U8) (c)] & CC_mask_(CC_NONLATIN1_FOLD_)))
1699 # define _isQUOTEMETA(c) generic_isCC_(c, CC_QUOTEMETA_)
1701 /* is c a control character for which we have a mnemonic? */
1703 # define isMNEMONIC_CNTRL(c) generic_isCC_(c, CC_MNEMONIC_CNTRL_)
1711 # define isDIGIT_A(c) inRANGE(c, '0', '9')
1712 # define isBLANK_A(c) ((c) == ' ' || (c) == '\t')
1713 # define isSPACE_A(c) (isBLANK_A(c) \
1714 || (c) == '\n' \
1715 || (c) == '\r' \
1716 || (c) == '\v' \
1717 || (c) == '\f')
1722 # define isLOWER_A(c) inRANGE((c), 'a', 'i') \
1723 || inRANGE((c), 'j', 'r') \
1724 || inRANGE((c), 's', 'z')
1725 # define isUPPER_A(c) inRANGE((c), 'A', 'I') \
1726 || inRANGE((c), 'J', 'R') \
1727 || inRANGE((c), 'S', 'Z')
1728 # define isALPHA_A(c) (isUPPER_A(c) || isLOWER_A(c))
1729 # define isALPHANUMERIC_A(c) (isALPHA_A(c) || isDIGIT_A(c))
1730 # define isWORDCHAR_A(c) (isALPHANUMERIC_A(c) || (c) == '_')
1731 # define isIDFIRST_A(c) (isALPHA_A(c) || (c) == '_')
1732 # define isXDIGIT_A(c) ( isDIGIT_A(c) \
1733 || inRANGE((c), 'a', 'f') \
1734 || inRANGE((c), 'A', 'F')
1735 # define isPUNCT_A(c) ((c) == '-' || (c) == '!' || (c) == '"' \
1736 || (c) == '#' || (c) == '$' || (c) == '%' \
1737 || (c) == '&' || (c) == '\'' || (c) == '(' \
1738 || (c) == ')' || (c) == '*' || (c) == '+' \
1739 || (c) == ',' || (c) == '.' || (c) == '/' \
1740 || (c) == ':' || (c) == ';' || (c) == '<' \
1741 || (c) == '=' || (c) == '>' || (c) == '?' \
1742 || (c) == '@' || (c) == '[' || (c) == '\\' \
1743 || (c) == ']' || (c) == '^' || (c) == '_' \
1744 || (c) == '`' || (c) == '{' || (c) == '|' \
1745 || (c) == '}' || (c) == '~')
1746 # define isGRAPH_A(c) (isALPHANUMERIC_A(c) || isPUNCT_A(c))
1747 # define isPRINT_A(c) (isGRAPH_A(c) || (c) == ' ')
1753 # define isCNTRL_A(c) ((c) == '\0' || (c) == '\a' || (c) == '\b' \
1754 || (c) == '\f' || (c) == '\n' || (c) == '\r' \
1755 || (c) == '\t' || (c) == '\v' \
1756 || inRANGE((c), 1, 3) /* SOH, STX, ETX */ \
1757 || (c) == 7F /* U+7F DEL */ \
1758 || inRANGE((c), 0x0E, 0x13) /* SO SI DLE \
1760 || (c) == 0x18 /* U+18 CAN */ \
1761 || (c) == 0x19 /* U+19 EOM */ \
1762 || inRANGE((c), 0x1C, 0x1F) /* [FGRU]S */ \
1763 || (c) == 0x26 /* U+17 ETB */ \
1764 || (c) == 0x27 /* U+1B ESC */ \
1765 || (c) == 0x2D /* U+05 ENQ */ \
1766 || (c) == 0x2E /* U+06 ACK */ \
1767 || (c) == 0x32 /* U+16 SYN */ \
1768 || (c) == 0x37 /* U+04 EOT */ \
1769 || (c) == 0x3C /* U+14 DC4 */ \
1770 || (c) == 0x3D /* U+15 NAK */ \
1771 || (c) == 0x3F)/* U+1A SUB */
1772 # define isASCII(c) (isCNTRL_A(c) || isPRINT_A(c))
1775 # define isCNTRL_A(c) (isASCII(c) && ! isPRINT_A(c))
1785 # define isALPHA_L1(c) (isUPPER_L1(c) || isLOWER_L1(c))
1786 # define isALPHANUMERIC_L1(c) (isALPHA_L1(c) || isDIGIT_A(c))
1787 # define isBLANK_L1(c) (isBLANK_A(c) \
1788 || (FITS_IN_8_BITS(c) \
1789 && NATIVE_TO_LATIN1((U8) c) == 0xA0))
1790 # define isCNTRL_L1(c) (FITS_IN_8_BITS(c) && (! isPRINT_L1(c)))
1791 # define isGRAPH_L1(c) (isPRINT_L1(c) && (! isBLANK_L1(c)))
1792 # define isLOWER_L1(c) (isLOWER_A(c) \
1793 || (FITS_IN_8_BITS(c) \
1794 && (( NATIVE_TO_LATIN1((U8) c) >= 0xDF \
1795 && NATIVE_TO_LATIN1((U8) c) != 0xF7) \
1796 || NATIVE_TO_LATIN1((U8) c) == 0xAA \
1797 || NATIVE_TO_LATIN1((U8) c) == 0xBA \
1798 || NATIVE_TO_LATIN1((U8) c) == 0xB5)))
1799 # define isPRINT_L1(c) (isPRINT_A(c) \
1800 || (FITS_IN_8_BITS(c) \
1801 && NATIVE_TO_LATIN1((U8) c) >= 0xA0))
1802 # define isPUNCT_L1(c) (isPUNCT_A(c) \
1803 || (FITS_IN_8_BITS(c) \
1804 && ( NATIVE_TO_LATIN1((U8) c) == 0xA1 \
1805 || NATIVE_TO_LATIN1((U8) c) == 0xA7 \
1806 || NATIVE_TO_LATIN1((U8) c) == 0xAB \
1807 || NATIVE_TO_LATIN1((U8) c) == 0xB6 \
1808 || NATIVE_TO_LATIN1((U8) c) == 0xB7 \
1809 || NATIVE_TO_LATIN1((U8) c) == 0xBB \
1810 || NATIVE_TO_LATIN1((U8) c) == 0xBF)))
1811 # define isSPACE_L1(c) (isSPACE_A(c) \
1812 || (FITS_IN_8_BITS(c) \
1813 && ( NATIVE_TO_LATIN1((U8) c) == 0x85 \
1814 || NATIVE_TO_LATIN1((U8) c) == 0xA0)))
1815 # define isUPPER_L1(c) (isUPPER_A(c) \
1816 || (FITS_IN_8_BITS(c) \
1817 && ( IN_RANGE(NATIVE_TO_LATIN1((U8) c), \
1819 && NATIVE_TO_LATIN1((U8) c) != 0xD7)))
1820 # define isWORDCHAR_L1(c) (isIDFIRST_L1(c) || isDIGIT_A(c))
1821 # define isIDFIRST_L1(c) (isALPHA_L1(c) || NATIVE_TO_LATIN1(c) == '_')
1822 # define isCHARNAME_CONT(c) (isWORDCHAR_L1(c) \
1823 || isBLANK_L1(c) \
1824 || (c) == '-' \
1825 || (c) == '(' \
1826 || (c) == ')')
1830 # define isQUOTEMETA_(c) (FITS_IN_8_BITS(c) && ! isWORDCHAR_L1(c))
1839 # define generic_isCC_(c, classnum) \
1840 (FITS_IN_8_BITS(c) && S_bootstrap_ctype((U8) (c), (classnum), TRUE))
1841 # define generic_isCC_A_(c, classnum) \
1842 (FITS_IN_8_BITS(c) && S_bootstrap_ctype((U8) (c), (classnum), FALSE))
1845 #define isALPHANUMERIC(c) isALPHANUMERIC_A(c)
1846 #define isALPHA(c) isALPHA_A(c)
1847 #define isASCII_A(c) isASCII(c)
1848 #define isASCII_L1(c) isASCII(c)
1849 #define isBLANK(c) isBLANK_A(c)
1850 #define isCNTRL(c) isCNTRL_A(c)
1851 #define isDIGIT(c) isDIGIT_A(c)
1852 #define isGRAPH(c) isGRAPH_A(c)
1853 #define isIDFIRST(c) isIDFIRST_A(c)
1854 #define isLOWER(c) isLOWER_A(c)
1855 #define isPRINT(c) isPRINT_A(c)
1856 #define isPSXSPC_A(c) isSPACE_A(c)
1857 #define isPSXSPC(c) isPSXSPC_A(c)
1858 #define isPSXSPC_L1(c) isSPACE_L1(c)
1859 #define isPUNCT(c) isPUNCT_A(c)
1860 #define isSPACE(c) isSPACE_A(c)
1861 #define isUPPER(c) isUPPER_A(c)
1862 #define isWORDCHAR(c) isWORDCHAR_A(c)
1863 #define isXDIGIT(c) isXDIGIT_A(c)
1866 #define toLOWER(c) (isASCII(c) ? toLOWER_LATIN1(c) : (c))
1867 #define toUPPER(c) (isASCII(c) ? toUPPER_LATIN1_MOD(c) : (c))
1874 #define toLOWER(c) (isUPPER(c) ? (U8)((c) + ('a' - 'A')) : (c))
1875 #define toUPPER(c) (isLOWER(c) ? (U8)((c) - ('a' - 'A')) : (c))
1881 #define toFOLD(c) toLOWER(c)
1882 #define toTITLE(c) toUPPER(c)
1884 #define toLOWER_A(c) toLOWER(c)
1885 #define toUPPER_A(c) toUPPER(c)
1886 #define toFOLD_A(c) toFOLD(c)
1887 #define toTITLE_A(c) toTITLE(c)
1890 #define toLOWER_LATIN1(c) ((! FITS_IN_8_BITS(c)) \
1891 ? (c) \
1892 : PL_latin1_lc[ (U8) (c) ])
1893 #define toLOWER_L1(c) toLOWER_LATIN1(c) /* Synonym for consistency */
1898 #define toUPPER_LATIN1_MOD(c) ((! FITS_IN_8_BITS(c)) \
1899 ? (c) \
1900 : PL_mod_latin1_uc[ (U8) (c) ])
1912 * isALPHA_LC, which uses the current LC_CTYPE locale. 'c' is the code point
1916 * test this is passed in 'non_utf8'. If 'c' is above 255, 0 is returned. For
1919 #define generic_LC_base_(c, classnum, non_utf8_func) \
1920 (! FITS_IN_8_BITS(c) \
1923 ? cBOOL(PL_charclass[(U8) (c)] & CC_mask_(classnum)) \
1924 : cBOOL(non_utf8_func(c)))
1929 # define generic_LC_(c, classnum, non_utf8_func) \
1930 generic_LC_base_(c, classnum, non_utf8_func)
1932 # define generic_LC_(c, classnum, non_utf8_func) \
1933 generic_isCC_A_(c, classnum)
1950 # define is_posix_ASCII(c) isascii((U8) (c))
1952 # define is_posix_ASCII(c) isASCII(c)
1956 # define is_posix_BLANK(c) isblank((U8) (c))
1958 # define is_posix_BLANK(c) isBLANK(c)
1962 #define is_posix_CNTRL(c) iscntrl((U8) (c))
1963 #define is_posix_IDFIRST(c) (UNLIKELY((c) == '_') || is_posix_ALPHA(c))
1964 #define is_posix_SPACE(c) isspace((U8) (c))
1965 #define is_posix_WORDCHAR(c) (UNLIKELY((c) == '_') || is_posix_ALPHANUMERIC(c))
1968 #define to_posix_LOWER(c) tolower((U8) (c))
1969 #define to_posix_UPPER(c) toupper((U8) (c))
1970 #define to_posix_FOLD(c) to_posix_LOWER(c)
1984 # define is_posix_ALPHA(c) \
1985 (isalpha((U8) (c)) && ! is_posix_PUNCT(c))
1986 # define is_posix_ALPHANUMERIC(c) \
1987 (isalnum((U8) (c)) && ! is_posix_PUNCT(c))
1988 # define is_posix_CASED(c) \
1989 ((isupper((U8) (c)) || islower((U8) (c))) && ! is_posix_PUNCT(c))
1990 # define is_posix_DIGIT(c) \
1991 (isdigit((U8) (c)) && ! is_posix_PUNCT(c))
1992 # define is_posix_GRAPH(c) \
1993 (isgraph((U8) (c)) && ! is_posix_CNTRL(c))
1994 # define is_posix_LOWER(c) \
1995 (islower((U8) (c)) && ! is_posix_PUNCT(c))
1996 # define is_posix_PRINT(c) \
1997 (isprint((U8) (c)) && ! is_posix_CNTRL(c))
1998 # define is_posix_PUNCT(c) \
1999 (ispunct((U8) (c)) && ! is_posix_CNTRL(c))
2000 # define is_posix_UPPER(c) \
2001 (isupper((U8) (c)) && ! is_posix_PUNCT(c))
2002 # define is_posix_XDIGIT(c) \
2003 (isxdigit((U8) (c)) && ! is_posix_PUNCT(c))
2008 # define is_posix_ALPHA(c) isalpha((U8) (c))
2009 # define is_posix_ALPHANUMERIC(c) isalnum((U8) (c))
2010 # define is_posix_CASED(c) (islower((U8) (c)) || isupper((U8) (c)))
2011 # define is_posix_DIGIT(c) isdigit((U8) (c))
2017 # define is_posix_GRAPH(c) (isgraph((U8) (c)) && ! isspace((U8) (c)))
2019 # define is_posix_GRAPH(c) isgraph((U8) (c))
2021 # define is_posix_LOWER(c) islower((U8) (c))
2022 # define is_posix_PRINT(c) isprint((U8) (c))
2023 # define is_posix_PUNCT(c) ispunct((U8) (c))
2024 # define is_posix_UPPER(c) isupper((U8) (c))
2025 # define is_posix_XDIGIT(c) isxdigit((U8) (c))
2040 # define WRAP_U8_LC_(c, classnum, posix) posix(c)
2042 #define isU8_ALPHANUMERIC_LC(c) \
2043 WRAP_U8_LC_((c), CC_ALPHANUMERIC_, is_posix_ALPHANUMERIC)
2044 #define isU8_ALPHA_LC(c) WRAP_U8_LC_((c), CC_ALPHA_, is_posix_ALPHA)
2045 #define isU8_ASCII_LC(c) WRAP_U8_LC_((c), CC_ASCII_, is_posix_ASCII)
2046 #define isU8_BLANK_LC(c) WRAP_U8_LC_((c), CC_BLANK_, is_posix_BLANK)
2047 #define isU8_CASED_LC(c) WRAP_U8_LC_((c), CC_CASED_, is_posix_CASED)
2048 #define isU8_CNTRL_LC(c) WRAP_U8_LC_((c), CC_CNTRL_, is_posix_CNTRL)
2049 #define isU8_DIGIT_LC(c) WRAP_U8_LC_((c), CC_DIGIT_, is_posix_DIGIT)
2050 #define isU8_GRAPH_LC(c) WRAP_U8_LC_((c), CC_GRAPH_, is_posix_GRAPH)
2051 #define isU8_IDFIRST_LC(c) WRAP_U8_LC_((c), CC_IDFIRST_, is_posix_IDFIRST)
2052 #define isU8_LOWER_LC(c) WRAP_U8_LC_((c), CC_LOWER_, is_posix_LOWER)
2053 #define isU8_PRINT_LC(c) WRAP_U8_LC_((c), CC_PRINT_, is_posix_PRINT)
2054 #define isU8_PUNCT_LC(c) WRAP_U8_LC_((c), CC_PUNCT_, is_posix_PUNCT)
2055 #define isU8_SPACE_LC(c) WRAP_U8_LC_((c), CC_SPACE_, is_posix_SPACE)
2056 #define isU8_UPPER_LC(c) WRAP_U8_LC_((c), CC_UPPER_, is_posix_UPPER)
2057 #define isU8_WORDCHAR_LC(c) WRAP_U8_LC_((c), CC_WORDCHAR_, is_posix_WORDCHAR)
2058 #define isU8_XDIGIT_LC(c) WRAP_U8_LC_((c), CC_XDIGIT_, is_posix_XDIGIT)
2060 #define toU8_LOWER_LC(c) WRAP_U8_LC_((c), CC_TOLOWER_, to_posix_LOWER)
2061 #define toU8_UPPER_LC(c) WRAP_U8_LC_((c), CC_TOUPPER_, to_posix_UPPER)
2062 #define toU8_FOLD_LC(c) toU8_LOWER_LC(c)
2071 #define isASCII_LC(c) (FITS_IN_8_BITS(c) && isU8_ASCII_LC(c))
2072 #define isALPHA_LC(c) generic_LC_(c, CC_ALPHA_, isU8_ALPHA_LC)
2073 #define isALPHANUMERIC_LC(c) \
2074 generic_LC_(c, CC_ALPHANUMERIC_, isU8_ALPHANUMERIC_LC)
2075 #define isBLANK_LC(c) generic_LC_(c, CC_BLANK_, isU8_BLANK_LC)
2076 #define isCASED_LC(c) generic_LC_(c, CC_CASED_, isU8_CASED_LC)
2077 #define isCNTRL_LC(c) generic_LC_(c, CC_CNTRL_, isU8_CNTRL_LC)
2078 #define isDIGIT_LC(c) generic_LC_(c, CC_DIGIT_, isU8_DIGIT_LC)
2079 #define isGRAPH_LC(c) generic_LC_(c, CC_GRAPH_, isU8_GRAPH_LC)
2080 #define isIDFIRST_LC(c) generic_LC_(c, CC_IDFIRST_, isU8_IDFIRST_LC)
2081 #define isLOWER_LC(c) generic_LC_(c, CC_LOWER_, isU8_LOWER_LC)
2082 #define isPRINT_LC(c) generic_LC_(c, CC_PRINT_, isU8_PRINT_LC)
2083 #define isPUNCT_LC(c) generic_LC_(c, CC_PUNCT_, isU8_PUNCT_LC)
2084 #define isSPACE_LC(c) generic_LC_(c, CC_SPACE_, isU8_SPACE_LC)
2085 #define isUPPER_LC(c) generic_LC_(c, CC_UPPER_, isU8_UPPER_LC)
2086 #define isWORDCHAR_LC(c) generic_LC_(c, CC_WORDCHAR_, isU8_WORDCHAR_LC)
2087 #define isXDIGIT_LC(c) generic_LC_(c, CC_XDIGIT_, isU8_XDIGIT_LC)
2090 # define toLOWER_LC(c) toLOWER_A(c)
2091 # define toUPPER_LC(c) toUPPER_A(c)
2092 # define toFOLD_LC(c) toFOLD_A(c)
2100 # define toLOWER_LC(c) ((! FITS_IN_8_BITS(c)) \
2101 ? (c) \
2103 ? PL_latin1_lc[ (U8) (c) ] \
2104 : ((U8) toU8_LOWER_LC(c))))
2112 # define toUPPER_LC(c) \
2113 ((! FITS_IN_8_BITS(c)) \
2114 ? (c) \
2116 ? ((U8) toU8_UPPER_LC(c)) \
2117 : (UNLIKELY(((U8)(c)) == MICRO_SIGN) \
2119 : ((UNLIKELY(((U8) (c)) == LATIN_SMALL_LETTER_Y_WITH_DIAERESIS) \
2121 : (UNLIKELY(((U8)(c)) == LATIN_SMALL_LETTER_SHARP_S) \
2122 ? (__ASSERT_(0) (c)) /* Fail on Sharp S in DEBUGGING */ \
2123 : PL_mod_latin1_uc[ (U8) (c) ]))))))
2131 # define toFOLD_LC(c) \
2132 ((UNLIKELY((c) == MICRO_SIGN) && IN_UTF8_CTYPE_LOCALE) \
2135 || LIKELY((c) != LATIN_SMALL_LETTER_SHARP_S)) \
2136 toLOWER_LC(c)))
2139 #define isIDCONT(c) isWORDCHAR(c)
2140 #define isIDCONT_A(c) isWORDCHAR_A(c)
2141 #define isIDCONT_L1(c) isWORDCHAR_L1(c)
2142 #define isIDCONT_LC(c) isWORDCHAR_LC(c)
2143 #define isPSXSPC_LC(c) isSPACE_LC(c)
2146 * isALPHA_uvchr. 'c' is the code point to check. 'classnum' is the POSIX class
2149 * single argument 'c' and returns the desired value. These exist for those
2153 * generic_uvchr_() won't compile if 'c' isn't unsigned, as it won't match the
2159 #define generic_uvchr_(classnum, above_latin1, c) ((c) < 256 \
2160 ? generic_isCC_(c, classnum) \
2161 : above_latin1(c))
2162 #define generic_invlist_uvchr_(classnum, c) ((c) < 256 \
2163 ? generic_isCC_(c, classnum) \
2164 : _is_uni_FOO(classnum, c))
2165 #define isALPHA_uvchr(c) generic_invlist_uvchr_(CC_ALPHA_, c)
2166 #define isALPHANUMERIC_uvchr(c) generic_invlist_uvchr_(CC_ALPHANUMERIC_, c)
2167 #define isASCII_uvchr(c) isASCII(c)
2168 #define isBLANK_uvchr(c) generic_uvchr_(CC_BLANK_, is_HORIZWS_cp_high, c)
2169 #define isCNTRL_uvchr(c) isCNTRL_L1(c) /* All controls are in Latin1 */
2170 #define isDIGIT_uvchr(c) generic_invlist_uvchr_(CC_DIGIT_, c)
2171 #define isGRAPH_uvchr(c) generic_invlist_uvchr_(CC_GRAPH_, c)
2172 #define isIDCONT_uvchr(c) \
2173 generic_uvchr_(CC_WORDCHAR_, _is_uni_perl_idcont, c)
2174 #define isIDFIRST_uvchr(c) \
2175 generic_uvchr_(CC_IDFIRST_, _is_uni_perl_idstart, c)
2176 #define isLOWER_uvchr(c) generic_invlist_uvchr_(CC_LOWER_, c)
2177 #define isPRINT_uvchr(c) generic_invlist_uvchr_(CC_PRINT_, c)
2179 #define isPUNCT_uvchr(c) generic_invlist_uvchr_(CC_PUNCT_, c)
2180 #define isSPACE_uvchr(c) generic_uvchr_(CC_SPACE_, is_XPERLSPACE_cp_high, c)
2181 #define isPSXSPC_uvchr(c) isSPACE_uvchr(c)
2183 #define isUPPER_uvchr(c) generic_invlist_uvchr_(CC_UPPER_, c)
2184 #define isVERTWS_uvchr(c) generic_uvchr_(CC_VERTSPACE_, is_VERTWS_cp_high, c)
2185 #define isWORDCHAR_uvchr(c) generic_invlist_uvchr_(CC_WORDCHAR_, c)
2186 #define isXDIGIT_uvchr(c) generic_uvchr_(CC_XDIGIT_, is_XDIGIT_cp_high, c)
2188 #define toFOLD_uvchr(c,s,l) to_uni_fold(c,s,l)
2189 #define toLOWER_uvchr(c,s,l) to_uni_lower(c,s,l)
2190 #define toTITLE_uvchr(c,s,l) to_uni_title(c,s,l)
2191 #define toUPPER_uvchr(c,s,l) to_uni_upper(c,s,l)
2195 #define isALPHA_uni(c) isALPHA_uvchr(c)
2196 #define isALPHANUMERIC_uni(c) isALPHANUMERIC_uvchr(c)
2197 #define isASCII_uni(c) isASCII_uvchr(c)
2198 #define isBLANK_uni(c) isBLANK_uvchr(c)
2199 #define isCNTRL_uni(c) isCNTRL_uvchr(c)
2200 #define isDIGIT_uni(c) isDIGIT_uvchr(c)
2201 #define isGRAPH_uni(c) isGRAPH_uvchr(c)
2202 #define isIDCONT_uni(c) isIDCONT_uvchr(c)
2203 #define isIDFIRST_uni(c) isIDFIRST_uvchr(c)
2204 #define isLOWER_uni(c) isLOWER_uvchr(c)
2205 #define isPRINT_uni(c) isPRINT_uvchr(c)
2206 #define isPUNCT_uni(c) isPUNCT_uvchr(c)
2207 #define isSPACE_uni(c) isSPACE_uvchr(c)
2208 #define isPSXSPC_uni(c) isPSXSPC_uvchr(c)
2209 #define isUPPER_uni(c) isUPPER_uvchr(c)
2210 #define isVERTWS_uni(c) isVERTWS_uvchr(c)
2211 #define isWORDCHAR_uni(c) isWORDCHAR_uvchr(c)
2212 #define isXDIGIT_uni(c) isXDIGIT_uvchr(c)
2213 #define toFOLD_uni(c,s,l) toFOLD_uvchr(c,s,l)
2214 #define toLOWER_uni(c,s,l) toLOWER_uvchr(c,s,l)
2215 #define toTITLE_uni(c,s,l) toTITLE_uvchr(c,s,l)
2216 #define toUPPER_uni(c,s,l) toUPPER_uvchr(c,s,l)
2223 #define generic_LC_uvchr_(latin1, above_latin1, c) \
2224 (c < 256 ? latin1(c) : above_latin1(c))
2225 #define generic_LC_invlist_uvchr_(latin1, classnum, c) \
2226 (c < 256 ? latin1(c) : _is_uni_FOO(classnum, c))
2228 #define isALPHA_LC_uvchr(c) generic_LC_invlist_uvchr_(isALPHA_LC, CC_ALPHA_, c)
2229 #define isALPHANUMERIC_LC_uvchr(c) generic_LC_invlist_uvchr_(isALPHANUMERIC_LC, \
2230 CC_ALPHANUMERIC_, c)
2231 #define isASCII_LC_uvchr(c) isASCII_LC(c)
2232 #define isBLANK_LC_uvchr(c) generic_LC_uvchr_(isBLANK_LC, \
2233 is_HORIZWS_cp_high, c)
2234 #define isCNTRL_LC_uvchr(c) (c < 256 ? isCNTRL_LC(c) : 0)
2235 #define isDIGIT_LC_uvchr(c) generic_LC_invlist_uvchr_(isDIGIT_LC, CC_DIGIT_, c)
2236 #define isGRAPH_LC_uvchr(c) generic_LC_invlist_uvchr_(isGRAPH_LC, CC_GRAPH_, c)
2237 #define isIDCONT_LC_uvchr(c) generic_LC_uvchr_(isIDCONT_LC, \
2238 _is_uni_perl_idcont, c)
2239 #define isIDFIRST_LC_uvchr(c) generic_LC_uvchr_(isIDFIRST_LC, \
2240 _is_uni_perl_idstart, c)
2241 #define isLOWER_LC_uvchr(c) generic_LC_invlist_uvchr_(isLOWER_LC, CC_LOWER_, c)
2242 #define isPRINT_LC_uvchr(c) generic_LC_invlist_uvchr_(isPRINT_LC, CC_PRINT_, c)
2243 #define isPSXSPC_LC_uvchr(c) isSPACE_LC_uvchr(c)
2244 #define isPUNCT_LC_uvchr(c) generic_LC_invlist_uvchr_(isPUNCT_LC, CC_PUNCT_, c)
2245 #define isSPACE_LC_uvchr(c) generic_LC_uvchr_(isSPACE_LC, \
2246 is_XPERLSPACE_cp_high, c)
2247 #define isUPPER_LC_uvchr(c) generic_LC_invlist_uvchr_(isUPPER_LC, CC_UPPER_, c)
2248 #define isWORDCHAR_LC_uvchr(c) generic_LC_invlist_uvchr_(isWORDCHAR_LC, \
2249 CC_WORDCHAR_, c)
2250 #define isXDIGIT_LC_uvchr(c) generic_LC_uvchr_(isXDIGIT_LC, \
2251 is_XDIGIT_cp_high, c)
2253 #define isBLANK_LC_uni(c) isBLANK_LC_uvchr(UNI_TO_NATIVE(c))
2265 * Except for toke.c, the macros do assume that e > p, asserting that on
2267 * for other reasons. toke.c is treated specially as using the regular
2270 * bunch of code in toke.c assumes that this is true, so the assertion allows
2363 /* To prevent S_scan_word in toke.c from hanging, we have to make sure that
2493 #define isALPHAU(c) isALPHA_L1(c)
2494 #define isDIGIT_L1(c) isDIGIT_A(c)
2495 #define isOCTAL(c) isOCTAL_A(c)
2496 #define isOCTAL_L1(c) isOCTAL_A(c)
2497 #define isXDIGIT_L1(c) isXDIGIT_A(c)
2498 #define isALNUM(c) isWORDCHAR(c)
2499 #define isALNUM_A(c) isALNUM(c)
2500 #define isALNUMU(c) isWORDCHAR_L1(c)
2501 #define isALNUM_LC(c) isWORDCHAR_LC(c)
2502 #define isALNUM_uni(c) isWORDCHAR_uni(c)
2503 #define isALNUM_LC_uvchr(c) isWORDCHAR_LC_uvchr(c)
2508 #define isALNUMC_A(c) isALPHANUMERIC_A(c) /* Mnemonic: "C's alnum" */
2509 #define isALNUMC_L1(c) isALPHANUMERIC_L1(c)
2510 #define isALNUMC(c) isALPHANUMERIC(c)
2511 #define isALNUMC_LC(c) isALPHANUMERIC_LC(c)
2512 #define isALNUMC_uni(c) isALPHANUMERIC_uni(c)
2513 #define isALNUMC_LC_uvchr(c) isALPHANUMERIC_LC_uvchr(c)
2528 # define toCTRL(c) (__ASSERT_(FITS_IN_8_BITS(c)) toUPPER(((U8)(c))) ^ 64)
2530 # define toCTRL(c) (__ASSERT_(FITS_IN_8_BITS(c)) \
2531 ((isPRINT_A(c)) \
2532 ? (UNLIKELY((c) == '?') \
2534 : (NATIVE_TO_LATIN1(toUPPER((U8) (c))) ^ 64)) \
2535 : (UNLIKELY((c) == QUESTION_MARK_CTRL) \
2537 : (LATIN1_TO_NATIVE(((U8) (c)) ^ 64)))))
2559 #define BADVERSION(a,b,c) \
2561 *b = c; \
2574 #define XDIGIT_VALUE(c) (__ASSERT_(isXDIGIT(c)) \
2575 ((NATIVE_TO_LATIN1(c) >> 6) & 1) /* 1 if alpha; 0 if not */ \
2576 + ((NATIVE_TO_LATIN1(c) >> 3) & 8) /* 8 if alpha; 0 if not */ \
2577 + ((c) & 0xF)) /* 0-9 if input valid hex digit */
2585 #define OCTAL_VALUE(c) (__ASSERT_(isOCTAL(c)) (7 & (c)))
2851 #define Newxc(v,n,t,c) (v = (MEM_WRAP_CHECK_(n,t) (c*)MEM_LOG_ALLOC(n,t,safemalloc((MEM_SIZE)((n)*sizeof(t))))))
2857 #define Newc(x,v,n,t,c) Newxc(v,n,t,c)
2863 #define Renewc(v,n,t,c) \
2864 (v = (MEM_WRAP_CHECK_(n,t) (c*)MEM_LOG_REALLOC(n,t,v,saferealloc((Malloc_t)(v),(MEM_SIZE)((n)*sizeof(t))))))