Metaphone.xs

filter: Statementstmt 83.3% 5 / 6 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 75.0% 6 / 8 SCAR 0
CC
0
Cov
0%
CRAP 0
« metaphone_c.c ↑ Summary blib/lib/Text/Metaphone.pm »
1 #include "EXTERN.h"
2 #include "perl.h"
3 #include "XSUB.h"
4  
5 #include "metaphone.h"
6  
7 MODULE = Text::Metaphone PACKAGE = Text::Metaphone
8  
9 PROTOTYPES: ENABLE
10  
11 SV *
12 Metaphone(word, ...)
13 char* word
14 PROTOTYPE: $;$
15 PREINIT:
16 21 size_t max_length = 0;
17 INIT:
18 char *phoned_word;
19 CODE:
20 21 ▶ if( items > 1 ) {
Branch: 1 branch
BranchTrueFalseTotal
if( items > 1 ) { 0 21 21
21 0 max_length = SvIV(ST(1));
22 }
23  
24 21 phoned_word = metaphone(word, max_length);
25 21 RETVAL = newSVpv(phoned_word, 0);
26 21 free(phoned_word);
27 OUTPUT:
28 RETVAL
« metaphone_c.c ↑ Summary blib/lib/Text/Metaphone.pm »