msgformat_class.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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: Stanislav Malyshev <stas@zend.com> |
  14. +----------------------------------------------------------------------+
  15. */
  16. #ifndef MSG_FORMAT_CLASS_H
  17. #define MSG_FORMAT_CLASS_H
  18. #include <php.h>
  19. #include <unicode/uconfig.h>
  20. #include "../intl_common.h"
  21. #include "../intl_error.h"
  22. #include "../intl_data.h"
  23. #include "msgformat_data.h"
  24. typedef struct {
  25. zend_object zo;
  26. msgformat_data mf_data;
  27. } MessageFormatter_object;
  28. void msgformat_register_class( TSRMLS_D );
  29. extern zend_class_entry *MessageFormatter_ce_ptr;
  30. /* Auxiliary macros */
  31. #define MSG_FORMAT_METHOD_INIT_VARS INTL_METHOD_INIT_VARS(MessageFormatter, mfo)
  32. #define MSG_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(MessageFormatter, mfo)
  33. #define MSG_FORMAT_METHOD_FETCH_OBJECT \
  34. MSG_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK; \
  35. if (MSG_FORMAT_OBJECT(mfo) == NULL) { \
  36. intl_errors_set(&mfo->mf_data.error, U_ILLEGAL_ARGUMENT_ERROR, \
  37. "Found unconstructed MessageFormatter", 0 TSRMLS_CC); \
  38. RETURN_FALSE; \
  39. }
  40. #define MSG_FORMAT_OBJECT(mfo) (mfo)->mf_data.umsgf
  41. #if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM < 48
  42. # define MSG_FORMAT_QUOTE_APOS 1
  43. #endif
  44. #endif // #ifndef MSG_FORMAT_CLASS_H