| 1 |
|
| #include "EXTERN.h" |
| 2 |
|
| #include "perl.h" |
| 3 |
|
| #include "XSUB.h" |
| 4 |
|
| #define NEED_sv_2pv_nolen |
| 5 |
|
| #include "ppport.h" |
| 6 |
|
| |
| 7 |
|
| #include "regcomp.h" |
| 8 |
|
| #include "const-c.inc" |
| 9 |
|
| #if (PERL_VERSION < 11) |
| 10 |
|
| #define RETURNVALUE re->minlen |
| 11 |
|
| #else |
| 12 |
|
| #define RETURNVALUE re->sv_any->minlen |
| 13 |
|
| #endif |
| 14 |
|
| |
| 15 |
|
| MODULE = Regexp::MinLength PACKAGE = Regexp::MinLength PREFIX = Regexp::MinLength_ |
| 16 |
|
| |
| 17 |
|
| INCLUDE: const-xs.inc |
| 18 |
|
| PROTOTYPES: DISABLE |
| 19 |
|
| |
| 20 |
|
| int |
| 21 |
|
| MinLength(rv) |
| 22 |
|
| SV *rv; |
| 23 |
|
| |
| 24 |
|
| PREINIT: |
| 25 |
10 |
▶ | const SV * const pattern = rv; |
Branch: 1 branch
| Branch | True | False | Total |
| const SV * const pattern = rv; |
10 |
0 |
10 |
|
| 26 |
|
| char *ptr; |
| 27 |
|
| #if (PERL_VERSION < 11) |
| 28 |
|
| regexp *re; |
| 29 |
|
| #else |
| 30 |
|
| REGEXP *re; |
| 31 |
|
| #endif |
| 32 |
|
| int ret; |
| 33 |
|
| int len; |
| 34 |
|
| PMOP *pm; |
| 35 |
|
| U32 flags; |
| 36 |
|
| |
| 37 |
|
| |
| 38 |
|
| CODE: |
| 39 |
|
| |
| 40 |
10 |
| re = pregcomp(rv,0); |
| 41 |
10 |
▶ | if (!re) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (!re) { |
0 |
10 |
10 |
|
| 42 |
0 |
| croak("Cannot compile regexp"); |
| 43 |
|
| } |
| 44 |
|
| |
| 45 |
10 |
| ret = RETURNVALUE; |
| 46 |
|
| |
| 47 |
10 |
▶ | RETVAL = ret; |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = ret; |
0 |
10 |
10 |
|
| 48 |
|
| OUTPUT: |
| 49 |
|
| RETVAL |
| 50 |
|
| |
| 51 |
|
| |
| 52 |
|
| MODULE = Regexp::MinLength PACKAGE = Regexp::MinLength |