[PHP-DEV] Adding LC_* constants to PHP? From: Zak Greant (zak <email protected>)
Date: 12/04/00

I would like to add a set of constants for the LC_* values to the gettext.c
file. Doing this would allow people using the dcgettext function (all one
or two of us ;) to use a constant, instead of a numeric value for the
category argument of the function.

Can anyone see a down side to doing this?

As I understand it, I would need to add the following code to gettext.c:

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; // I am not sure if this is needed...
}

The LC_* constants used to set the values for the analogous PHP constants
should already be available from locale.h (which is included by libintl.h)

Any comments or suggestions?

 --zak

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>