Back to index

php5  5.3.10
Functions | Variables
formatter_class.c File Reference
#include <unicode/unum.h>
#include "formatter_class.h"
#include "php_intl.h"
#include "formatter_data.h"
#include "formatter_format.h"
#include "formatter_parse.h"
#include "formatter_main.h"
#include "formatter_attr.h"

Go to the source code of this file.

Functions

static void NumberFormatter_object_dtor (void *object, zend_object_handle handle TSRMLS_DC)
void NumberFormatter_object_free (zend_object *object TSRMLS_DC)
zend_object_value NumberFormatter_object_create (zend_class_entry *ce TSRMLS_DC)
zend_object_value NumberFormatter_object_clone (zval *object TSRMLS_DC)
void formatter_register_class (TSRMLS_D)

Variables

zend_class_entry * NumberFormatter_ce_ptr = NULL
static zend_object_handlers NumberFormatter_handlers
static function_entry NumberFormatter_class_functions []

Function Documentation

Definition at line 189 of file formatter_class.c.

{
       zend_class_entry ce;

       /* Create and register 'NumberFormatter' class. */
       INIT_CLASS_ENTRY( ce, "NumberFormatter", NumberFormatter_class_functions );
       ce.create_object = NumberFormatter_object_create;
       NumberFormatter_ce_ptr = zend_register_internal_class( &ce TSRMLS_CC );

       memcpy(&NumberFormatter_handlers, zend_get_std_object_handlers(),
              sizeof(NumberFormatter_handlers));
       NumberFormatter_handlers.clone_obj = NumberFormatter_object_clone;

       /* Declare 'NumberFormatter' class properties. */
       if( !NumberFormatter_ce_ptr )
       {
              zend_error(E_ERROR, "Failed to register NumberFormatter class");
              return;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

zend_object_value NumberFormatter_object_clone ( zval *object  TSRMLS_DC)

Definition at line 79 of file formatter_class.c.

{
       zend_object_value new_obj_val;
       zend_object_handle handle = Z_OBJ_HANDLE_P(object);
       NumberFormatter_object *nfo, *new_nfo;

       FORMATTER_METHOD_FETCH_OBJECT;
       new_obj_val = NumberFormatter_ce_ptr->create_object(NumberFormatter_ce_ptr TSRMLS_CC);
       new_nfo = (NumberFormatter_object *)zend_object_store_get_object_by_handle(new_obj_val.handle TSRMLS_CC);
       /* clone standard parts */  
       zend_objects_clone_members(&new_nfo->zo, new_obj_val, &nfo->zo, handle TSRMLS_CC);
       /* clone formatter object */
       FORMATTER_OBJECT(new_nfo) = unum_clone(FORMATTER_OBJECT(nfo),  &INTL_DATA_ERROR_CODE(new_nfo));
       if(U_FAILURE(INTL_DATA_ERROR_CODE(new_nfo))) {
              /* set up error in case error handler is interested */
              intl_error_set( NULL, INTL_DATA_ERROR_CODE(new_nfo), "Failed to clone NumberFormatter object", 0 TSRMLS_CC );
              NumberFormatter_object_dtor(new_nfo, new_obj_val.handle TSRMLS_CC); /* free new object */
              zend_error(E_ERROR, "Failed to clone NumberFormatter object");
       }
       return new_obj_val;
}

Here is the call graph for this function:

Here is the caller graph for this function:

zend_object_value NumberFormatter_object_create ( zend_class_entry *ce  TSRMLS_DC)

Definition at line 57 of file formatter_class.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void NumberFormatter_object_dtor ( void *  object,
zend_object_handle handle  TSRMLS_DC 
) [static]

Definition at line 35 of file formatter_class.c.

{
       zend_objects_destroy_object( object, handle TSRMLS_CC );
}

Here is the call graph for this function:

Here is the caller graph for this function:

void NumberFormatter_object_free ( zend_object *object  TSRMLS_DC)

Definition at line 44 of file formatter_class.c.

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

zend_class_entry* NumberFormatter_ce_ptr = NULL

Definition at line 27 of file formatter_class.c.

Initial value:

Definition at line 164 of file formatter_class.c.

zend_object_handlers NumberFormatter_handlers [static]

Definition at line 28 of file formatter_class.c.