Back to index

php5  5.3.10
dateformat_data.c
Go to the documentation of this file.
00001 /*
00002    +----------------------------------------------------------------------+
00003    | PHP Version 5                                                        |
00004    +----------------------------------------------------------------------+
00005    | This source file is subject to version 3.01 of the PHP license,      |
00006    | that is bundled with this package in the file LICENSE, and is        |
00007    | available through the world-wide-web at the following url:           |
00008    | http://www.php.net/license/3_01.txt                                  |
00009    | If you did not receive a copy of the PHP license and are unable to   |
00010    | obtain it through the world-wide-web, please send a note to          |
00011    | license@php.net so we can mail you a copy immediately.               |
00012    +----------------------------------------------------------------------+
00013    | Authors: Kirti Velankar <kirtig@yahoo-inc.com>                       |
00014    +----------------------------------------------------------------------+
00015 */
00016 #ifdef HAVE_CONFIG_H
00017 #include "config.h"
00018 #endif
00019 
00020 #include "dateformat_data.h"
00021 
00022 /* {{{ void dateformat_data_init( dateformat_data* datef_data )
00023  * Initialize internals of dateformat_data.
00024  */
00025 void dateformat_data_init( dateformat_data* datef_data TSRMLS_DC )
00026 {
00027        if( !datef_data )
00028               return;
00029 
00030        datef_data->udatf = NULL;
00031        intl_error_reset( &datef_data->error TSRMLS_CC );
00032 }
00033 /* }}} */
00034 
00035 /* {{{ void dateformat_data_free( dateformat_data* datef_data )
00036  * Clean up memory allocated for dateformat_data
00037  */
00038 void dateformat_data_free( dateformat_data* datef_data TSRMLS_DC )
00039 {
00040        if( !datef_data )
00041               return;
00042 
00043        if( datef_data->udatf )
00044               udat_close( datef_data->udatf );
00045 
00046        datef_data->udatf = NULL;
00047        intl_error_reset( &datef_data->error TSRMLS_CC );
00048 }
00049 /* }}} */
00050 
00051 /* {{{ dateformat_data* dateformat_data_create()
00052  * Allocate memory for dateformat_data and initialize it with default values.
00053  */
00054 dateformat_data* dateformat_data_create( TSRMLS_D )
00055 {
00056        dateformat_data* datef_data = ecalloc( 1, sizeof(dateformat_data) );
00057 
00058        dateformat_data_init( datef_data TSRMLS_CC );
00059 
00060        return datef_data;
00061 }
00062 /* }}} */