Back to index

php5  5.3.10
Functions
dateformat_parse.h File Reference
#include <php.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 PHP_FUNCTION (datefmt_parse)
 PHP_FUNCTION (datefmt_localtime)

Function Documentation

Definition at line 128 of file dateformat_parse.c.

{
       char*           text_to_parse = NULL;
       int32_t         text_len =0;
       zval*                z_parse_pos = NULL;
       int32_t                     parse_pos = -1;

       DATE_FORMAT_METHOD_INIT_VARS;

       /* Parse parameters. */
       if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|z!",
              &object, IntlDateFormatter_ce_ptr, &text_to_parse, &text_len, &z_parse_pos ) == FAILURE ){
              intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_parse: unable to parse input params", 0 TSRMLS_CC );
              RETURN_FALSE;
       }

       /* Fetch the object. */
       DATE_FORMAT_METHOD_FETCH_OBJECT;

       if (z_parse_pos) {
              convert_to_long(z_parse_pos);
              parse_pos = (int32_t)Z_LVAL_P(z_parse_pos);
              if(parse_pos > text_len) {
                     RETURN_FALSE;
              }
       }
       internal_parse_to_timestamp( dfo, text_to_parse, text_len, z_parse_pos?&parse_pos:NULL, return_value TSRMLS_CC);
       if(z_parse_pos) {
              zval_dtor(z_parse_pos);
              ZVAL_LONG(z_parse_pos, parse_pos);
       }
}

Here is the call graph for this function:

Definition at line 166 of file dateformat_parse.c.

{
       char*           text_to_parse = NULL;
       int32_t         text_len =0;
       zval*                z_parse_pos = NULL;
       int32_t                     parse_pos = -1;

       DATE_FORMAT_METHOD_INIT_VARS;

       /* Parse parameters. */
       if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|z!",
              &object, IntlDateFormatter_ce_ptr, &text_to_parse, &text_len, &z_parse_pos ) == FAILURE ){
              intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_parse_to_localtime: unable to parse input params", 0 TSRMLS_CC );
              RETURN_FALSE;
       }

    /* Fetch the object. */
       DATE_FORMAT_METHOD_FETCH_OBJECT;

       if(z_parse_pos) {
              convert_to_long(z_parse_pos);
              parse_pos = (int32_t)Z_LVAL_P(z_parse_pos);
              if(parse_pos > text_len) {
                     RETURN_FALSE;
              }
       }
       internal_parse_to_localtime( dfo, text_to_parse, text_len, z_parse_pos?&parse_pos:NULL, return_value TSRMLS_CC);
       if(z_parse_pos) {
              zval_dtor(z_parse_pos);
              ZVAL_LONG(z_parse_pos, parse_pos);
       }
}

Here is the call graph for this function: