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 
17 #ifndef RESOURCEBUNDLE_CLASS_H
18 #define RESOURCEBUNDLE_CLASS_H
19 
20 #include <unicode/ures.h>
21 
22 #include <zend.h>
23 #include "php.h"
24 
25 #include "intl_error.h"
26 
27 typedef struct {
28 	zend_object     zend;
29 	intl_error      error;
30 
31 	UResourceBundle *me;
32 	UResourceBundle *child;
33 } ResourceBundle_object;
34 
35 #define RESOURCEBUNDLE_METHOD_INIT_VARS		INTL_METHOD_INIT_VARS(ResourceBundle, rb)
36 #define RESOURCEBUNDLE_METHOD_FETCH_OBJECT_NO_CHECK	INTL_METHOD_FETCH_OBJECT(ResourceBundle, rb)
37 #define RESOURCEBUNDLE_METHOD_FETCH_OBJECT							\
38 	INTL_METHOD_FETCH_OBJECT(ResourceBundle, rb);					\
39 	if (RESOURCEBUNDLE_OBJECT(rb) == NULL) {						\
40 		intl_errors_set(&rb->error, U_ILLEGAL_ARGUMENT_ERROR,		\
41 				"Found unconstructed ResourceBundle", 0 TSRMLS_CC);	\
42 		RETURN_FALSE;												\
43 	}
44 
45 
46 #define RESOURCEBUNDLE_OBJECT(rb)			(rb)->me
47 
48 void resourcebundle_register_class( TSRMLS_D );
49 extern zend_class_entry *ResourceBundle_ce_ptr;
50 
51 PHP_FUNCTION( resourcebundle_create );
52 PHP_FUNCTION( resourcebundle_get );
53 PHP_FUNCTION( resourcebundle_count );
54 PHP_FUNCTION( resourcebundle_locales );
55 PHP_FUNCTION( resourcebundle_get_error_code );
56 PHP_FUNCTION( resourcebundle_get_error_message );
57 
58 #endif // #ifndef RESOURCEBUNDLE_CLASS_H
59