PHP  
 PHP: Test and Code Coverage Analysis
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

LCOV - code coverage report
Current view: top level - ext/intl/locale - locale.c (source / functions) Hit Total Coverage
Test: PHP Code Coverage Lines: 12 14 85.7 %
Date: 2019-05-06 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :    +----------------------------------------------------------------------+
       3             :    | PHP Version 7                                                        |
       4             :    +----------------------------------------------------------------------+
       5             :    | This source file is subject to version 3.01 of the PHP license,      |
       6             :    | that is bundled with this package in the file LICENSE, and is        |
       7             :    | available through the world-wide-web at the following url:           |
       8             :    | http://www.php.net/license/3_01.txt                                  |
       9             :    | If you did not receive a copy of the PHP license and are unable to   |
      10             :    | obtain it through the world-wide-web, please send a note to          |
      11             :    | license@php.net so we can mail you a copy immediately.               |
      12             :    +----------------------------------------------------------------------+
      13             :    | Author: Kirti Velankar <kirtig@yahoo-inc.com>                        |
      14             :    +----------------------------------------------------------------------+
      15             : */
      16             : 
      17             : #ifdef HAVE_CONFIG_H
      18             : #include "config.h"
      19             : #endif
      20             : 
      21             : #include "locale_class.h"
      22             : #include "locale.h"
      23             : 
      24             : #include <unicode/utypes.h>
      25             : #include <unicode/uloc.h>
      26             : #include <unicode/ustring.h>
      27             : 
      28             : /* {{{ locale_register_constants
      29             :  * Register constants common for the both (OO and procedural)
      30             :  * APIs.
      31             :  */
      32       23043 : void locale_register_constants( INIT_FUNC_ARGS )
      33             : {
      34       23043 :         if( !Locale_ce_ptr )
      35             :         {
      36           0 :                 zend_error( E_ERROR, "Locale class not defined" );
      37           0 :                 return;
      38             :         }
      39             : 
      40             :         #define LOCALE_EXPOSE_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_PERSISTENT | CONST_CS)
      41             :         #define LOCALE_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( Locale_ce_ptr, ZEND_STRS( #x ) - 1, ULOC_##x );
      42             :         #define LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR(name, value) zend_declare_class_constant_string( Locale_ce_ptr, ZEND_STRS( name ) - 1, value );
      43             : 
      44       23043 :         LOCALE_EXPOSE_CLASS_CONST( ACTUAL_LOCALE );
      45       23043 :         LOCALE_EXPOSE_CLASS_CONST( VALID_LOCALE );
      46             : 
      47       23043 :         zend_declare_class_constant_null(Locale_ce_ptr, ZEND_STRS("DEFAULT_LOCALE") - 1);
      48             : 
      49       23043 :         LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR( "LANG_TAG", LOC_LANG_TAG);
      50       23043 :         LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR( "EXTLANG_TAG", LOC_EXTLANG_TAG);
      51       23043 :         LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR( "SCRIPT_TAG", LOC_SCRIPT_TAG);
      52       23043 :         LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR( "REGION_TAG", LOC_REGION_TAG);
      53       23043 :         LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR( "VARIANT_TAG",LOC_VARIANT_TAG);
      54       23043 :         LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR( "GRANDFATHERED_LANG_TAG",LOC_GRANDFATHERED_LANG_TAG);
      55       23043 :         LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR( "PRIVATE_TAG",LOC_PRIVATE_TAG);
      56             : 
      57             :         #undef LOCALE_EXPOSE_CUSTOM_CLASS_CONST_STR
      58             :         #undef LOCALE_EXPOSE_CLASS_CONST
      59             :         #undef LOCALE_EXPOSE_CONST
      60             : }
      61             : /* }}} */

Generated by: LCOV version 1.10

Generated at Mon, 06 May 2019 17:58:16 +0000 (992 days ago)

Copyright © 2005-2022 The PHP Group
All rights reserved.