summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2001-03-10 11:55:43 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2001-03-10 11:55:43 +0000
commit9041c2e396c8c7de7680a2007dc341a9f65be0d0 (patch)
tree19075254fbc0495a697b5e15ca1f19a99e02ac77 /regcomp.c
parent2ef28da1578e18cf36b9a30b71ac471521d2b507 (diff)
downloadperl-9041c2e396c8c7de7680a2007dc341a9f65be0d0.tar.gz
EBCDIC sanity - phase I
- rename utf8/uv functions to indicate what sort of uv they provide (uvuni/uvchr) - use utf8n_xxxx (c.f. pvn) for forms which take length. - back out vN.N and $^V exceptions to e2a/a2e - make "locale" isxxx macros be uvchr (may be redundant?) Not clear yet that toUPPER_uni et. al. return being handled correctly. The tr// and rexexp stuff still needs an audit, assumption is they are working in Unicode space. Need to provide v5.6 names for XS modules (decide is uni or chr ?). p4raw-id: //depot/perlio@9096
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/regcomp.c b/regcomp.c
index 9a935f72c2..2e5aaf33f0 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -807,7 +807,7 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp, I32 *deltap, reg
if (UTF) {
U8 *s = (U8*)STRING(scan);
l = utf8_length(s, s + l);
- uc = utf8_to_uv_simple(s, NULL);
+ uc = utf8_to_uvchr(s, NULL);
}
min += l;
if (flags & SCF_DO_SUBSTR) { /* Update longest substr. */
@@ -862,7 +862,7 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp, I32 *deltap, reg
if (UTF) {
U8 *s = (U8 *)STRING(scan);
l = utf8_length(s, s + l);
- uc = utf8_to_uv_simple(s, NULL);
+ uc = utf8_to_uvchr(s, NULL);
}
min += l;
if (data && (flags & SCF_DO_SUBSTR))
@@ -2928,7 +2928,7 @@ tryagain:
default:
normal_default:
if (UTF8_IS_START(*p) && UTF) {
- ender = utf8_to_uv((U8*)p, RExC_end - p,
+ ender = utf8n_to_uvuni((U8*)p, RExC_end - p,
&numlen, 0);
p += numlen;
}
@@ -2940,7 +2940,7 @@ tryagain:
p = regwhite(p, RExC_end);
if (UTF && FOLD) {
if (LOC)
- ender = toLOWER_LC_uni(ender);
+ ender = toLOWER_LC_uvchr(UNI_TO_NATIVE(ender));
else
ender = toLOWER_uni(ender);
}
@@ -3227,7 +3227,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
if (!range)
rangebegin = RExC_parse;
if (UTF) {
- value = utf8_to_uv((U8*)RExC_parse,
+ value = utf8n_to_uvuni((U8*)RExC_parse,
RExC_end - RExC_parse,
&numlen, 0);
RExC_parse += numlen;
@@ -3238,7 +3238,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
namedclass = regpposixcc(pRExC_state, value);
else if (value == '\\') {
if (UTF) {
- value = utf8_to_uv((U8*)RExC_parse,
+ value = utf8n_to_uvuni((U8*)RExC_parse,
RExC_end - RExC_parse,
&numlen, 0);
RExC_parse += numlen;
@@ -3914,7 +3914,7 @@ S_reganode(pTHX_ RExC_state_t *pRExC_state, U8 op, U32 arg)
STATIC void
S_reguni(pTHX_ RExC_state_t *pRExC_state, UV uv, char* s, STRLEN* lenp)
{
- *lenp = SIZE_ONLY ? UNISKIP(uv) : (uv_to_utf8((U8*)s, uv) - (U8*)s);
+ *lenp = SIZE_ONLY ? UNISKIP(uv) : (uvuni_to_utf8((U8*)s, uv) - (U8*)s);
}
/*
@@ -4284,7 +4284,7 @@ Perl_regprop(pTHX_ SV *sv, regnode *o)
U8 s[UTF8_MAXLEN+1];
for (i = 0; i <= 256; i++) { /* just the first 256 */
- U8 *e = uv_to_utf8(s, i);
+ U8 *e = uvuni_to_utf8(s, i);
if (i < 256 && swash_fetch(sw, s)) {
if (rangestart == -1)
@@ -4294,14 +4294,14 @@ Perl_regprop(pTHX_ SV *sv, regnode *o)
if (i <= rangestart + 3)
for (; rangestart < i; rangestart++) {
- for(e = uv_to_utf8(s, rangestart), p = s; p < e; p++)
+ for(e = uvuni_to_utf8(s, rangestart), p = s; p < e; p++)
put_byte(sv, *p);
}
else {
- for (e = uv_to_utf8(s, rangestart), p = s; p < e; p++)
+ for (e = uvuni_to_utf8(s, rangestart), p = s; p < e; p++)
put_byte(sv, *p);
sv_catpv(sv, "-");
- for (e = uv_to_utf8(s, i - 1), p = s; p < e; p++)
+ for (e = uvuni_to_utf8(s, i - 1), p = s; p < e; p++)
put_byte(sv, *p);
}
rangestart = -1;