Back to index

php5  5.3.10
Defines | Functions
locale.c File Reference
#include "locale_class.h"
#include "locale.h"
#include <unicode/utypes.h>
#include <unicode/uloc.h>
#include <unicode/ustring.h>

Go to the source code of this file.

Defines

#define LOCALE_EXPOSE_CONST(x)   REGISTER_LONG_CONSTANT(#x, x, CONST_CS)
#define LOCALE_EXPOSE_CLASS_CONST(x)   zend_declare_class_constant_long( Locale_ce_ptr, ZEND_STRS( #x ) - 1, ULOC_##x TSRMLS_CC );
#define LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR(name, value)   zend_declare_class_constant_string( Locale_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC );

Functions

void locale_register_constants (INIT_FUNC_ARGS)

Define Documentation

#define LOCALE_EXPOSE_CONST (   x)    REGISTER_LONG_CONSTANT(#x, x, CONST_CS)

Function Documentation

Definition at line 34 of file locale.c.

{
       if( !Locale_ce_ptr )
       {
              zend_error( E_ERROR, "Locale class not defined" );
              return;
       }

       #define LOCALE_EXPOSE_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_CS)
       #define LOCALE_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( Locale_ce_ptr, ZEND_STRS( #x ) - 1, ULOC_##x TSRMLS_CC );
       #define LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR(name, value) zend_declare_class_constant_string( Locale_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC );

       LOCALE_EXPOSE_CLASS_CONST( ACTUAL_LOCALE );
       LOCALE_EXPOSE_CLASS_CONST( VALID_LOCALE );

       zend_declare_class_constant_null(Locale_ce_ptr, ZEND_STRS("DEFAULT_LOCALE") - 1 TSRMLS_CC);

       LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR( "LANG_TAG", LOC_LANG_TAG);
       LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR( "EXTLANG_TAG", LOC_EXTLANG_TAG);
       LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR( "SCRIPT_TAG", LOC_SCRIPT_TAG);
       LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR( "REGION_TAG", LOC_REGION_TAG);
       LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR( "VARIANT_TAG",LOC_VARIANT_TAG);
       LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR( "GRANDFATHERED_LANG_TAG",LOC_GRANDFATHERED_LANG_TAG);
       LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR( "PRIVATE_TAG",LOC_PRIVATE_TAG);

       #undef LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR
       #undef LOCALE_EXPOSE_CLASS_CONST
       #undef LOCALE_EXPOSE_CONST
}

Here is the call graph for this function:

Here is the caller graph for this function: