| 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
| Branch | True | False | Total |
| 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 |