summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-07-07 21:04:38 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-07-07 21:04:38 +0000
commit3e3318e754fa4289ad1c682811dbe6a31cd59e26 (patch)
treea4d6ae399be66913c32fec7a251d5b14e0cc4816 /utf8.c
parent15fe5983b126b2ada551d336b1d5338492041e03 (diff)
parente8c223dfc7b1035dd59e72c90f29f3f8b0634423 (diff)
downloadperl-3e3318e754fa4289ad1c682811dbe6a31cd59e26.tar.gz
integrate cfgperl contents
p4raw-id: //depot/perl@3656
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c112
1 files changed, 111 insertions, 1 deletions
diff --git a/utf8.c b/utf8.c
index 4bb2e9bd78..2090b7cbc5 100644
--- a/utf8.c
+++ b/utf8.c
@@ -261,6 +261,14 @@ Perl_is_uni_alnum(pTHX_ U32 c)
}
bool
+Perl_is_uni_alnumc(pTHX_ U32 c)
+{
+ U8 tmpbuf[10];
+ uv_to_utf8(tmpbuf, (UV)c);
+ return is_utf8_alnumc(tmpbuf);
+}
+
+bool
Perl_is_uni_idfirst(pTHX_ U32 c)
{
U8 tmpbuf[10];
@@ -309,6 +317,22 @@ Perl_is_uni_lower(pTHX_ U32 c)
}
bool
+Perl_is_uni_cntrl(pTHX_ U32 c)
+{
+ U8 tmpbuf[10];
+ uv_to_utf8(tmpbuf, (UV)c);
+ return is_utf8_cntrl(tmpbuf);
+}
+
+bool
+Perl_is_uni_graph(pTHX_ U32 c)
+{
+ U8 tmpbuf[10];
+ uv_to_utf8(tmpbuf, (UV)c);
+ return is_utf8_graph(tmpbuf);
+}
+
+bool
Perl_is_uni_print(pTHX_ U32 c)
{
U8 tmpbuf[10];
@@ -316,6 +340,14 @@ Perl_is_uni_print(pTHX_ U32 c)
return is_utf8_print(tmpbuf);
}
+bool
+is_uni_punct(U32 c)
+{
+ U8 tmpbuf[10];
+ uv_to_utf8(tmpbuf, (UV)c);
+ return is_utf8_punct(tmpbuf);
+}
+
U32
Perl_to_uni_upper(pTHX_ U32 c)
{
@@ -349,6 +381,12 @@ Perl_is_uni_alnum_lc(pTHX_ U32 c)
}
bool
+Perl_is_uni_alnumc_lc(pTHX_ U32 c)
+{
+ return is_uni_alnumc(c); /* XXX no locale support yet */
+}
+
+bool
Perl_is_uni_idfirst_lc(pTHX_ U32 c)
{
return is_uni_idfirst(c); /* XXX no locale support yet */
@@ -385,11 +423,29 @@ Perl_is_uni_lower_lc(pTHX_ U32 c)
}
bool
+Perl_is_uni_cntrl_lc(pTHX_ U32 c)
+{
+ return is_uni_cntrl(c); /* XXX no locale support yet */
+}
+
+bool
+Perl_is_uni_graph_lc(pTHX_ U32 c)
+{
+ return is_uni_graph(c); /* XXX no locale support yet */
+}
+
+bool
Perl_is_uni_print_lc(pTHX_ U32 c)
{
return is_uni_print(c); /* XXX no locale support yet */
}
+bool
+Perl_is_uni_punct_lc(pTHX_ U32 c)
+{
+ return is_uni_punct(c); /* XXX no locale support yet */
+}
+
U32
Perl_to_uni_upper_lc(pTHX_ U32 c)
{
@@ -408,7 +464,6 @@ Perl_to_uni_lower_lc(pTHX_ U32 c)
return to_uni_lower(c); /* XXX no locale support yet */
}
-
bool
Perl_is_utf8_alnum(pTHX_ U8 *p)
{
@@ -425,6 +480,21 @@ Perl_is_utf8_alnum(pTHX_ U8 *p)
}
bool
+Perl_is_utf8_alnumc(pTHX_ U8 *p)
+{
+ if (!PL_utf8_alnum)
+ PL_utf8_alnum = swash_init("utf8", "IsAlnumC", &PL_sv_undef, 0, 0);
+ return swash_fetch(PL_utf8_alnum, p);
+/* return is_utf8_alpha(p) || is_utf8_digit(p); */
+#ifdef SURPRISINGLY_SLOWER /* probably because alpha is usually true */
+ if (!PL_utf8_alnum)
+ PL_utf8_alnum = swash_init("utf8", "",
+ sv_2mortal(newSVpv("+utf8::IsAlpha\n+utf8::IsDigit\n005F\n",0)), 0, 0);
+ return swash_fetch(PL_utf8_alnum, p);
+#endif
+}
+
+bool
Perl_is_utf8_idfirst(pTHX_ U8 *p)
{
return *p == '_' || is_utf8_alpha(p);
@@ -439,6 +509,14 @@ Perl_is_utf8_alpha(pTHX_ U8 *p)
}
bool
+Perl_is_utf8_ascii(pTHX_ U8 *p)
+{
+ if (!PL_utf8_ascii)
+ PL_utf8_ascii = swash_init("utf8", "IsAscii", &PL_sv_undef, 0, 0);
+ return swash_fetch(PL_utf8_ascii, p);
+}
+
+bool
Perl_is_utf8_space(pTHX_ U8 *p)
{
if (!PL_utf8_space)
@@ -471,6 +549,22 @@ Perl_is_utf8_lower(pTHX_ U8 *p)
}
bool
+Perl_is_utf8_cntrl(pTHX_ U8 *p)
+{
+ if (!PL_utf8_cntrl)
+ PL_utf8_cntrl = swash_init("utf8", "IsCntrl", &PL_sv_undef, 0, 0);
+ return swash_fetch(PL_utf8_cntrl, p);
+}
+
+bool
+Perl_is_utf8_graph(pTHX_ U8 *p)
+{
+ if (!PL_utf8_graph)
+ PL_utf8_graph = swash_init("utf8", "IsGraph", &PL_sv_undef, 0, 0);
+ return swash_fetch(PL_utf8_graph, p);
+}
+
+bool
Perl_is_utf8_print(pTHX_ U8 *p)
{
if (!PL_utf8_print)
@@ -479,6 +573,22 @@ Perl_is_utf8_print(pTHX_ U8 *p)
}
bool
+Perl_is_utf8_punct(pTHX_ U8 *p)
+{
+ if (!PL_utf8_punct)
+ PL_utf8_punct = swash_init("utf8", "IsPunct", &PL_sv_undef, 0, 0);
+ return swash_fetch(PL_utf8_punct, p);
+}
+
+bool
+Perl_is_utf8_xdigit(pTHX_ U8 *p)
+{
+ if (!PL_utf8_xdigit)
+ PL_utf8_xdigit = swash_init("utf8", "IsXDigit", &PL_sv_undef, 0, 0);
+ return swash_fetch(PL_utf8_xdigit, p);
+}
+
+bool
Perl_is_utf8_mark(pTHX_ U8 *p)
{
if (!PL_utf8_mark)