Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 90 lines (75 sloc) 5.105 kb
ab9dcec @fujimoto - added script encoding support to Zend Engine 2.
fujimoto authored
1 /*
2 +----------------------------------------------------------------------+
3 | Zend Engine |
4 +----------------------------------------------------------------------+
8775a37 @felipensp - Year++
felipensp authored
5 | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
ab9dcec @fujimoto - added script encoding support to Zend Engine 2.
fujimoto authored
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 2.00 of the Zend license, |
8 | that is bundled with this package in the file LICENSE, and is |
62b9a73 MFH: oops
foobar authored
9 | available through the world-wide-web at |
ab9dcec @fujimoto - added script encoding support to Zend Engine 2.
fujimoto authored
10 | http://www.zend.com/license/2_00.txt. |
11 | If you did not receive a copy of the Zend license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@zend.com so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
15 | Authors: Masaki Fujimoto <fujimoto@php.net> |
16 | Rui Hirokawa <hirokawa@php.net> |
17 +----------------------------------------------------------------------+
18 */
19
20 /* $Id$ */
21
22 #ifndef ZEND_MULTIBYTE_H
23 #define ZEND_MULTIBYTE_H
24
bbf3d43 * Refactor zend_multibyte facility.
Moriyoshi Koizumi authored
25 typedef struct _zend_encoding zend_encoding;
ab9dcec @fujimoto - added script encoding support to Zend Engine 2.
fujimoto authored
26
4f42ed3 - Revived zend multibyte
Moriyoshi Koizumi authored
27 typedef size_t (*zend_encoding_filter)(unsigned char **str, size_t *str_length, const unsigned char *buf, size_t length TSRMLS_DC);
ab9dcec @fujimoto - added script encoding support to Zend Engine 2.
fujimoto authored
28
bbf3d43 * Refactor zend_multibyte facility.
Moriyoshi Koizumi authored
29 typedef const zend_encoding* (*zend_encoding_fetcher)(const char *encoding_name TSRMLS_DC);
30 typedef const char* (*zend_encoding_name_getter)(const zend_encoding *encoding);
31 typedef int (*zend_encoding_lexer_compatibility_checker)(const zend_encoding *encoding);
32 typedef const zend_encoding *(*zend_encoding_detector)(const unsigned char *string, size_t length, const zend_encoding **list, size_t list_size TSRMLS_DC);
33 typedef size_t (*zend_encoding_converter)(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length, const zend_encoding *encoding_to, const zend_encoding *encoding_from TSRMLS_DC);
34 typedef int (*zend_encoding_list_parser)(const char *encoding_list, size_t encoding_list_len, const zend_encoding ***return_list, size_t *return_size, int persistent TSRMLS_DC);
35 typedef const zend_encoding *(*zend_encoding_internal_encoding_getter)(TSRMLS_D);
36 typedef int (*zend_encoding_internal_encoding_setter)(const zend_encoding *encoding TSRMLS_DC);
37
38 typedef struct _zend_multibyte_functions {
39 const char *provider_name;
40 zend_encoding_fetcher encoding_fetcher;
41 zend_encoding_name_getter encoding_name_getter;
42 zend_encoding_lexer_compatibility_checker lexer_compatibility_checker;
43 zend_encoding_detector encoding_detector;
44 zend_encoding_converter encoding_converter;
45 zend_encoding_list_parser encoding_list_parser;
46 zend_encoding_internal_encoding_getter internal_encoding_getter;
47 zend_encoding_internal_encoding_setter internal_encoding_setter;
48 } zend_multibyte_functions;
ab9dcec @fujimoto - added script encoding support to Zend Engine 2.
fujimoto authored
49
50 /*
51 * zend multibyte APIs
52 */
53 BEGIN_EXTERN_C()
755c2cd Removed compile time dependency from ext/mbstring
Dmitry Stogov authored
54
bbf3d43 * Refactor zend_multibyte facility.
Moriyoshi Koizumi authored
55 ZEND_API extern const zend_encoding *zend_multibyte_encoding_utf32be;
56 ZEND_API extern const zend_encoding *zend_multibyte_encoding_utf32le;
57 ZEND_API extern const zend_encoding *zend_multibyte_encoding_utf16be;
58 ZEND_API extern const zend_encoding *zend_multibyte_encoding_utf16le;
59 ZEND_API extern const zend_encoding *zend_multibyte_encoding_utf8;
755c2cd Removed compile time dependency from ext/mbstring
Dmitry Stogov authored
60
bbf3d43 * Refactor zend_multibyte facility.
Moriyoshi Koizumi authored
61 /* multibyte utility functions */
62 ZEND_API int zend_multibyte_set_functions(const zend_multibyte_functions *functions TSRMLS_DC);
63 ZEND_API const zend_multibyte_functions *zend_multibyte_get_functions(TSRMLS_D);
64
65 ZEND_API const zend_encoding *zend_multibyte_fetch_encoding(const char *name TSRMLS_DC);
66 ZEND_API const char *zend_multibyte_get_encoding_name(const zend_encoding *encoding);
67 ZEND_API int zend_multibyte_check_lexer_compatibility(const zend_encoding *encoding);
68 ZEND_API const zend_encoding *zend_multibyte_encoding_detector(const unsigned char *string, size_t length, const zend_encoding **list, size_t list_size TSRMLS_DC);
69 ZEND_API size_t zend_multibyte_encoding_converter(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length, const zend_encoding *encoding_to, const zend_encoding *encoding_from TSRMLS_DC);
70 ZEND_API int zend_multibyte_parse_encoding_list(const char *encoding_list, size_t encoding_list_len, const zend_encoding ***return_list, size_t *return_size, int persistent TSRMLS_DC);
71
72 ZEND_API const zend_encoding *zend_multibyte_get_internal_encoding(TSRMLS_D);
73 ZEND_API const zend_encoding *zend_multibyte_get_script_encoding(TSRMLS_D);
74 ZEND_API int zend_multibyte_set_script_encoding(const zend_encoding **encoding_list, size_t encoding_list_size TSRMLS_DC);
75 ZEND_API int zend_multibyte_set_internal_encoding(const zend_encoding *encoding TSRMLS_DC);
76 ZEND_API int zend_multibyte_set_script_encoding_by_string(const char *new_value, size_t new_value_length TSRMLS_DC);
77
ab9dcec @fujimoto - added script encoding support to Zend Engine 2.
fujimoto authored
78 END_EXTERN_C()
79
80 #endif /* ZEND_MULTIBYTE_H */
81
82 /*
83 * Local variables:
84 * tab-width: 4
85 * c-basic-offset: 4
86 * End:
87 * vim600: sw=4 ts=4 tw=78
88 * vim<600: sw=4 ts=4 tw=78
89 */
Something went wrong with that request. Please try again.