1 typedef struct sv SV;
2 typedef struct regnode
3 {
4 char flags;
5 } regnode;
6 typedef struct regexp
7 {
8 } regexp;
9 typedef struct cop
10 {
11 SV *cop_warnings;
12 } COP;
13 extern const unsigned char PL_utf8skip[];
14 extern char PL_dowarn;
15 extern COP *volatile PL_curcop;
16 int S_reginclass (regnode *);
17 int S_regtry (regexp *, char *);
18 unsigned long Perl_utf8n_to_uvuni (char *, int, long unsigned int *, int);
19 char *
S_find_byclass(regexp * prog,regnode * c,char * s,char * strend,char * startpos,int norun)20 S_find_byclass (regexp * prog, regnode * c, char *s, char *strend,
21 char *startpos, int norun)
22 {
23 register long unsigned int uskip;
24 char *e;
25 switch (((c)->flags))
26 {
27 case 17:
28 {
29 while (s + (uskip = PL_utf8skip[*s]) <= strend)
30 {
31 if (c->flags || S_reginclass (c))
32 if (norun || S_regtry (prog, s))
33 goto got_it;
34 s += uskip;
35 }
36 unsigned long c, f;
37 long unsigned int len;
38 {
39 while (s <= e)
40 {
41 c = Perl_utf8n_to_uvuni (s, 13, &len,
42 (((PL_curcop->cop_warnings !=
43 ((SV *) ((void *) 0)))
44 && PL_dowarn)) ? 0 : 0x00FF);
45 if (c == 0 && (norun || S_regtry (prog, s)))
46 if (f != c && (norun || S_regtry (prog, s)))
47 goto got_it;
48 }
49 }
50 }
51 }
52 got_it:
53 return s;
54 }
55 void
Perl_re_intuit_start(regexp * prog)56 Perl_re_intuit_start (regexp * prog)
57 {
58 S_find_byclass (prog, 0, 0, 0, 0, 1);
59 }
60 void
Perl_regexec_flags(register regexp * prog,register char * strend)61 Perl_regexec_flags (register regexp * prog,
62 register char *strend)
63 {
64 S_find_byclass (prog, 0, 0, strend, 0, 0);
65 }
66 int
S_regtry(regexp * prog,char * startpos)67 S_regtry (regexp * prog, char *startpos)
68 {
69 }
70