diff options
author | Karl Williamson <public@khwilliamson.com> | 2012-12-02 21:01:12 -0700 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2012-12-09 10:30:00 -0700 |
commit | 5092f92a753474f7a1ed5525e874cb0904427ae5 (patch) | |
tree | c13eca25ad226086c186e29d1ab78b75f4d79edc /utf8.c | |
parent | e712593e71e0d665d0aed1b3e126cda71bb5eda1 (diff) | |
download | perl-5092f92a753474f7a1ed5525e874cb0904427ae5.tar.gz |
Add functions for getting ctype ALNUMC
We think this is meant to stand for C's alphanumeric, that is what is
matched by POSIX [:alnum:]. There were not functions and a dedicated
swash available for accessing it. Future commits will want to use
these.
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -1491,6 +1491,14 @@ Perl_is_uni_alnum(pTHX_ UV c) } bool +Perl_is_uni_alnumc(pTHX_ UV c) +{ + U8 tmpbuf[UTF8_MAXBYTES+1]; + uvchr_to_utf8(tmpbuf, c); + return is_utf8_alnumc(tmpbuf); +} + +bool Perl_is_uni_idfirst(pTHX_ UV c) { U8 tmpbuf[UTF8_MAXBYTES+1]; @@ -1825,6 +1833,15 @@ Perl_is_uni_alnum_lc(pTHX_ UV c) } bool +Perl_is_uni_alnumc_lc(pTHX_ UV c) +{ + if (c < 256) { + return isALNUMC_LC(UNI_TO_NATIVE(c)); + } + return is_uni_alnumc(c); +} + +bool Perl_is_uni_idfirst_lc(pTHX_ UV c) { return is_uni_idfirst(c); /* XXX no locale support yet */ @@ -1979,6 +1996,16 @@ Perl_is_utf8_alnum(pTHX_ const U8 *p) } bool +Perl_is_utf8_alnumc(pTHX_ const U8 *p) +{ + dVAR; + + PERL_ARGS_ASSERT_IS_UTF8_ALNUMC; + + return is_utf8_common(p, &PL_utf8_alnumc, "IsAlnum"); +} + +bool Perl_is_utf8_idfirst(pTHX_ const U8 *p) /* The naming is historical. */ { dVAR; |