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: Kirti Velankar <kirtig@yahoo-inc.com>                       |
14    +----------------------------------------------------------------------+
15 */
16 #ifndef DATE_FORMAT_CLASS_H
17 #define DATE_FORMAT_CLASS_H
18 
19 #include <php.h>
20 
21 #include "intl_common.h"
22 #include "intl_error.h"
23 #include "intl_data.h"
24 #include "dateformat_data.h"
25 
26 typedef struct {
27 	zend_object     	zo;
28 	dateformat_data  	datef_data;
29 	int			date_type ;
30 	int			time_type ;
31 	int			calendar ;
32 	char*			timezone_id;
33 } IntlDateFormatter_object;
34 
35 void dateformat_register_IntlDateFormatter_class( TSRMLS_D );
36 extern zend_class_entry *IntlDateFormatter_ce_ptr;
37 
38 /* Auxiliary macros */
39 
40 #define DATE_FORMAT_METHOD_INIT_VARS	INTL_METHOD_INIT_VARS(IntlDateFormatter, dfo)
41 #define DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK	INTL_METHOD_FETCH_OBJECT(IntlDateFormatter, dfo)
42 #define DATE_FORMAT_METHOD_FETCH_OBJECT				\
43 		DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK;	\
44 	if (dfo->datef_data.udatf == NULL)				\
45 	{												\
46 		intl_errors_set(&dfo->datef_data.error, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlDateFormatter", 0 TSRMLS_CC); \
47 		RETURN_FALSE;								\
48 	}
49 
50 #define DATE_FORMAT_OBJECT(dfo)		(dfo)->datef_data.udatf
51 
52 #endif // #ifndef DATE_FORMAT_CLASS_H
53