xref: /PHP-8.1/ext/intl/msgformat/msgformat_data.h (revision 01b3fc03)
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 MSG_FORMAT_DATA_H
16 #define MSG_FORMAT_DATA_H
17 
18 #include <php.h>
19 
20 #include "../intl_error.h"
21 
22 #include <unicode/umsg.h>
23 
24 typedef struct {
25 	// error hangling
26 	intl_error      error;
27 
28 	// formatter handling
29 	UMessageFormat* umsgf;
30 	char*			orig_format;
31 	zend_ulong		orig_format_len;
32 	HashTable*		arg_types;
33 	int				tz_set; /* if we've already the time zone in sub-formats */
34 } msgformat_data;
35 
36 msgformat_data* msgformat_data_create( void );
37 void msgformat_data_init( msgformat_data* mf_data );
38 void msgformat_data_free( msgformat_data* mf_data );
39 
40 #ifdef MSG_FORMAT_QUOTE_APOS
41 int msgformat_fix_quotes(UChar **spattern, uint32_t *spattern_len, UErrorCode *ec);
42 #endif
43 
44 #endif // MSG_FORMAT_DATA_H
45