2 +----------------------------------------------------------------------+
4 +----------------------------------------------------------------------+
5 | Copyright (c) 1997-2014 The PHP Group |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
15 | Authors: Rui Hirokawa <rui_hirokawa@ybb.ne.jp> |
16 | Stig Bakken <ssb@php.net> |
17 +----------------------------------------------------------------------+
26 # ifdef PHP_ICONV_EXPORTS
27 # define PHP_ICONV_API __declspec(dllexport)
29 # define PHP_ICONV_API __declspec(dllimport)
31 #elif defined(__GNUC__) && __GNUC__ >= 4
32 # define PHP_ICONV_API __attribute__ ((visibility("default")))
34 # define PHP_ICONV_API
38 #include "ext/iconv/php_have_iconv.h"
39 #include "ext/iconv/php_have_libiconv.h"
40 #include "ext/iconv/php_iconv_aliased_libiconv.h"
41 #include "ext/iconv/php_have_glibc_iconv.h"
42 #include "ext/iconv/php_have_bsd_iconv.h"
43 #include "ext/iconv/php_have_ibm_iconv.h"
44 #include "ext/iconv/php_iconv_supports_errno.h"
45 #include "ext/iconv/php_php_iconv_impl.h"
46 #include "ext/iconv/php_php_iconv_h_path.h"
50 extern zend_module_entry iconv_module_entry
;
51 #define iconv_module_ptr &iconv_module_entry
53 PHP_MINIT_FUNCTION(miconv
);
54 PHP_MSHUTDOWN_FUNCTION(miconv
);
55 PHP_MINFO_FUNCTION(miconv
);
57 PHP_NAMED_FUNCTION(php_if_iconv
);
58 PHP_FUNCTION(ob_iconv_handler
);
59 PHP_FUNCTION(iconv_get_encoding
);
60 PHP_FUNCTION(iconv_set_encoding
);
61 PHP_FUNCTION(iconv_strlen
);
62 PHP_FUNCTION(iconv_substr
);
63 PHP_FUNCTION(iconv_strpos
);
64 PHP_FUNCTION(iconv_strrpos
);
65 PHP_FUNCTION(iconv_mime_encode
);
66 PHP_FUNCTION(iconv_mime_decode
);
67 PHP_FUNCTION(iconv_mime_decode_headers
);
69 ZEND_BEGIN_MODULE_GLOBALS(iconv
)
71 char *internal_encoding
;
72 char *output_encoding
;
73 ZEND_END_MODULE_GLOBALS(iconv
)
76 # define ICONVG(v) TSRMG(iconv_globals_id, zend_iconv_globals *, v)
78 # define ICONVG(v) (iconv_globals.v)
82 # define ICONV_INPUT_ENCODING "ISO8859-1"
83 # define ICONV_OUTPUT_ENCODING "ISO8859-1"
84 # define ICONV_INTERNAL_ENCODING "ISO8859-1"
85 # define ICONV_ASCII_ENCODING "IBM-850"
86 # define ICONV_UCS4_ENCODING "UCS-4"
88 # define ICONV_INPUT_ENCODING "ISO-8859-1"
89 # define ICONV_OUTPUT_ENCODING "ISO-8859-1"
90 # define ICONV_INTERNAL_ENCODING "ISO-8859-1"
91 # define ICONV_ASCII_ENCODING "ASCII"
92 # define ICONV_UCS4_ENCODING "UCS-4LE"
95 #ifndef ICONV_CSNMAXLEN
96 #define ICONV_CSNMAXLEN 64
99 /* {{{ typedef enum php_iconv_err_t */
100 typedef enum _php_iconv_err_t
{
101 PHP_ICONV_ERR_SUCCESS
= SUCCESS
,
102 PHP_ICONV_ERR_CONVERTER
= 1,
103 PHP_ICONV_ERR_WRONG_CHARSET
= 2,
104 PHP_ICONV_ERR_TOO_BIG
= 3,
105 PHP_ICONV_ERR_ILLEGAL_SEQ
= 4,
106 PHP_ICONV_ERR_ILLEGAL_CHAR
= 5,
107 PHP_ICONV_ERR_UNKNOWN
= 6,
108 PHP_ICONV_ERR_MALFORMED
= 7,
109 PHP_ICONV_ERR_ALLOC
= 8
113 PHP_ICONV_API php_iconv_err_t
php_iconv_string(const char * in_p
, size_t in_len
, char **out
, size_t *out_len
, const char *out_charset
, const char *in_charset
);
117 #define iconv_module_ptr NULL
119 #endif /* HAVE_ICONV */
121 #define phpext_iconv_ptr iconv_module_ptr
123 #endif /* PHP_ICONV_H */