This source file includes following definitions.
- php_intl_timezone_fetch_object
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #ifndef TIMEZONE_CLASS_H
18 #define TIMEZONE_CLASS_H
19
20
21 #include <math.h>
22
23
24 #include <stdio.h>
25
26 #include <php.h>
27 #include "intl_error.h"
28 #include "intl_data.h"
29
30 #ifndef USE_TIMEZONE_POINTER
31 typedef void TimeZone;
32 #endif
33
34 typedef struct {
35
36 intl_error err;
37
38
39 const TimeZone *utimezone;
40
41
42 zend_bool should_delete;
43
44 zend_object zo;
45 } TimeZone_object;
46
47 static inline TimeZone_object *php_intl_timezone_fetch_object(zend_object *obj) {
48 return (TimeZone_object *)((char*)(obj) - XtOffsetOf(TimeZone_object, zo));
49 }
50 #define Z_INTL_TIMEZONE_P(zv) php_intl_timezone_fetch_object(Z_OBJ_P(zv))
51
52 #define TIMEZONE_ERROR(to) (to)->err
53 #define TIMEZONE_ERROR_P(to) &(TIMEZONE_ERROR(to))
54
55 #define TIMEZONE_ERROR_CODE(co) INTL_ERROR_CODE(TIMEZONE_ERROR(to))
56 #define TIMEZONE_ERROR_CODE_P(co) &(INTL_ERROR_CODE(TIMEZONE_ERROR(to)))
57
58 #define TIMEZONE_METHOD_INIT_VARS INTL_METHOD_INIT_VARS(TimeZone, to)
59 #define TIMEZONE_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(INTL_TIMEZONE, to)
60 #define TIMEZONE_METHOD_FETCH_OBJECT\
61 TIMEZONE_METHOD_FETCH_OBJECT_NO_CHECK; \
62 if (to->utimezone == NULL) { \
63 intl_errors_set(&to->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlTimeZone", 0); \
64 RETURN_FALSE; \
65 }
66
67 zval *timezone_convert_to_datetimezone(const TimeZone *timeZone, intl_error *outside_error, const char *func, zval *ret);
68 TimeZone *timezone_process_timezone_argument(zval *zv_timezone, intl_error *error, const char *func);
69
70 void timezone_object_construct(const TimeZone *zone, zval *object, int owned);
71
72 void timezone_register_IntlTimeZone_class(void);
73
74 extern zend_class_entry *TimeZone_ce_ptr;
75 extern zend_object_handlers TimeZone_handlers;
76
77 #endif