summaryrefslogtreecommitdiff
path: root/ext/gettext
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2000-12-08 16:25:38 +0000
committerfoobar <sniper@php.net>2000-12-08 16:25:38 +0000
commit90d65f186592da7157591848006c873bf55648d6 (patch)
tree33a1dd7e1755a35781aba391f233856f05556780 /ext/gettext
parentfe13e4b05dd0f71c6d39ec0a35bae306a7f55251 (diff)
downloadphp-git-90d65f186592da7157591848006c873bf55648d6.tar.gz
wb clean.
Diffstat (limited to 'ext/gettext')
-rw-r--r--ext/gettext/gettext.c68
1 files changed, 31 insertions, 37 deletions
diff --git a/ext/gettext/gettext.c b/ext/gettext/gettext.c
index 386c0e1233..488795b57e 100644
--- a/ext/gettext/gettext.c
+++ b/ext/gettext/gettext.c
@@ -28,12 +28,12 @@
#include "ext/standard/info.h"
function_entry php_gettext_functions[] = {
- PHP_FE(textdomain, NULL)
- PHP_FE(gettext, NULL)
- PHP_FALIAS(_, gettext, NULL)
- PHP_FE(dgettext, NULL)
- PHP_FE(dcgettext, NULL)
- PHP_FE(bindtextdomain, NULL)
+ PHP_FE(textdomain, NULL)
+ PHP_FE(gettext, NULL)
+ PHP_FALIAS(_, gettext, NULL)
+ PHP_FE(dgettext, NULL)
+ PHP_FE(dcgettext, NULL)
+ PHP_FE(bindtextdomain, NULL)
{NULL, NULL, NULL}
};
@@ -56,12 +56,12 @@ PHP_MINFO_FUNCTION(gettext)
PHP_MINIT_FUNCTION(gettext)
{
REGISTER_LONG_CONSTANT("LC_CTYPE", LC_CTYPE, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("LC_NUMERIC", LC_NUMERIC, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("LC_TIME", LC_TIME, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("LC_COLLATE", LC_COLLATE, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("LC_MONETARY", LC_MONETARY, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("LC_MESSAGES", LC_MESSAGES, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("LC_ALL", LC_ALL, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("LC_NUMERIC", LC_NUMERIC, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("LC_TIME", LC_TIME, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("LC_COLLATE", LC_COLLATE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("LC_MONETARY", LC_MONETARY, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("LC_MESSAGES", LC_MESSAGES, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("LC_ALL", LC_ALL, CONST_CS | CONST_PERSISTENT);
return SUCCESS;
}
@@ -69,14 +69,14 @@ PHP_MINIT_FUNCTION(gettext)
Set the textdomain to "domain". Returns the current domain */
PHP_FUNCTION(textdomain)
{
- pval **domain;
- char *domain_name, *retval;
+ pval **domain;
+ char *domain_name, *retval;
char *val;
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &domain) == FAILURE) {
+ if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &domain) == FAILURE) {
WRONG_PARAM_COUNT;
- }
- convert_to_string_ex(domain);
+ }
+ convert_to_string_ex(domain);
val = (*domain)->value.str.val;
if (strcmp(val, "") && strcmp(val, "0")) {
@@ -87,7 +87,7 @@ PHP_FUNCTION(textdomain)
retval = textdomain(domain_name);
- RETURN_STRING(retval, 1);
+ RETURN_STRING(retval, 1);
}
/* }}} */
@@ -95,17 +95,17 @@ PHP_FUNCTION(textdomain)
Return the translation of msgid for the current domain, or msgid unaltered if a translation does not exist */
PHP_FUNCTION(gettext)
{
- pval **msgid;
- char *msgstr;
+ pval **msgid;
+ char *msgstr;
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &msgid) == FAILURE) {
+ if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &msgid) == FAILURE) {
WRONG_PARAM_COUNT;
- }
- convert_to_string_ex(msgid);
+ }
+ convert_to_string_ex(msgid);
- msgstr = gettext((*msgid)->value.str.val);
+ msgstr = gettext((*msgid)->value.str.val);
- RETURN_STRING(msgstr, 1);
+ RETURN_STRING(msgstr, 1);
}
/* }}} */
@@ -116,9 +116,7 @@ PHP_FUNCTION(dgettext)
pval **domain_name, **msgid;
char *msgstr;
- if (ZEND_NUM_ARGS() != 2
- || zend_get_parameters_ex(2, &domain_name, &msgid) == FAILURE)
- {
+ if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &domain_name, &msgid) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_string_ex(domain_name);
@@ -137,18 +135,16 @@ PHP_FUNCTION(dcgettext)
pval **domain_name, **msgid, **category;
char *msgstr;
- if (ZEND_NUM_ARGS() != 3
- || zend_get_parameters_ex(3, &domain_name, &msgid, &category) == FAILURE)
- {
+ if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &domain_name, &msgid, &category) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_string_ex(domain_name);
convert_to_string_ex(msgid);
convert_to_long_ex(category);
- msgstr = dcgettext((*domain_name)->value.str.val,
- (*msgid)->value.str.val,
- (*category)->value.lval);
+ msgstr = dcgettext( (*domain_name)->value.str.val,
+ (*msgid)->value.str.val,
+ (*category)->value.lval);
RETURN_STRING(msgstr, 1);
}
@@ -161,9 +157,7 @@ PHP_FUNCTION(bindtextdomain)
pval **domain_name, **dir;
char *retval, dir_name[MAXPATHLEN];
- if (ZEND_NUM_ARGS() != 2
- || zend_get_parameters_ex(2, &domain_name, &dir) == FAILURE)
- {
+ if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &domain_name, &dir) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_string_ex(domain_name);