]> granicus.if.org Git - php/commitdiff
@ Added support for bind_textdomain_codeset(). (rudib@email.si)
authorJon Parise <jon@php.net>
Fri, 9 Nov 2001 16:27:09 +0000 (16:27 +0000)
committerJon Parise <jon@php.net>
Fri, 9 Nov 2001 16:27:09 +0000 (16:27 +0000)
ext/gettext/config.m4
ext/gettext/gettext.c
ext/gettext/php_gettext.h

index da184397d939d90b9e3c26f8dcfdd6415679ab0e..91df7ff26e8d6cdd581a0715913115eab279e69b 100644 (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
index f29dbdba30472f2aa346e66d1fed29aa04ddba9c..f8f841f81a82ddb5f48c937d7ca4f935c1d9c3e1 100644 (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 */
 
 /*
index 8a2faf9f7c918a7d9e4893a6c1ea53031b29fbcc..3fac0a16cff1008c2cfae801575ba2b973751bd0 100644 (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