resourcebundle_class.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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: Hans-Peter Oeri (University of St.Gallen) <hp@oeri.ch> |
  14. +----------------------------------------------------------------------+
  15. */
  16. #ifndef RESOURCEBUNDLE_CLASS_H
  17. #define RESOURCEBUNDLE_CLASS_H
  18. #include <unicode/ures.h>
  19. #include <zend.h>
  20. #include "php.h"
  21. #include "intl_error.h"
  22. typedef struct {
  23. zend_object zend;
  24. intl_error error;
  25. UResourceBundle *me;
  26. UResourceBundle *child;
  27. } ResourceBundle_object;
  28. #define RESOURCEBUNDLE_METHOD_INIT_VARS INTL_METHOD_INIT_VARS(ResourceBundle, rb)
  29. #define RESOURCEBUNDLE_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(ResourceBundle, rb)
  30. #define RESOURCEBUNDLE_METHOD_FETCH_OBJECT \
  31. INTL_METHOD_FETCH_OBJECT(ResourceBundle, rb); \
  32. if (RESOURCEBUNDLE_OBJECT(rb) == NULL) { \
  33. intl_errors_set(&rb->error, U_ILLEGAL_ARGUMENT_ERROR, \
  34. "Found unconstructed ResourceBundle", 0 TSRMLS_CC); \
  35. RETURN_FALSE; \
  36. }
  37. #define RESOURCEBUNDLE_OBJECT(rb) (rb)->me
  38. void resourcebundle_register_class( TSRMLS_D );
  39. extern zend_class_entry *ResourceBundle_ce_ptr;
  40. PHP_FUNCTION( resourcebundle_create );
  41. PHP_FUNCTION( resourcebundle_get );
  42. PHP_FUNCTION( resourcebundle_count );
  43. PHP_FUNCTION( resourcebundle_locales );
  44. PHP_FUNCTION( resourcebundle_get_error_code );
  45. PHP_FUNCTION( resourcebundle_get_error_message );
  46. #endif // #ifndef RESOURCEBUNDLE_CLASS_H