cvs: php4 /ext/gettext gettext.c

From: Date: Mon, 27 Aug 2001 22:26:49 +0000
Subject: cvs: php4 /ext/gettext gettext.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-7104@lists.php.net to get a copy of this message
sniper Mon Aug 27 18:26:49 2001 EDT Modified files: /php4/ext/gettext gettext.c Log: Coding style. Index: php4/ext/gettext/gettext.c diff -u php4/ext/gettext/gettext.c:1.31 php4/ext/gettext/gettext.c:1.32 --- php4/ext/gettext/gettext.c:1.31 Mon Aug 27 16:05:11 2001 +++ php4/ext/gettext/gettext.c Mon Aug 27 18:26:49 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: gettext.c,v 1.31 2001/08/27 20:05:11 chagenbu Exp $ */ +/* $Id: gettext.c,v 1.32 2001/08/27 22:26:49 sniper Exp $ */ #include <stdio.h> #ifdef HAVE_CONFIG_H @@ -40,15 +40,22 @@ PHP_FE(dgettext, NULL) PHP_FE(dcgettext, NULL) PHP_FE(bindtextdomain, NULL) - PHP_FE(ngettext, NULL) - PHP_FE(dngettext, NULL) - PHP_FE(dcngettext, NULL) + PHP_FE(ngettext, NULL) + PHP_FE(dngettext, NULL) + PHP_FE(dcngettext, NULL) {NULL, NULL, NULL} }; /* }}} */ zend_module_entry php_gettext_module_entry = { - "gettext", php_gettext_functions, NULL, NULL, NULL, NULL, PHP_MINFO(gettext), STANDARD_MODULE_PROPERTIES + "gettext", + php_gettext_functions, + NULL, + NULL, + NULL, + NULL, + PHP_MINFO(gettext), + STANDARD_MODULE_PROPERTIES }; #ifdef COMPILE_DL_GETTEXT @@ -139,9 +146,7 @@ convert_to_string_ex(msgid); convert_to_long_ex(category); - msgstr = dcgettext(Z_STRVAL_PP(domain_name), - Z_STRVAL_PP(msgid), - Z_LVAL_PP(category)); + msgstr = dcgettext(Z_STRVAL_PP(domain_name), Z_STRVAL_PP(msgid), Z_LVAL_PP(category)); RETURN_STRING(msgstr, 1); } @@ -173,8 +178,7 @@ /* }}} */ /* {{{ proto string ngettext(string MSGID1, string MSGID2, int N) - Plural version of gettext(). -*/ + Plural version of gettext() */ PHP_FUNCTION(ngettext) { zval **msgid1, **msgid2, **count; @@ -182,16 +186,14 @@ RETVAL_FALSE; - if (3 != ZEND_NUM_ARGS() - || FAILURE == zend_get_parameters_ex(3, &msgid1, &msgid2, &count)) { + if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &msgid1, &msgid2, &count) == FAILURE) { WRONG_PARAM_COUNT; } else { convert_to_string_ex(msgid1); convert_to_string_ex(msgid2); convert_to_long_ex(count); - msgstr = ngettext(Z_STRVAL_PP(msgid1), Z_STRVAL_PP(msgid2), - Z_LVAL_PP(count)); + msgstr = ngettext(Z_STRVAL_PP(msgid1), Z_STRVAL_PP(msgid2), Z_LVAL_PP(count)); if (msgstr) { RETVAL_STRING (msgstr, 1); } @@ -200,17 +202,14 @@ /* }}} */ /* {{{ proto string dngettext (string domain, string msgid1, string msgid2, long count) - Plural version of dgettext(). - */ + Plural version of dgettext() */ PHP_FUNCTION(dngettext) { zval **domain, **msgid1, **msgid2, **count; RETVAL_FALSE; - if (4 != ZEND_NUM_ARGS() - || FAILURE == zend_get_parameters_ex(4, &domain, &msgid1, &msgid2, - &count)) { + if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &domain, &msgid1, &msgid2, &count) == FAILURE) { WRONG_PARAM_COUNT; } else { char *msgstr; @@ -220,8 +219,7 @@ convert_to_string_ex(msgid2); convert_to_long_ex(count); - msgstr = dngettext(Z_STRVAL_PP(domain), Z_STRVAL_PP(msgid1), - Z_STRVAL_PP(msgid2), Z_LVAL_PP(count)); + msgstr = dngettext(Z_STRVAL_PP(domain), Z_STRVAL_PP(msgid1), Z_STRVAL_PP(msgid2), Z_LVAL_PP(count)); if (msgstr) { RETVAL_STRING(msgstr, 1); } @@ -230,18 +228,15 @@ /* }}} */ /* {{{ proto string dcngettext (string domain, string msgid1, string msgid2, long n, int category) - Plural version of dcgettext(). -*/ + Plural version of dcgettext() */ PHP_FUNCTION(dcngettext) { zval **domain, **msgid1, **msgid2, **count, **category; RETVAL_FALSE; - if (5 != ZEND_NUM_ARGS() - || FAILURE == zend_get_parameters_ex(4, &domain, &msgid1, &msgid2, - &count, &category)) { - + if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(4, &domain, &msgid1, &msgid2, &count, &category) == FAILURE) { + WRONG_PARAM_COUNT; } else { char* msgstr = NULL; @@ -251,9 +246,7 @@ convert_to_long_ex(count); convert_to_long_ex(category); - msgstr = dcngettext(Z_STRVAL_PP(domain), Z_STRVAL_PP(msgid1), - Z_STRVAL_PP(msgid2), Z_LVAL_PP(count), - Z_LVAL_PP(category)); + msgstr = dcngettext(Z_STRVAL_PP(domain), Z_STRVAL_PP(msgid1), Z_STRVAL_PP(msgid2), Z_LVAL_PP(count), Z_LVAL_PP(category)); if (msgstr) { RETVAL_STRING(msgstr, 1);

« previous php.cvs (#7104) next »