allow a flags args to fbm_instr() for future needs
authorIlya Zakharevich <ilya@math.berkeley.edu>
Thu, 2 Jul 1998 03:49:32 +0000 (23:49 -0400)
committerGurusamy Sarathy <gsar@cpan.org>
Sat, 4 Jul 1998 05:20:52 +0000 (05:20 +0000)
Message-Id: <199807020749.DAA12379@monk.mps.ohio-state.edu>
Subject: [PATCH 5.004_68] mORE FBM_ CHANGES FOR FUTURE

p4raw-id: //depot/perl@1297

pod/perlguts.pod
pp.c
pp_hot.c
proto.h
regexec.c
util.c

index fb52ecf..eb298bf 100644 (file)
@@ -1647,7 +1647,7 @@ Used to extend the argument stack for an XSUB's return values.
 Analyses the string in order to make fast searches on it using fbm_instr() --
 the Boyer-Moore algorithm.
 
-       void    fbm_compile(SV* sv)
+       void    fbm_compile(SV* sv, U32 flags)
 
 =item fbm_instr
 
@@ -1656,7 +1656,7 @@ C<strend>.  It returns C<Nullch> if the string can't be found.  The
 C<sv> does not have to be fbm_compiled, but the search will not be as
 fast then.
 
-       char*   fbm_instr(char *str, char *strend, SV *sv)
+       char*   fbm_instr(char *str, char *strend, SV *sv, U32 flags)
 
 =item FREETMPS
 
diff --git a/pp.c b/pp.c
index a927b3d..b5a184a 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -1996,7 +1996,7 @@ PP(pp_index)
     else if (offset > biglen)
        offset = biglen;
     if (!(tmps2 = fbm_instr((unsigned char*)tmps + offset,
-      (unsigned char*)tmps + biglen, little)))
+      (unsigned char*)tmps + biglen, little, 0)))
        retval = -1 + arybase;
     else
        retval = tmps2 - tmps + arybase;
@@ -4327,7 +4327,7 @@ PP(pp_split)
 #ifndef lint
            while (s < strend && --limit &&
              (m=fbm_instr((unsigned char*)s, (unsigned char*)strend,
-                   rx->check_substr)) )
+                   rx->check_substr, 0)) )
 #endif
            {
                dstr = NEWSV(31, m-s);
index b81ec56..7234f15 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -872,7 +872,7 @@ play_it_again:
            }
            else if (!(s = fbm_instr((unsigned char*)s + rx->check_offset_min,
                                     (unsigned char*)strend, 
-                                    rx->check_substr)))
+                                    rx->check_substr, 0)))
                goto nope;
            else if ((rx->reganch & ROPT_CHECK_ALL) && !sawampersand)
                goto yup;
@@ -1562,7 +1562,7 @@ PP(pp_subst)
            }
            else if (!(s = fbm_instr((unsigned char*)s + rx->check_offset_min, 
                                     (unsigned char*)strend,
-                                    rx->check_substr)))
+                                    rx->check_substr, 0)))
                goto nope;
            if (s && rx->check_offset_max < s - m) {
                ++BmUSEFUL(rx->check_substr);
diff --git a/proto.h b/proto.h
index 5bbde48..d5aeb00 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -136,7 +136,7 @@ VIRTUAL void        dump_pm _((PMOP* pm));
 VIRTUAL void   dump_packsubs _((HV* stash));
 VIRTUAL void   dump_sub _((GV* gv));
 VIRTUAL void   fbm_compile _((SV* sv, U32 flags));
-VIRTUAL char*  fbm_instr _((unsigned char* big, unsigned char* bigend, SV* littlesv));
+VIRTUAL char*  fbm_instr _((unsigned char* big, unsigned char* bigend, SV* littlesv, U32 flags));
 VIRTUAL char*  find_script _((char *scriptname, bool dosearch, char **search_ext, I32 flags));
 #ifdef USE_THREADS
 VIRTUAL PADOFFSET      find_threadsv _((char *name));
index 107d68b..d5d9461 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -258,7 +258,7 @@ regexec_flags(register regexp *prog, char *stringarg, register char *strend, cha
        else
            s = fbm_instr((unsigned char*)s + start_shift,
                          (unsigned char*)strend - end_shift,
-               prog->check_substr);
+               prog->check_substr, 0);
        if (!s) {
            ++BmUSEFUL(prog->check_substr);     /* hooray */
            goto phooey;        /* not present */
@@ -359,7 +359,7 @@ regexec_flags(register regexp *prog, char *stringarg, register char *strend, cha
                 ? (s = screaminstr(screamer, must, s + back_min - strbeg,
                                    end_shift, &scream_pos, 0))
                 : (s = fbm_instr((unsigned char*)s + back_min,
-                                 (unsigned char*)strend, must))) ) {
+                                 (unsigned char*)strend, must, 0))) ) {
            if (s - back_max > last1) {
                last1 = s - back_min;
                s = s - back_max;
diff --git a/util.c b/util.c
index 96a9bb8..1ce9872 100644 (file)
--- a/util.c
+++ b/util.c
@@ -938,7 +938,7 @@ fbm_compile(SV *sv, U32 flags /* not used yet */)
 }
 
 char *
-fbm_instr(unsigned char *big, register unsigned char *bigend, SV *littlestr)
+fbm_instr(unsigned char *big, register unsigned char *bigend, SV *littlestr, U32 flags)
 {
     register unsigned char *s;
     register I32 tmp;