Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 90 lines (72 sloc) 4.408 kB
ab9dcec @fujimoto - added script encoding support to Zend Engine 2.
fujimoto authored
1 /*
2 +----------------------------------------------------------------------+
3 | Zend Engine |
4 +----------------------------------------------------------------------+
d2281d1 sed -i "s#1998-2009#1998-2010#g" **/*.c **/*.h **/*.php
Sebastian Bergmann authored
5 | Copyright (c) 1998-2010 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
25 #define BOM_UTF32_BE "\x00\x00\xfe\xff"
26 #define BOM_UTF32_LE "\xff\xfe\x00\x00"
27 #define BOM_UTF16_BE "\xfe\xff"
28 #define BOM_UTF16_LE "\xff\xfe"
29 #define BOM_UTF8 "\xef\xbb\xbf"
30
4f42ed3 - Revived zend multibyte
Moriyoshi Koizumi authored
31 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
32
4f42ed3 - Revived zend multibyte
Moriyoshi Koizumi authored
33 typedef char* (*zend_encoding_detector)(const unsigned char *string, size_t length, char *list TSRMLS_DC);
ab9dcec @fujimoto - added script encoding support to Zend Engine 2.
fujimoto authored
34
4f42ed3 - Revived zend multibyte
Moriyoshi Koizumi authored
35 typedef int (*zend_encoding_converter)(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length, const char *encoding_to, const char *encoding_from TSRMLS_DC);
ab9dcec @fujimoto - added script encoding support to Zend Engine 2.
fujimoto authored
36
4f42ed3 - Revived zend multibyte
Moriyoshi Koizumi authored
37 typedef size_t (*zend_encoding_oddlen)(const unsigned char *string, size_t length, const char *encoding TSRMLS_DC);
ab9dcec @fujimoto - added script encoding support to Zend Engine 2.
fujimoto authored
38
755c2cd Removed compile time dependency from ext/mbstring
Dmitry Stogov authored
39 typedef int (*zend_encoding_list_checker)(const char *encoding_list TSRMLS_DC);
40
41 typedef const char* (*zend_encoding_name_getter)(TSRMLS_D);
42
ab9dcec @fujimoto - added script encoding support to Zend Engine 2.
fujimoto authored
43 typedef struct _zend_encoding {
44 zend_encoding_filter input_filter; /* escape input filter */
45 zend_encoding_filter output_filter; /* escape output filter */
46 const char *name; /* encoding name */
47 const char *(*aliases)[]; /* encoding name aliases */
4f42ed3 - Revived zend multibyte
Moriyoshi Koizumi authored
48 zend_bool compatible; /* flex compatible or not */
ab9dcec @fujimoto - added script encoding support to Zend Engine 2.
fujimoto authored
49 } zend_encoding;
50
51
52 /*
53 * zend multibyte APIs
54 */
55 BEGIN_EXTERN_C()
755c2cd Removed compile time dependency from ext/mbstring
Dmitry Stogov authored
56
57 /* multibyte utility functions */
58 ZEND_API extern zend_encoding_detector zend_multibyte_encoding_detector;
59 ZEND_API extern zend_encoding_converter zend_multibyte_encoding_converter;
60 ZEND_API extern zend_encoding_oddlen zend_multibyte_encoding_oddlen;
61 ZEND_API extern zend_encoding_list_checker zend_multibyte_check_encoding_list;
62 ZEND_API extern zend_encoding_name_getter zend_multibyte_get_internal_encoding;
63
4f42ed3 - Revived zend multibyte
Moriyoshi Koizumi authored
64 ZEND_API int zend_multibyte_set_script_encoding(const char *encoding_list,
65 size_t encoding_list_size TSRMLS_DC);
66 ZEND_API int zend_multibyte_set_internal_encoding(const char *encoding_name TSRMLS_DC);
755c2cd Removed compile time dependency from ext/mbstring
Dmitry Stogov authored
67 ZEND_API int zend_multibyte_set_functions(zend_encoding_detector encoding_detector, zend_encoding_converter encoding_converter, zend_encoding_oddlen encoding_oddlen, zend_encoding_list_checker encoding_list_checker, zend_encoding_name_getter get_internal_encoding TSRMLS_DC);
ab9dcec @fujimoto - added script encoding support to Zend Engine 2.
fujimoto authored
68 ZEND_API int zend_multibyte_set_filter(zend_encoding *onetime_encoding TSRMLS_DC);
4f42ed3 - Revived zend multibyte
Moriyoshi Koizumi authored
69 ZEND_API zend_encoding* zend_multibyte_fetch_encoding(const char *encoding_name);
70 ZEND_API size_t zend_multibyte_script_encoding_filter(unsigned char **to, size_t
71 *to_length, const unsigned char *from, size_t from_length TSRMLS_DC);
72 ZEND_API size_t zend_multibyte_internal_encoding_filter(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC);
ab9dcec @fujimoto - added script encoding support to Zend Engine 2.
fujimoto authored
73
74 /* in zend_language_scanner.l */
75 ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter, zend_encoding *old_encoding TSRMLS_DC);
76 ZEND_API int zend_multibyte_yyinput(zend_file_handle *file_handle, char *buf, size_t len TSRMLS_DC);
4f42ed3 - Revived zend multibyte
Moriyoshi Koizumi authored
77 ZEND_API int zend_multibyte_read_script(unsigned char *buf, size_t n TSRMLS_DC);
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.