diff options
author | Andrei Zmievski <andrei@php.net> | 2001-10-19 19:21:58 +0000 |
---|---|---|
committer | Andrei Zmievski <andrei@php.net> | 2001-10-19 19:21:58 +0000 |
commit | 1ed249ddbc15ab33d67ea8ac2650c9347be0d803 (patch) | |
tree | b08f7b8ac21c436b2b6ca832e764d89ffb8ede63 /ext/standard/metaphone.c | |
parent | 1f852425d1b0c467190dbc58a5ded51f4c8931e3 (diff) | |
download | php-git-1ed249ddbc15ab33d67ea8ac2650c9347be0d803.tar.gz |
Converting to use new parameter parsing API.
Diffstat (limited to 'ext/standard/metaphone.c')
-rw-r--r-- | ext/standard/metaphone.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c index 5d1648dfd2..d46a7464d2 100644 --- a/ext/standard/metaphone.c +++ b/ext/standard/metaphone.c @@ -33,20 +33,16 @@ PHP_FUNCTION(metaphone); Break english phrases down into their phonemes */ PHP_FUNCTION(metaphone) { - pval **pstr, **pphones; + char *str; char *result = 0; - int phones = 0; + int phones = 0, str_len; - if (zend_get_parameters_ex(2, &pstr, &pphones) == SUCCESS) { - convert_to_long_ex(pphones); - phones = Z_LVAL_PP(pphones); - } else if (zend_get_parameters_ex(1, &pstr) == FAILURE) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &str, &str_len, + &phones) == FAILURE) { + return; } - convert_to_string_ex(pstr); - - if (metaphone(Z_STRVAL_PP(pstr), phones, &result, 1) == 0) { + if (metaphone(str, phones, &result, 1) == 0) { RETVAL_STRING(result, 0); } else { if (result) { |