Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 80 lines (64 sloc) 3.641 kB
ab9dcec @fujimoto - added script encoding support to Zend Engine 2.
fujimoto authored
1 /*
2 +----------------------------------------------------------------------+
3 | Zend Engine |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 1998-2003 Zend Technologies Ltd. (http://www.zend.com) |
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 |
9 | available at through the world-wide-web at |
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 #ifdef ZEND_MULTIBYTE
26
27 #define BOM_UTF32_BE "\x00\x00\xfe\xff"
28 #define BOM_UTF32_LE "\xff\xfe\x00\x00"
29 #define BOM_UTF16_BE "\xfe\xff"
30 #define BOM_UTF16_LE "\xff\xfe"
31 #define BOM_UTF8 "\xef\xbb\xbf"
32
33 typedef int (*zend_encoding_filter)(char **str, int *str_length, const char *buf, int length TSRMLS_DC);
34
35 typedef char* (*zend_encoding_detector)(const char *string, int length, char *list TSRMLS_DC);
36
37 typedef int (*zend_encoding_converter)(char **to, int *to_length, const char *from, int from_length, const char *encoding_to, const char *encoding_from TSRMLS_DC);
38
39 typedef int (*zend_encoding_oddlen)(const char *string, int length, const char *encoding TSRMLS_DC);
40
41 typedef struct _zend_encoding {
42 zend_encoding_filter input_filter; /* escape input filter */
43 zend_encoding_filter output_filter; /* escape output filter */
44 const char *name; /* encoding name */
45 const char *(*aliases)[]; /* encoding name aliases */
46 int compatible; /* flex compatible or not */
47 } zend_encoding;
48
49
50 /*
51 * zend multibyte APIs
52 */
53 BEGIN_EXTERN_C()
54 ZEND_API int zend_multibyte_set_script_encoding(char *encoding_list, int encoding_list_size TSRMLS_DC);
55 ZEND_API int zend_multibyte_set_internal_encoding(char *encoding_name, int encoding_name_size TSRMLS_DC);
56 ZEND_API int zend_multibyte_set_functions(zend_encoding_detector encoding_detector, zend_encoding_converter encoding_converter, zend_encoding_oddlen encoding_oddlen TSRMLS_DC);
57 ZEND_API int zend_multibyte_set_filter(zend_encoding *onetime_encoding TSRMLS_DC);
58 ZEND_API zend_encoding* zend_multibyte_fetch_encoding(char *encoding_name);
59 ZEND_API int zend_multibyte_script_encoding_filter(char **to, int *to_length, const char *from, int from_length TSRMLS_DC);
60 ZEND_API int zend_multibyte_internal_encoding_filter(char **to, int *to_length, const char *from, int from_length TSRMLS_DC);
61
62 /* in zend_language_scanner.l */
63 ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter, zend_encoding *old_encoding TSRMLS_DC);
64 ZEND_API int zend_multibyte_yyinput(zend_file_handle *file_handle, char *buf, size_t len TSRMLS_DC);
65 ZEND_API int zend_multibyte_read_script(TSRMLS_D);
66 END_EXTERN_C()
67
68 #endif /* ZEND_MULTIBYTE */
69
70 #endif /* ZEND_MULTIBYTE_H */
71
72 /*
73 * Local variables:
74 * tab-width: 4
75 * c-basic-offset: 4
76 * End:
77 * vim600: sw=4 ts=4 tw=78
78 * vim<600: sw=4 ts=4 tw=78
79 */
Something went wrong with that request. Please try again.