xref: /PHP-5.5/ext/intl/php_intl.h (revision 9762609c)
1 /*
2    +----------------------------------------------------------------------+
3    | PHP Version 5                                                        |
4    +----------------------------------------------------------------------+
5    | This source file is subject to version 3.01 of the PHP license,      |
6    | that is bundled with this package in the file LICENSE, and is        |
7    | available through the world-wide-web at the following url:           |
8    | http://www.php.net/license/3_01.txt                                  |
9    | If you did not receive a copy of the PHP license and are unable to   |
10    | obtain it through the world-wide-web, please send a note to          |
11    | license@php.net so we can mail you a copy immediately.               |
12    +----------------------------------------------------------------------+
13    | Authors: Vadim Savchuk <vsavchuk@productengine.com>                  |
14    |          Dmitry Lakhtyuk <dlakhtyuk@productengine.com>               |
15    |          Stanislav Malyshev <stas@zend.com>                          |
16    |          Kirti Velankar <kirtig@yahoo-inc.com>                       |
17    +----------------------------------------------------------------------+
18  */
19 
20 #ifndef PHP_INTL_H
21 #define PHP_INTL_H
22 
23 #include <php.h>
24 
25 /* Even if we're included from C++, don't introduce C++ definitions
26  * because we were included with extern "C". The effect would be that
27  * when the headers defined any method, they would do so with C linkage */
28 #undef U_SHOW_CPLUSPLUS_API
29 #define U_SHOW_CPLUSPLUS_API 0
30 #include "collator/collator_sort.h"
31 #include <unicode/ubrk.h>
32 #include "intl_error.h"
33 
34 extern zend_module_entry intl_module_entry;
35 #define phpext_intl_ptr &intl_module_entry
36 
37 #ifdef PHP_WIN32
38 #define PHP_INTL_API __declspec(dllexport)
39 #else
40 #define PHP_INTL_API
41 #endif
42 
43 #ifdef ZTS
44 #include "TSRM.h"
45 #endif
46 
47 ZEND_BEGIN_MODULE_GLOBALS(intl)
48 	zval* current_collator;
49 	char* default_locale;
50 	collator_compare_func_t compare_func;
51 	UBreakIterator* grapheme_iterator;
52 	intl_error g_error;
53 	long error_level;
54 	zend_bool use_exceptions;
55 ZEND_END_MODULE_GLOBALS(intl)
56 
57 /* Macro to access request-wide global variables. */
58 #ifdef ZTS
59 #define INTL_G(v) TSRMG(intl_globals_id, zend_intl_globals *, v)
60 #else
61 #define INTL_G(v) (intl_globals.v)
62 #endif
63 
64 ZEND_EXTERN_MODULE_GLOBALS(intl)
65 
66 PHP_MINIT_FUNCTION(intl);
67 PHP_MSHUTDOWN_FUNCTION(intl);
68 PHP_RINIT_FUNCTION(intl);
69 PHP_RSHUTDOWN_FUNCTION(intl);
70 PHP_MINFO_FUNCTION(intl);
71 
72 const char *intl_locale_get_default( TSRMLS_D );
73 
74 #define PHP_INTL_VERSION "1.1.0"
75 
76 #endif  /* PHP_INTL_H */
77 
78 /*
79  * Local variables:
80  * tab-width: 4
81  * c-basic-offset: 4
82  * End:
83  * vim600: noet sw=4 ts=4 fdm=marker
84  * vim<600: noet sw=4 ts=4
85  */
86