php-internal-docs
8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
mbfilter.h
Go to the documentation of this file.
1
/*
2
* "streamable kanji code filter and converter"
3
*
4
* Copyright (c) 1998,1999,2000,2001 HappySize, Inc. All rights reserved.
5
*
6
* This software is released under the GNU Lesser General Public License.
7
* (Version 2.1, February 1999)
8
* Please read the following detail of the licence (in japanese).
9
*
10
* ◆使用許諾条件◆
11
*
12
* このソフトウェアは株式会社ハッピーサイズによって開発されました。株式会社ハッ
13
* ピーサイズは、著作権法および万国著作権条約の定めにより、このソフトウェアに関
14
* するすべての権利を留保する権利を持ち、ここに行使します。株式会社ハッピーサイ
15
* ズは以下に明記した条件に従って、このソフトウェアを使用する排他的ではない権利
16
* をお客様に許諾します。何人たりとも、以下の条件に反してこのソフトウェアを使用
17
* することはできません。
18
*
19
* このソフトウェアを「GNU Lesser General Public License (Version 2.1, February
20
* 1999)」に示された条件で使用することを、全ての方に許諾します。「GNU Lesser
21
* General Public License」を満たさない使用には、株式会社ハッピーサイズから書面
22
* による許諾を得る必要があります。
23
*
24
* 「GNU Lesser General Public License」の全文は以下のウェブページから取得でき
25
* ます。「GNU Lesser General Public License」とは、これまでLibrary General
26
* Public Licenseと呼ばれていたものです。
27
* http://www.gnu.org/ --- GNUウェブサイト
28
* http://www.gnu.org/copyleft/lesser.html --- ライセンス文面
29
* このライセンスの内容がわからない方、守れない方には使用を許諾しません。
30
*
31
* しかしながら、当社とGNUプロジェクトとの特定の関係を示唆または主張するもので
32
* はありません。
33
*
34
* ◆保証内容◆
35
*
36
* このソフトウェアは、期待された動作・機能・性能を持つことを目標として設計され
37
* 開発されていますが、これを保証するものではありません。このソフトウェアは「こ
38
* のまま」の状態で提供されており、たとえばこのソフトウェアの有用性ないし特定の
39
* 目的に合致することといった、何らかの保証内容が、明示されたり暗黙に示されてい
40
* る場合であっても、その保証は無効です。このソフトウェアを使用した結果ないし使
41
* 用しなかった結果によって、直接あるいは間接に受けた身体的な傷害、財産上の損害
42
* 、データの損失あるいはその他の全ての損害については、その損害の可能性が使用者
43
* 、当社あるいは第三者によって警告されていた場合であっても、当社はその損害の賠
44
* 償および補填を行いません。この規定は他の全ての、書面上または書面に無い保証・
45
* 契約・規定に優先します。
46
*
47
* ◆著作権者の連絡先および使用条件についての問い合わせ先◆
48
*
49
* 〒102-0073
50
* 東京都千代田区九段北1-13-5日本地所第一ビル4F
51
* 株式会社ハッピーサイズ
52
* Phone: 03-3512-3655, Fax: 03-3512-3656
53
* Email: sales@happysize.co.jp
54
* Web: http://happysize.com/
55
*
56
* ◆著者◆
57
*
58
* 金本 茂 <sgk@happysize.co.jp>
59
*
60
* ◆履歴◆
61
*
62
* 1998/11/10 sgk implementation in C++
63
* 1999/4/25 sgk Cで書きなおし。
64
* 1999/4/26 sgk 入力フィルタを実装。漢字コードを推定しながらフィルタを追加。
65
* 1999/6/?? Unicodeサポート。
66
* 1999/6/22 sgk ライセンスをLGPLに変更。
67
*
68
*/
69
70
/*
71
* Unicode support
72
*
73
* Portions copyright (c) 1999,2000,2001 by the PHP3 internationalization team.
74
* All rights reserved.
75
*
76
*/
77
78
/*
79
*
80
* streamable kanji code filter and converter
81
* mbfl : Multi Byte FiLter Liblary
82
*
83
*/
84
85
#ifndef MBFL_MBFILTER_H
86
#define MBFL_MBFILTER_H
87
88
#include "
zend.h
"
89
90
#include "
mbfl_defs.h
"
91
#include "
mbfl_consts.h
"
92
#include "
mbfl_encoding.h
"
93
#include "
mbfl_language.h
"
94
#include "
mbfl_string.h
"
95
#include "
mbfl_convert.h
"
96
97
/* Prefer local fix, otherwise need to include too much. */
98
#ifndef ssize_t
99
#if defined(_WIN64)
100
#define ssize_t __int64
101
#elif defined(_WIN32)
102
#define ssize_t __int32
103
#elif defined(__GNUC__) && __GNUC__ >= 4
104
#define ssize_t long
105
#endif
106
#endif
107
108
/*
109
* version information
110
*/
111
#define MBFL_VERSION_MAJOR 1
112
#define MBFL_VERSION_MINOR 3
113
#define MBFL_VERSION_TEENY 2
114
115
#define MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE 0
116
#define MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR 1
117
#define MBFL_OUTPUTFILTER_ILLEGAL_MODE_LONG 2
118
#define MBFL_OUTPUTFILTER_ILLEGAL_MODE_ENTITY 3
119
#define MBFL_OUTPUTFILTER_ILLEGAL_MODE_BADUTF8 4
/* For internal use only; deliberately uses invalid UTF-8 byte sequence as error marker */
120
121
/*
122
* convenience macros
123
*/
124
#ifndef MIN
125
#define MIN(a,b) ((a)<(b)?(a):(b))
126
#endif
127
128
/* Lengths -1 through -16 are reserved for error return values */
129
static
inline
int
mbfl_is_error(
size_t
len
) {
130
return
len
>= (size_t) -16;
131
}
132
133
#define MBFL_ERROR_NOT_FOUND ((size_t) -1)
134
#define MBFL_ERROR_ENCODING ((size_t) -4)
135
#define MBFL_ERROR_EMPTY ((size_t) -8)
136
#define MBFL_ERROR_OFFSET ((size_t) -16)
137
138
/*
139
* If specified as length, the substr until the end of the string is taken.
140
*/
141
#define MBFL_SUBSTR_UNTIL_END ((size_t) -1)
142
143
/*
144
* strcut
145
*/
146
MBFLAPI
extern
mbfl_string
*
147
mbfl_strcut
(
mbfl_string
*
string
,
mbfl_string
*
result
,
size_t
from,
size_t
length);
148
149
#endif
/* MBFL_MBFILTER_H */
len
size_t len
Definition
apprentice.c:174
mbfl_strcut
MBFLAPI mbfl_string * mbfl_strcut(mbfl_string *string, mbfl_string *result, size_t from, size_t length)
Definition
mbfilter.c:100
mbfl_consts.h
mbfl_convert.h
mbfl_defs.h
MBFLAPI
#define MBFLAPI
Definition
mbfl_defs.h:56
mbfl_encoding.h
mbfl_language.h
mbfl_string.h
mbfl_string
struct _mbfl_string mbfl_string
zend.h
result
bool result
Definition
zend_vm_def.h:455
ext
mbstring
libmbfl
mbfl
mbfilter.h
Generated on Sat Aug 23 2025 01:46:09 for php-internal-docs by
1.13.2