php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
common_enum.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: Vadim Savchuk <vsavchuk@productengine.com> |
12 | Dmitry Lakhtyuk <dlakhtyuk@productengine.com> |
13 +----------------------------------------------------------------------+
14 */
15
16#ifndef INTL_COMMON_ENUM_H
17#define INTL_COMMON_ENUM_H
18
19#include <unicode/umachine.h>
20#ifdef __cplusplus
21#include <unicode/strenum.h>
22extern "C" {
23#include <math.h>
24#endif
25#include <php.h>
26#include "../intl_error.h"
27#include "../intl_data.h"
28#ifdef __cplusplus
29}
30#endif
31
32#define INTLITERATOR_ERROR(ii) (ii)->err
33#define INTLITERATOR_ERROR_P(ii) &(INTLITERATOR_ERROR(ii))
34
35#define INTLITERATOR_ERROR_CODE(ii) INTL_ERROR_CODE(INTLITERATOR_ERROR(ii))
36#define INTLITERATOR_ERROR_CODE_P(ii) &(INTL_ERROR_CODE(INTLITERATOR_ERROR(ii)))
37
38#define INTLITERATOR_METHOD_INIT_VARS INTL_METHOD_INIT_VARS(IntlIterator, ii)
39#define INTLITERATOR_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(INTL_ITERATOR, ii)
40#define INTLITERATOR_METHOD_FETCH_OBJECT\
41 object = ZEND_THIS; \
42 INTLITERATOR_METHOD_FETCH_OBJECT_NO_CHECK; \
43 if (ii->iterator == NULL) { \
44 zend_throw_error(NULL, "Found unconstructed IntlIterator"); \
45 RETURN_THROWS(); \
46 }
47
53
54
55static inline IntlIterator_object *php_intl_iterator_fetch_object(zend_object *obj) {
56 return (IntlIterator_object *)((char*)(obj) - XtOffsetOf(IntlIterator_object, zo));
57}
58#define Z_INTL_ITERATOR_P(zv) php_intl_iterator_fetch_object(Z_OBJ_P(zv))
59
66
69
75
76#ifdef __cplusplus
77using icu::StringEnumeration;
78U_CFUNC void IntlIterator_from_StringEnumeration(StringEnumeration *se, zval *object);
79#endif
80
81U_CFUNC void intl_register_common_symbols(int module_number);
82
83#endif // INTL_COMMON_ENUM_H
U_CFUNC void zoi_with_current_dtor(zend_object_iterator *iter)
U_CFUNC void intl_register_common_symbols(int module_number)
U_CFUNC void zoi_with_current_invalidate_current(zend_object_iterator *iter)
zend_class_entry * IntlIterator_ce_ptr
zend_object_handlers IntlIterator_handlers
U_CFUNC zend_result zoi_with_current_valid(zend_object_iterator *iter)
U_CFUNC HashTable * zoi_with_current_get_gc(zend_object_iterator *iter, zval **table, int *n)
U_CFUNC zval * zoi_with_current_get_current_data(zend_object_iterator *iter)
zend_long n
Definition ffi.c:4979
struct _intl_error intl_error
zend_object_iterator * iterator
Definition common_enum.h:50
void(* destroy_it)(zend_object_iterator *iterator)
Definition common_enum.h:64
zend_object_iterator zoi
Definition common_enum.h:61
struct _zval_struct zval
ZEND_API void(ZEND_FASTCALL *zend_touch_vm_stack_data)(void *vm_stack_data)
struct _zend_object_iterator zend_object_iterator
#define XtOffsetOf(s_type, field)
struct _zend_class_entry zend_class_entry
struct _zend_object zend_object
struct _zend_array HashTable
Definition zend_types.h:386
ZEND_RESULT_CODE zend_result
Definition zend_types.h:64
struct _zend_object_handlers zend_object_handlers
Definition zend_types.h:88