@ Added support for bind_textdomain_codeset(). (rudib@email.si)

This commit is contained in:
Jon Parise 2001-11-09 16:27:09 +00:00
parent 8ee38d9d75
commit 8f26c3f326
3 changed files with 33 additions and 0 deletions

View File

@ -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

View File

@ -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 */
/*

View File

@ -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