php_intl.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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: Vadim Savchuk <vsavchuk@productengine.com> |
  12. | Dmitry Lakhtyuk <dlakhtyuk@productengine.com> |
  13. | Stanislav Malyshev <stas@zend.com> |
  14. | Kirti Velankar <kirtig@yahoo-inc.com> |
  15. +----------------------------------------------------------------------+
  16. */
  17. #ifndef PHP_INTL_H
  18. #define PHP_INTL_H
  19. #include <php.h>
  20. /* Even if we're included from C++, don't introduce C++ definitions
  21. * because we were included with extern "C". The effect would be that
  22. * when the headers defined any method, they would do so with C linkage */
  23. #undef U_SHOW_CPLUSPLUS_API
  24. #define U_SHOW_CPLUSPLUS_API 0
  25. #include "collator/collator_sort.h"
  26. #include <unicode/ubrk.h>
  27. #include "intl_error.h"
  28. #include "Zend/zend_exceptions.h"
  29. extern zend_module_entry intl_module_entry;
  30. #define phpext_intl_ptr &intl_module_entry
  31. #ifdef PHP_WIN32
  32. #define PHP_INTL_API __declspec(dllexport)
  33. #else
  34. #define PHP_INTL_API
  35. #endif
  36. #ifdef ZTS
  37. #include "TSRM.h"
  38. #endif
  39. ZEND_BEGIN_MODULE_GLOBALS(intl)
  40. struct UCollator *current_collator;
  41. char* default_locale;
  42. collator_compare_func_t compare_func;
  43. UBreakIterator* grapheme_iterator;
  44. intl_error g_error;
  45. zend_long error_level;
  46. bool use_exceptions;
  47. ZEND_END_MODULE_GLOBALS(intl)
  48. #if defined(ZTS) && defined(COMPILE_DL_INTL)
  49. ZEND_TSRMLS_CACHE_EXTERN()
  50. #endif
  51. ZEND_EXTERN_MODULE_GLOBALS(intl)
  52. /* Macro to access request-wide global variables. */
  53. #define INTL_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(intl, v)
  54. PHP_MINIT_FUNCTION(intl);
  55. PHP_MSHUTDOWN_FUNCTION(intl);
  56. PHP_RINIT_FUNCTION(intl);
  57. PHP_RSHUTDOWN_FUNCTION(intl);
  58. PHP_MINFO_FUNCTION(intl);
  59. const char *intl_locale_get_default( void );
  60. #define PHP_INTL_VERSION PHP_VERSION
  61. #endif /* PHP_INTL_H */