diff options
author | Jon Parise <jon@php.net> | 2001-11-09 16:27:09 +0000 |
---|---|---|
committer | Jon Parise <jon@php.net> | 2001-11-09 16:27:09 +0000 |
commit | 8f26c3f326c66d0ba549df589de24f27288dcefc (patch) | |
tree | c7bd8089f2832db59f69adc93cb1da3b68979ad4 | |
parent | 8ee38d9d75f02b604106887b2548d30b7c913414 (diff) | |
download | php-git-8f26c3f326c66d0ba549df589de24f27288dcefc.tar.gz |
@ Added support for bind_textdomain_codeset(). (rudib@email.si)
-rw-r--r-- | ext/gettext/config.m4 | 1 | ||||
-rw-r--r-- | ext/gettext/gettext.c | 29 | ||||
-rw-r--r-- | ext/gettext/php_gettext.h | 3 |
3 files changed, 33 insertions, 0 deletions
diff --git a/ext/gettext/config.m4 b/ext/gettext/config.m4 index da184397d9..91df7ff26e 100644 --- a/ext/gettext/config.m4 +++ b/ext/gettext/config.m4 @@ -48,5 +48,6 @@ if test "$PHP_GETTEXT" != "no"; then AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, ngettext, [AC_DEFINE(HAVE_NGETTEXT, 1, [ ])]) AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, dngettext, [AC_DEFINE(HAVE_DNGETTEXT, 1, [ ])]) AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, dcngettext, [AC_DEFINE(HAVE_DCNGETTEXT, 1, [ ])]) + AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, bind_textdomain_codeset, [AC_DEFINE(HAVE_BIND_TEXTDOMAIN_CODESET, 1, [ ])]) fi diff --git a/ext/gettext/gettext.c b/ext/gettext/gettext.c index f29dbdba30..f8f841f81a 100644 --- a/ext/gettext/gettext.c +++ b/ext/gettext/gettext.c @@ -49,6 +49,11 @@ function_entry php_gettext_functions[] = { #if HAVE_DCNGETTEXT PHP_FE(dcngettext, NULL) #endif +#if HAVE_BIND_TEXTDOMAIN_CODESET + PHP_FE(bind_textdomain_codeset, NULL) +#endif + + {NULL, NULL, NULL} }; /* }}} */ @@ -269,6 +274,30 @@ PHP_FUNCTION(dcngettext) /* }}} */ #endif +#if HAVE_BIND_TEXTDOMAIN_CODESET + +/* {{{ proto string bind_textdomain_codeset (string domain, string codeset) + Specify the character encoding in which the messages from the DOMAIN message catalog will be returned. */ +PHP_FUNCTION(bind_textdomain_codeset) +{ + zval **domain, **codeset; + char *retval; + + if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &domain, &codeset) == FAILURE) { + WRONG_PARAM_COUNT; + } else { + convert_to_string_ex(domain); + convert_to_string_ex(codeset); + + retval = bind_textdomain_codeset(Z_STRVAL_PP(domain), Z_STRVAL_PP(codeset)); + + RETURN_STRING(retval, 1); + } +} +/* }}} */ +#endif + + #endif /* HAVE_LIBINTL */ /* diff --git a/ext/gettext/php_gettext.h b/ext/gettext/php_gettext.h index 8a2faf9f7c..3fac0a16cf 100644 --- a/ext/gettext/php_gettext.h +++ b/ext/gettext/php_gettext.h @@ -45,6 +45,9 @@ PHP_FUNCTION(dngettext); #if HAVE_DCNGETTEXT PHP_FUNCTION(dcngettext); #endif +#if HAVE_BIND_TEXTDOMAIN_CODESET +PHP_FUNCTION(bind_textdomain_codeset); +#endif #else #define gettext_module_ptr NULL |