| 1 |
|
| #include "re2_xs.h" |
| 2 |
|
| #include "ppport.h" |
| 3 |
|
| |
| 4 |
|
| MODULE = re::engine::RE2 PACKAGE = re::engine::RE2 |
| 5 |
|
| PROTOTYPES: ENABLE |
| 6 |
|
| |
| 7 |
|
| void |
| 8 |
|
| ENGINE(...) |
| 9 |
|
| PROTOTYPE: |
| 10 |
|
| PPCODE: |
| 11 |
0 |
▶ | XPUSHs(sv_2mortal(newSViv(PTR2IV(&re2_engine)))); |
Branch: 1 branch
| Branch | True | False | Total |
| XPUSHs(sv_2mortal(newSViv(PTR2IV(&re2_engine)))); |
0 |
0 |
0 |
|
| 12 |
|
| |
| 13 |
|
| # Use a typemap for this maybe, especially if we add more methods like it! |
| 14 |
|
| void |
| 15 |
|
| possible_match_range(SV *self, STRLEN len = 10) |
| 16 |
|
| PROTOTYPE: |
| 17 |
|
| PPCODE: |
| 18 |
|
| REGEXP* rx; |
| 19 |
|
| SV *possible_min, *possible_max; |
| 20 |
|
| |
| 21 |
0 |
▶ | if(!SvROK(self) || 0 != strcmp("re::engine::RE2", sv_reftype(SvRV(self), TRUE))) |
Branch: 4 branches
| Branch | True | False | Total |
| if(!SvROK(self) || 0 != strcmp("re::engine::RE2", sv_reftype(SvRV(self), TRUE))) |
0 |
0 |
0 |
| if(!SvROK(self) || 0 != strcmp("re::engine::RE2", sv_reftype(SvRV(self), TRUE))) |
0 |
0 |
0 |
| if(!SvROK(self) || 0 != strcmp("re::engine::RE2", sv_reftype(SvRV(self), TRUE))) |
0 |
0 |
0 |
| if(!SvROK(self) || 0 != strcmp("re::engine::RE2", sv_reftype(SvRV(self), TRUE))) |
0 |
0 |
0 |
|
| 22 |
0 |
| croak("qr// reference to a re::engine::RE2 instance required"); |
| 23 |
0 |
▶ | rx = SvRX(self); |
Branch: 1 branch
| Branch | True | False | Total |
| rx = SvRX(self); |
0 |
0 |
0 |
|
| 24 |
|
| |
| 25 |
0 |
▶ | RE2_possible_match_range(aTHX_ rx, len, &possible_min, &possible_max); |
Branch: 1 branch
| Branch | True | False | Total |
| RE2_possible_match_range(aTHX_ rx, len, &possible_min, &possible_max); |
0 |
0 |
0 |
|
| 26 |
|
| |
| 27 |
0 |
▶ | mXPUSHs(possible_min); |
Branch: 3 branches
| Branch | True | False | Total |
| mXPUSHs(possible_min); |
0 |
0 |
0 |
| mXPUSHs(possible_min); |
0 |
0 |
0 |
| mXPUSHs(possible_min); |
0 |
0 |
0 |
|
| 28 |
0 |
▶ | mXPUSHs(possible_max); |
Branch: 3 branches
| Branch | True | False | Total |
| mXPUSHs(possible_max); |
0 |
0 |
0 |
| mXPUSHs(possible_max); |
0 |
0 |
0 |
| mXPUSHs(possible_max); |
0 |
0 |
0 |
|
| 29 |
|
| |
| 30 |
|
| HV* |
| 31 |
|
| named_captures(SV *self) |
| 32 |
|
| PROTOTYPE: |
| 33 |
|
| CODE: |
| 34 |
|
| REGEXP* rx; |
| 35 |
0 |
▶ | if(!SvROK(self) || 0 != strcmp("re::engine::RE2", sv_reftype(SvRV(self), TRUE))) |
Branch: 3 branches
| Branch | True | False | Total |
| if(!SvROK(self) || 0 != strcmp("re::engine::RE2", sv_reftype(SvRV(self), TRUE))) |
0 |
0 |
0 |
| if(!SvROK(self) || 0 != strcmp("re::engine::RE2", sv_reftype(SvRV(self), TRUE))) |
0 |
0 |
0 |
| if(!SvROK(self) || 0 != strcmp("re::engine::RE2", sv_reftype(SvRV(self), TRUE))) |
0 |
0 |
0 |
|
| 36 |
0 |
| croak("qr// reference to a re::engine::RE2 instance required"); |
| 37 |
0 |
| rx = SvRX(self); |
| 38 |
0 |
| RETVAL = RE2_named_captures(aTHX_ rx); |
| 39 |
|
| OUTPUT: |
| 40 |
|
| RETVAL |
| 41 |
|
| |
| 42 |
|
| int |
| 43 |
|
| number_of_capture_groups(SV *self) |
| 44 |
|
| PROTOTYPE: |
| 45 |
|
| CODE: |
| 46 |
|
| REGEXP* rx; |
| 47 |
0 |
▶ | if(!SvROK(self) || 0 != strcmp("re::engine::RE2", sv_reftype(SvRV(self), TRUE))) |
Branch: 3 branches
| Branch | True | False | Total |
| if(!SvROK(self) || 0 != strcmp("re::engine::RE2", sv_reftype(SvRV(self), TRUE))) |
0 |
0 |
0 |
| if(!SvROK(self) || 0 != strcmp("re::engine::RE2", sv_reftype(SvRV(self), TRUE))) |
0 |
0 |
0 |
| if(!SvROK(self) || 0 != strcmp("re::engine::RE2", sv_reftype(SvRV(self), TRUE))) |
0 |
0 |
0 |
|
| 48 |
0 |
| croak("qr// reference to a re::engine::RE2 instance required"); |
| 49 |
0 |
| rx = SvRX(self); |
| 50 |
0 |
▶ | RETVAL = RE2_number_of_capture_groups(aTHX_ rx); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = RE2_number_of_capture_groups(aTHX_ rx); |
0 |
0 |
0 |
|
| 51 |
|
| OUTPUT: |
| 52 |
|
| RETVAL |