Minor patches for gettext
| From: | Zak Greant | Date: | Thu, 07 Dec 2000 20:02:40 +0000 |
| Subject: | Minor patches for gettext | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-40492@lists.php.net to get a copy of this message | ||
Hello All,
Could someone review the following patches for gettext. The patches add
constants to represent the various categories of locale. Please let me know
if there are any inaccuracies or problems. (ps. Thanks for your help
Sterling)
--zak
--- php_gettext.h Thu Dec 7 12:53:31 2000
+++ php_gettext.h.zak Thu Dec 7 12:47:12 2000
@@ -30,6 +30,7 @@
#define gettext_module_ptr &php_gettext_module_entry
PHP_MINFO_FUNCTION(gettext);
+PHP_MINIT_FUNCTION(gettext);
PHP_FUNCTION(textdomain);
PHP_FUNCTION(gettext);
--- gettext.c Thu Dec 7 12:53:31 2000
+++ gettext.c.zak Thu Dec 7 12:46:19 2000
@@ -38,7 +38,7 @@
};
zend_module_entry php_gettext_module_entry = {
- "gettext", php_gettext_functions, NULL, NULL, NULL, NULL,
PHP_MINFO(gettext), STANDARD_MODULE_PROPERTIES
+ "gettext", php_gettext_functions, PHP_MINIT(gettext), NULL, NULL,
NULL, PHP_MINFO(gettext), STANDARD_MODULE_PROPERTIES
};
#ifdef COMPILE_DL_GETTEXT
@@ -50,6 +50,19 @@
php_info_print_table_start();
php_info_print_table_row(2, "GNU GetText Support", "enabled");
php_info_print_table_end();
+}
+
+
+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);
+ return SUCCESS;
}
/* {{{ proto string textdomain(string domain)