php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
timezone_class.h
Go to the documentation of this file.
1/*
2 +----------------------------------------------------------------------+
3 | This source file is subject to version 3.01 of the PHP license, |
4 | that is bundled with this package in the file LICENSE, and is |
5 | available through the world-wide-web at the following url: |
6 | https://www.php.net/license/3_01.txt |
7 | If you did not receive a copy of the PHP license and are unable to |
8 | obtain it through the world-wide-web, please send a note to |
9 | license@php.net so we can mail you a copy immediately. |
10 +----------------------------------------------------------------------+
11 | Authors: Gustavo Lopes <cataphract@netcabo.pt> |
12 +----------------------------------------------------------------------+
13 */
14
15#ifndef TIMEZONE_CLASS_H
16#define TIMEZONE_CLASS_H
17
18//redefinition of inline in PHP headers causes problems, so include this before
19#include <math.h>
20
21//fixes the build on windows for old versions of ICU
22#include <stdio.h>
23
24#include <php.h>
25#include "intl_error.h"
26#include "intl_data.h"
27
28#ifndef USE_TIMEZONE_POINTER
29typedef void TimeZone;
30#else
31using icu::TimeZone;
32#endif
33
34typedef struct {
35 // error handling
37
38 // ICU TimeZone
40
41 //whether to delete the timezone on object free
43
46
47static 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 zend_throw_error(NULL, "Found unconstructed IntlTimeZone"); \
64 RETURN_THROWS(); \
65 }
66
67zval *timezone_convert_to_datetimezone(const TimeZone *timeZone, intl_error *outside_error, const char *func, zval *ret);
69
70void timezone_object_construct(const TimeZone *zone, zval *object, int owned);
71
73
76
77#endif /* #ifndef TIMEZONE_CLASS_H */
error($message)
Definition ext_skel.php:22
bool owned
Definition ffi.c:3815
struct _intl_error intl_error
const TimeZone * utimezone
void timezone_object_construct(const TimeZone *zone, zval *object, int owned)
void timezone_register_IntlTimeZone_class(void)
TimeZone * timezone_process_timezone_argument(zval *zv_timezone, intl_error *error, const char *func)
void TimeZone
zend_object_handlers TimeZone_handlers
zend_class_entry * TimeZone_ce_ptr
zval * timezone_convert_to_datetimezone(const TimeZone *timeZone, intl_error *outside_error, const char *func, zval *ret)
struct _zval_struct zval
execute_data func
#define XtOffsetOf(s_type, field)
struct _zend_class_entry zend_class_entry
struct _zend_object zend_object
struct _zend_object_handlers zend_object_handlers
Definition zend_types.h:88
zval * ret