Skip to content

Commit

Permalink
change function name pinyins as pinyin
Browse files Browse the repository at this point in the history
  • Loading branch information
duguying committed Aug 20, 2013
1 parent bf36ab7 commit c2847a8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion php_pinyin.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ PHP_RSHUTDOWN_FUNCTION(pinyin);
PHP_MINFO_FUNCTION(pinyin);

//PHP_FUNCTION(confirm_pinyin_compiled); /* For testing, remove later. */
PHP_FUNCTION(pinyins);
PHP_FUNCTION(pinyin);
/*
Declare any global variables you may need between the BEGIN
and END macros here:
Expand Down
5 changes: 3 additions & 2 deletions pinyin.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static int le_pinyin;
* Every user visible function must have an entry in pinyin_functions[].
*/
const zend_function_entry pinyin_functions[] = {
PHP_FE(pinyins, NULL)
PHP_FE(pinyin, NULL)
PHP_FE_END /* Must be the last line in pinyin_functions[] */
};

Expand Down Expand Up @@ -159,7 +159,7 @@ PHP_MINFO_FUNCTION(pinyin)
/* {{{ proto string confirm_pinyin_compiled(string arg)
Return a string to confirm that the module is compiled in */

PHP_FUNCTION(pinyins)
PHP_FUNCTION(pinyin)
{
char *arg = NULL;
int arg_len, i=0;//i is index of the array
Expand All @@ -176,6 +176,7 @@ PHP_FUNCTION(pinyins)
RETURN_NULL();//if not matched, return null
}
array_init(return_value);
add_assoc_string(return_value, "alphabet", rs->pyab, 1);
while (rs)
{
add_index_string(return_value, i, rs->piny, 1);
Expand Down
2 changes: 1 addition & 1 deletion pinyin.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
set_time_limit(0);
for($i=0;$i<10000;$i++){
var_dump(pinyins("°¡"));
var_dump(pinyin("°¡"));
}
?>

0 comments on commit c2847a8

Please sign in to comment.