dateformat_class.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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: Kirti Velankar <kirtig@yahoo-inc.com> |
  14. +----------------------------------------------------------------------+
  15. */
  16. #ifndef DATE_FORMAT_CLASS_H
  17. #define DATE_FORMAT_CLASS_H
  18. #include <php.h>
  19. #include "intl_common.h"
  20. #include "intl_error.h"
  21. #include "intl_data.h"
  22. #include "dateformat_data.h"
  23. typedef struct {
  24. zend_object zo;
  25. dateformat_data datef_data;
  26. int date_type;
  27. int time_type;
  28. int calendar;
  29. char *requested_locale;
  30. } IntlDateFormatter_object;
  31. void dateformat_register_IntlDateFormatter_class( TSRMLS_D );
  32. extern zend_class_entry *IntlDateFormatter_ce_ptr;
  33. /* Auxiliary macros */
  34. #define DATE_FORMAT_METHOD_INIT_VARS INTL_METHOD_INIT_VARS(IntlDateFormatter, dfo)
  35. #define DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(IntlDateFormatter, dfo)
  36. #define DATE_FORMAT_METHOD_FETCH_OBJECT \
  37. DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK; \
  38. if (dfo->datef_data.udatf == NULL) \
  39. { \
  40. intl_errors_set(&dfo->datef_data.error, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlDateFormatter", 0 TSRMLS_CC); \
  41. RETURN_FALSE; \
  42. }
  43. #define DATE_FORMAT_OBJECT(dfo) (dfo)->datef_data.udatf
  44. #endif // #ifndef DATE_FORMAT_CLASS_H