php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
transliterator_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 TRANSLITERATOR_CLASS_H
16#define TRANSLITERATOR_CLASS_H
17
18#include <php.h>
19
20#include "intl_common.h"
21#include "intl_error.h"
22
23#include <unicode/utrans.h>
24
25typedef struct {
26 // error handling
28
29 // ICU transliterator
30 UTransliterator* utrans;
31
34
35static inline Transliterator_object *php_intl_transliterator_fetch_object(zend_object *obj) {
36 return (Transliterator_object *)((char*)(obj) - XtOffsetOf(Transliterator_object, zo));
37}
38#define Z_INTL_TRANSLITERATOR_P(zv) php_intl_transliterator_fetch_object(Z_OBJ_P(zv))
39
40#define TRANSLITERATOR_FORWARD UTRANS_FORWARD
41#define TRANSLITERATOR_REVERSE UTRANS_REVERSE
42
43#define TRANSLITERATOR_ERROR( co ) (co)->err
44#define TRANSLITERATOR_ERROR_P( co ) &(TRANSLITERATOR_ERROR( co ))
45
46#define TRANSLITERATOR_ERROR_CODE( co ) INTL_ERROR_CODE(TRANSLITERATOR_ERROR( co ))
47#define TRANSLITERATOR_ERROR_CODE_P( co ) &(INTL_ERROR_CODE(TRANSLITERATOR_ERROR( co )))
48
49#define TRANSLITERATOR_METHOD_INIT_VARS INTL_METHOD_INIT_VARS( Transliterator, to )
50#define TRANSLITERATOR_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT( INTL_TRANSLITERATOR, to )
51#define TRANSLITERATOR_METHOD_FETCH_OBJECT\
52 TRANSLITERATOR_METHOD_FETCH_OBJECT_NO_CHECK; \
53 if( to->utrans == NULL ) \
54 { \
55 zend_throw_error(NULL, "Found unconstructed transliterator"); \
56 RETURN_THROWS(); \
57 }
58
60 UTransliterator *utrans,
61 UErrorCode *status );
62
64
67
68#endif /* #ifndef TRANSLITERATOR_CLASS_H */
DNS_STATUS status
Definition dns_win32.c:49
struct _intl_error intl_error
zend_object_handlers Transliterator_handlers
zend_class_entry * Transliterator_ce_ptr
int transliterator_object_construct(zval *object, UTransliterator *utrans, UErrorCode *status)
void transliterator_register_Transliterator_class(void)
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