Annotation of embedaddon/php/Zend/zend_multibyte.h, revision 1.1.1.1
1.1 misho 1: /*
2: +----------------------------------------------------------------------+
3: | Zend Engine |
4: +----------------------------------------------------------------------+
5: | Copyright (c) 1998-2012 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 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: zend_multibyte.h 321634 2012-01-01 13:15:04Z felipe $ */
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 size_t (*zend_encoding_filter)(unsigned char **str, size_t *str_length, const unsigned char *buf, size_t length TSRMLS_DC);
34:
35: typedef char* (*zend_encoding_detector)(const unsigned char *string, size_t length, char *list TSRMLS_DC);
36:
37: 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);
38:
39: typedef size_t (*zend_encoding_oddlen)(const unsigned char *string, size_t 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: zend_bool 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(const char *encoding_list,
55: size_t encoding_list_size TSRMLS_DC);
56: ZEND_API int zend_multibyte_set_internal_encoding(const char *encoding_name TSRMLS_DC);
57: ZEND_API int zend_multibyte_set_functions(zend_encoding_detector encoding_detector, zend_encoding_converter encoding_converter, zend_encoding_oddlen encoding_oddlen TSRMLS_DC);
58: ZEND_API int zend_multibyte_set_filter(zend_encoding *onetime_encoding TSRMLS_DC);
59: ZEND_API zend_encoding* zend_multibyte_fetch_encoding(const char *encoding_name);
60: ZEND_API size_t zend_multibyte_script_encoding_filter(unsigned char **to, size_t
61: *to_length, const unsigned char *from, size_t from_length TSRMLS_DC);
62: 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);
63:
64: /* in zend_language_scanner.l */
65: ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter, zend_encoding *old_encoding TSRMLS_DC);
66: ZEND_API int zend_multibyte_yyinput(zend_file_handle *file_handle, char *buf, size_t len TSRMLS_DC);
67: ZEND_API int zend_multibyte_read_script(unsigned char *buf, size_t n TSRMLS_DC);
68: END_EXTERN_C()
69:
70: #endif /* ZEND_MULTIBYTE */
71:
72: #endif /* ZEND_MULTIBYTE_H */
73:
74: /*
75: * Local variables:
76: * tab-width: 4
77: * c-basic-offset: 4
78: * End:
79: * vim600: sw=4 ts=4 tw=78
80: * vim<600: sw=4 ts=4 tw=78
81: */
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>