I'd say i18n_loc_get_default() and i18n_loc_set_default() are the ugliest names 
I've ever saw =)
default_locale_set() and default_locale_get() would be MUCH more readable and 
clear.


On 19.04.2006 01:36, Andrei Zmievski wrote:
andrei          Tue Apr 18 21:36:38 2006 UTC

Modified files: /php-src/ext/unicode locale.c Log:
  Update protos.
http://cvs.php.net/viewcvs.cgi/php-src/ext/unicode/locale.c?r1=1.7&r2=1.8&diff_format=u
Index: php-src/ext/unicode/locale.c
diff -u php-src/ext/unicode/locale.c:1.7 php-src/ext/unicode/locale.c:1.8
--- php-src/ext/unicode/locale.c:1.7    Wed Mar 22 10:20:20 2006
+++ php-src/ext/unicode/locale.c        Tue Apr 18 21:36:38 2006
@@ -14,7 +14,7 @@
   +----------------------------------------------------------------------+
 */
-/* $Id: locale.c,v 1.7 2006/03/22 10:20:20 derick Exp $ */ +/* $Id: locale.c,v 1.8 2006/04/18 21:36:38 andrei Exp $ */ #include "php_unicode.h" @@ -40,6 +40,8 @@
        *target_len = canonicalized_len;
 }
+/* {{{ proto string i18n_loc_get_default(void) U
+   Returns default locale */
 PHP_FUNCTION(i18n_loc_get_default)
 {
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
@@ -48,7 +50,10 @@
RETURN_STRING(UG(default_locale), 1);
 }
+/* }}} */
+/* {{{ proto bool i18n_loc_set_default(string locale) U
+       Sets default locale */
 PHP_FUNCTION(i18n_loc_set_default)
 {
        char *locale;
@@ -63,7 +68,8 @@
        php_canonicalize_locale_id(&canonicalized, &locale_len, locale, 
&status);
        /*
         * UTODO: is this right? canonicalization does not seem to perform 
locale
-        * validation.
+        * validation. See this for possible solution:
+        * http://sourceforge.net/mailarchive/message.php?msg_id=11953411
         */
        if (U_FAILURE(status)) {
                php_error(E_WARNING, "Invalid locale: %s", locale);
@@ -79,6 +85,8 @@
        zend_reset_locale_deps(TSRMLS_C);
        RETURN_TRUE;
 }
+/* }}} */
+
 #endif /* HAVE_UNICODE */


--
Wbr, Antony Dovgal

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to