From 1ed249ddbc15ab33d67ea8ac2650c9347be0d803 Mon Sep 17 00:00:00 2001 From: Andrei Zmievski Date: Fri, 19 Oct 2001 19:21:58 +0000 Subject: Converting to use new parameter parsing API. --- ext/standard/metaphone.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'ext/standard/metaphone.c') 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) { -- cgit v1.2.1