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

LTP GCOV extension - code coverage report
Current view: directory - intl/collator - collator_locale.c
Test: PHP Code Coverage
Date: 2009-11-21 Instrumented lines: 11
Code covered: 100.0 % Executed lines: 11
Legend: not executed executed

       1                 : /*
       2                 :    +----------------------------------------------------------------------+
       3                 :    | PHP Version 5                                                        |
       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                 :    | Authors: Vadim Savchuk <vsavchuk@productengine.com>                  |
      14                 :    |          Dmitry Lakhtyuk <dlakhtyuk@productengine.com>               |
      15                 :    +----------------------------------------------------------------------+
      16                 :  */
      17                 : 
      18                 : #ifdef HAVE_CONFIG_H
      19                 : #include "config.h"
      20                 : #endif
      21                 : 
      22                 : #include "php_intl.h"
      23                 : #include "collator_class.h"
      24                 : #include "collator_locale.h"
      25                 : #include "intl_convert.h"
      26                 : 
      27                 : #include <zend_API.h>
      28                 : 
      29                 : /* {{{ proto string Collator::getLocale( int $type )
      30                 :  * Gets the locale name of the collator. }}} */
      31                 : /* {{{ proto string collator_get_locale( Collator $coll, int $type )
      32                 :  * Gets the locale name of the collator.
      33                 :  */
      34                 : PHP_FUNCTION( collator_get_locale )
      35              42 : {
      36              42 :         long   type        = 0;
      37              42 :         char*  locale_name = NULL;
      38                 : 
      39              42 :         COLLATOR_METHOD_INIT_VARS
      40                 : 
      41                 :         /* Parse parameters. */
      42              42 :         if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol",
      43                 :                 &object, Collator_ce_ptr, &type ) == FAILURE )
      44                 :         {
      45               2 :                 intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
      46                 :                         "collator_get_locale: unable to parse input params", 0 TSRMLS_CC );
      47                 : 
      48               2 :                 RETURN_FALSE;
      49                 :         }
      50                 : 
      51                 :         /* Fetch the object. */
      52              40 :         COLLATOR_METHOD_FETCH_OBJECT;
      53                 : 
      54                 :         /* Get locale by specified type. */
      55              40 :         locale_name = (char*) ucol_getLocaleByType(
      56                 :                 co->ucoll, type, COLLATOR_ERROR_CODE_P( co ) );
      57              40 :         COLLATOR_CHECK_STATUS( co, "Error getting locale by type" );
      58                 : 
      59                 :         /* Return it. */
      60              32 :         RETVAL_STRINGL( locale_name, strlen(locale_name), TRUE );
      61                 : }
      62                 : /* }}} */
      63                 : 
      64                 : /*
      65                 :  * Local variables:
      66                 :  * tab-width: 4
      67                 :  * c-basic-offset: 4
      68                 :  * End:
      69                 :  * vim600: noet sw=4 ts=4 fdm=marker
      70                 :  * vim<600: noet sw=4 ts=4
      71                 :  */

Generated by: LTP GCOV extension version 1.5

Generated at Sat, 21 Nov 2009 12:27:01 +0000 (3 days ago)

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