php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
formatter_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: Stanislav Malyshev <stas@zend.com> |
12 +----------------------------------------------------------------------+
13 */
14
15#ifndef FORMATTER_CLASS_H
16#define FORMATTER_CLASS_H
17
18#include <php.h>
19
20#include "intl_common.h"
21#include "intl_error.h"
22#include "intl_data.h"
23#include "formatter_data.h"
24
29
30static inline NumberFormatter_object *php_intl_number_format_fetch_object(zend_object *obj) {
31 return (NumberFormatter_object *)((char*)(obj) - XtOffsetOf(NumberFormatter_object, zo));
32}
33#define Z_INTL_NUMBERFORMATTER_P(zv) php_intl_number_format_fetch_object(Z_OBJ_P(zv))
34
35void formatter_register_class( void );
37
38/* Auxiliary macros */
39
40#define FORMATTER_METHOD_INIT_VARS INTL_METHOD_INIT_VARS(NumberFormatter, nfo)
41#define FORMATTER_OBJECT(nfo) (nfo)->nf_data.unum
42#define FORMATTER_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(INTL_NUMBERFORMATTER, nfo)
43#define FORMATTER_METHOD_FETCH_OBJECT \
44 FORMATTER_METHOD_FETCH_OBJECT_NO_CHECK; \
45 if (FORMATTER_OBJECT(nfo) == NULL) \
46 { \
47 zend_throw_error(NULL, "Found unconstructed NumberFormatter"); \
48 RETURN_THROWS(); \
49 }
50
51
52#endif // #ifndef FORMATTER_CLASS_H
zend_class_entry * NumberFormatter_ce_ptr
void formatter_register_class(void)
#define XtOffsetOf(s_type, field)
struct _zend_class_entry zend_class_entry
struct _zend_object zend_object