php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
breakiterator_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@php.net> |
12 +----------------------------------------------------------------------+
13 */
14
15#ifndef BREAKITERATOR_CLASS_H
16#define BREAKITERATOR_CLASS_H
17
18//redefinition of inline in PHP headers causes problems, so include this before
19#include <math.h>
20
21#include <php.h>
22#include "../intl_error.h"
23#include "../intl_data.h"
24
25#ifndef USE_BREAKITERATOR_POINTER
26typedef void BreakIterator;
27#else
28using icu::BreakIterator;
29#endif
30
31typedef struct {
32 // error handling
34
35 // ICU break iterator
37
38 // current text
40
43
44static inline BreakIterator_object *php_intl_breakiterator_fetch_object(zend_object *obj) {
45 return (BreakIterator_object *)((char*)(obj) - XtOffsetOf(BreakIterator_object, zo));
46}
47#define Z_INTL_BREAKITERATOR_P(zv) php_intl_breakiterator_fetch_object(Z_OBJ_P(zv))
48
49#define BREAKITER_ERROR(bio) (bio)->err
50#define BREAKITER_ERROR_P(bio) &(BREAKITER_ERROR(bio))
51
52#define BREAKITER_ERROR_CODE(bio) INTL_ERROR_CODE(BREAKITER_ERROR(bio))
53#define BREAKITER_ERROR_CODE_P(bio) &(INTL_ERROR_CODE(BREAKITER_ERROR(bio)))
54
55#define BREAKITER_METHOD_INIT_VARS INTL_METHOD_INIT_VARS(BreakIterator, bio)
56#define BREAKITER_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(INTL_BREAKITERATOR, bio)
57#define BREAKITER_METHOD_FETCH_OBJECT \
58 BREAKITER_METHOD_FETCH_OBJECT_NO_CHECK; \
59 if (bio->biter == NULL) \
60 { \
61 zend_throw_error(NULL, "Found unconstructed BreakIterator"); \
62 RETURN_THROWS(); \
63 }
64
65void breakiterator_object_create(zval *object, BreakIterator *break_iter, int brand_new);
66
68
70
73
75
76#endif /* #ifndef BREAKITERATOR_CLASS_H */
zend_class_entry * RuleBasedBreakIterator_ce_ptr
zend_class_entry * BreakIterator_ce_ptr
void breakiterator_object_create(zval *object, BreakIterator *break_iter, int brand_new)
void breakiterator_register_BreakIterator_class(void)
void BreakIterator
void breakiterator_object_construct(zval *object, BreakIterator *break_iter)
zend_object_handlers BreakIterator_handlers
struct _intl_error intl_error
struct _zval_struct zval
#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