Back to index

php5  5.3.10
Functions
collator_attr.c File Reference
#include "php_intl.h"
#include "collator_class.h"
#include "collator_convert.h"
#include "collator_attr.h"
#include <unicode/ustring.h>

Go to the source code of this file.

Functions

 PHP_FUNCTION (collator_get_attribute)
 PHP_FUNCTION (collator_set_attribute)
 PHP_FUNCTION (collator_get_strength)
 PHP_FUNCTION (collator_set_strength)

Function Documentation

Definition at line 34 of file collator_attr.c.

{
       long attribute, value;

       COLLATOR_METHOD_INIT_VARS

       /* Parse parameters. */
       if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol",
              &object, Collator_ce_ptr, &attribute ) == FAILURE )
       {
              intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
                     "collator_get_attribute: unable to parse input params", 0 TSRMLS_CC );

              RETURN_FALSE;
       }

       /* Fetch the object. */
       COLLATOR_METHOD_FETCH_OBJECT;

       value = ucol_getAttribute( co->ucoll, attribute, COLLATOR_ERROR_CODE_P( co ) );
       COLLATOR_CHECK_STATUS( co, "Error getting attribute value" );

       RETURN_LONG( value );
}

Here is the call graph for this function:

Definition at line 65 of file collator_attr.c.

{
       long attribute, value;
       COLLATOR_METHOD_INIT_VARS


       /* Parse parameters. */
       if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll",
              &object, Collator_ce_ptr, &attribute, &value ) == FAILURE)
       {
              intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
                      "collator_set_attribute: unable to parse input params", 0 TSRMLS_CC );

              RETURN_FALSE;
       }

       /* Fetch the object. */
       COLLATOR_METHOD_FETCH_OBJECT;

       /* Set new value for the given attribute. */
       ucol_setAttribute( co->ucoll, attribute, value, COLLATOR_ERROR_CODE_P( co ) );
       COLLATOR_CHECK_STATUS( co, "Error setting attribute value" );

       RETURN_TRUE;
}

Here is the call graph for this function:

Definition at line 97 of file collator_attr.c.

{
       COLLATOR_METHOD_INIT_VARS

       /* Parse parameters. */
       if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
              &object, Collator_ce_ptr ) == FAILURE )
       {
              intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
                      "collator_get_strength: unable to parse input params", 0 TSRMLS_CC );

              RETURN_FALSE;
       }

       /* Fetch the object. */
       COLLATOR_METHOD_FETCH_OBJECT;

       /* Get current strength and return it. */
       RETURN_LONG( ucol_getStrength( co->ucoll ) );
}

Here is the call graph for this function:

Definition at line 124 of file collator_attr.c.

{
       long strength;

       COLLATOR_METHOD_INIT_VARS

       /* Parse parameters. */
       if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol",
              &object, Collator_ce_ptr, &strength ) == FAILURE )
       {
              intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
                      "collator_set_strength: unable to parse input params", 0 TSRMLS_CC );

              RETURN_FALSE;
       }

       /* Fetch the object. */
       COLLATOR_METHOD_FETCH_OBJECT;

       /* Set given strength. */
       ucol_setStrength( co->ucoll, strength );

       RETURN_TRUE;
}

Here is the call graph for this function: