Файловый менеджер - Редактировать - /home/skymarketplace/public_html/uploads/libmbfl.tar
Назад
config.h 0000644 00000000030 15004441325 0006151 0 ustar 00 #include "php_config.h" mbfl/eaw_table.h 0000644 00000002651 15004441325 0007562 0 ustar 00 /* East Asian Width table * * Some characters in East Asian languages are intended to be displayed in a space * which is roughly square. (This contrasts with others such as the Latin alphabet, * which are taller than they are wide.) To display these East Asian characters * properly, twice the horizontal space is used. This must be taken into account * when doing things like wrapping text to a specific width. * * Each pair of numbers in the below table is a range of Unicode codepoints * which should be displayed as double-width. */ static const struct { int begin; int end; } mbfl_eaw_table[] = { { 0x1100, 0x115f }, { 0x11a3, 0x11a7 }, { 0x11fa, 0x11ff }, { 0x2329, 0x232a }, { 0x2e80, 0x2e99 }, { 0x2e9b, 0x2ef3 }, { 0x2f00, 0x2fd5 }, { 0x2ff0, 0x2ffb }, { 0x3000, 0x303e }, { 0x3041, 0x3096 }, { 0x3099, 0x30ff }, { 0x3105, 0x312d }, { 0x3131, 0x318e }, { 0x3190, 0x31ba }, { 0x31c0, 0x31e3 }, { 0x31f0, 0x321e }, { 0x3220, 0x3247 }, { 0x3250, 0x32fe }, { 0x3300, 0x4dbf }, { 0x4e00, 0xa48c }, { 0xa490, 0xa4c6 }, { 0xa960, 0xa97c }, { 0xac00, 0xd7a3 }, { 0xd7b0, 0xd7c6 }, { 0xd7cb, 0xd7fb }, { 0xf900, 0xfaff }, { 0xfe10, 0xfe19 }, { 0xfe30, 0xfe52 }, { 0xfe54, 0xfe66 }, { 0xfe68, 0xfe6b }, { 0xff01, 0xff60 }, { 0xffe0, 0xffe6 }, { 0x1b000, 0x1b001 }, { 0x1f200, 0x1f202 }, { 0x1f210, 0x1f23a }, { 0x1f240, 0x1f248 }, { 0x1f250, 0x1f251 }, { 0x20000, 0x2fffd }, { 0x30000, 0x3fffd } }; mbfl/mbfilter.h 0000644 00000023254 15004441325 0007445 0 ustar 00 /* * "streamable kanji code filter and converter" * * Copyright (c) 1998,1999,2000,2001 HappySize, Inc. All rights reserved. * * This software is released under the GNU Lesser General Public License. * (Version 2.1, February 1999) * Please read the following detail of the licence (in japanese). * * ◆使用許諾条件◆ * * このソフトウェアは株式会社ハッピーサイズによって開発されました。株式会社ハッ * ピーサイズは、著作権法および万国著作権条約の定めにより、このソフトウェアに関 * するすべての権利を留保する権利を持ち、ここに行使します。株式会社ハッピーサイ * ズは以下に明記した条件に従って、このソフトウェアを使用する排他的ではない権利 * をお客様に許諾します。何人たりとも、以下の条件に反してこのソフトウェアを使用 * することはできません。 * * このソフトウェアを「GNU Lesser General Public License (Version 2.1, February * 1999)」に示された条件で使用することを、全ての方に許諾します。「GNU Lesser * General Public License」を満たさない使用には、株式会社ハッピーサイズから書面 * による許諾を得る必要があります。 * * 「GNU Lesser General Public License」の全文は以下のウェブページから取得でき * ます。「GNU Lesser General Public License」とは、これまでLibrary General * Public Licenseと呼ばれていたものです。 * http://www.gnu.org/ --- GNUウェブサイト * http://www.gnu.org/copyleft/lesser.html --- ライセンス文面 * このライセンスの内容がわからない方、守れない方には使用を許諾しません。 * * しかしながら、当社とGNUプロジェクトとの特定の関係を示唆または主張するもので * はありません。 * * ◆保証内容◆ * * このソフトウェアは、期待された動作・機能・性能を持つことを目標として設計され * 開発されていますが、これを保証するものではありません。このソフトウェアは「こ * のまま」の状態で提供されており、たとえばこのソフトウェアの有用性ないし特定の * 目的に合致することといった、何らかの保証内容が、明示されたり暗黙に示されてい * る場合であっても、その保証は無効です。このソフトウェアを使用した結果ないし使 * 用しなかった結果によって、直接あるいは間接に受けた身体的な傷害、財産上の損害 * 、データの損失あるいはその他の全ての損害については、その損害の可能性が使用者 * 、当社あるいは第三者によって警告されていた場合であっても、当社はその損害の賠 * 償および補填を行いません。この規定は他の全ての、書面上または書面に無い保証・ * 契約・規定に優先します。 * * ◆著作権者の連絡先および使用条件についての問い合わせ先◆ * * 〒102-0073 * 東京都千代田区九段北1-13-5日本地所第一ビル4F * 株式会社ハッピーサイズ * Phone: 03-3512-3655, Fax: 03-3512-3656 * Email: sales@happysize.co.jp * Web: http://happysize.com/ * * ◆著者◆ * * 金本 茂 <sgk@happysize.co.jp> * * ◆履歴◆ * * 1998/11/10 sgk implementation in C++ * 1999/4/25 sgk Cで書きなおし。 * 1999/4/26 sgk 入力フィルタを実装。漢字コードを推定しながらフィルタを追加。 * 1999/6/?? Unicodeサポート。 * 1999/6/22 sgk ライセンスをLGPLに変更。 * */ /* * Unicode support * * Portions copyright (c) 1999,2000,2001 by the PHP3 internationalization team. * All rights reserved. * */ /* * * streamable kanji code filter and converter * mbfl : Multi Byte FiLter Liblary * */ #ifndef MBFL_MBFILTER_H #define MBFL_MBFILTER_H #include "zend.h" #include "mbfl_defs.h" #include "mbfl_consts.h" #include "mbfl_encoding.h" #include "mbfl_language.h" #include "mbfl_string.h" #include "mbfl_convert.h" #include "mbfl_ident.h" /* Prefer local fix, otherwise need to include too much. */ #ifndef ssize_t #if defined(_WIN64) #define ssize_t __int64 #elif defined(_WIN32) #define ssize_t __int32 #elif defined(__GNUC__) && __GNUC__ >= 4 #define ssize_t long #endif #endif /* * version information */ #define MBFL_VERSION_MAJOR 1 #define MBFL_VERSION_MINOR 3 #define MBFL_VERSION_TEENY 2 /* * convert filter */ #define MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE 0 #define MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR 1 #define MBFL_OUTPUTFILTER_ILLEGAL_MODE_LONG 2 #define MBFL_OUTPUTFILTER_ILLEGAL_MODE_ENTITY 3 /* * convenience macros */ #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif /* * buffering converter */ typedef struct _mbfl_buffer_converter mbfl_buffer_converter; struct _mbfl_buffer_converter { mbfl_convert_filter *filter1; mbfl_convert_filter *filter2; mbfl_memory_device device; const mbfl_encoding *to; }; MBFLAPI extern mbfl_buffer_converter * mbfl_buffer_converter_new(const mbfl_encoding *from, const mbfl_encoding *to, size_t buf_initsz); MBFLAPI extern void mbfl_buffer_converter_delete(mbfl_buffer_converter *convd); MBFLAPI extern int mbfl_buffer_converter_illegal_mode(mbfl_buffer_converter *convd, int mode); MBFLAPI extern int mbfl_buffer_converter_illegal_substchar(mbfl_buffer_converter *convd, int substchar); MBFLAPI extern size_t mbfl_buffer_converter_feed(mbfl_buffer_converter *convd, mbfl_string *string); MBFLAPI extern int mbfl_buffer_converter_flush(mbfl_buffer_converter *convd); MBFLAPI extern mbfl_string * mbfl_buffer_converter_result(mbfl_buffer_converter *convd, mbfl_string *result); MBFLAPI extern mbfl_string * mbfl_buffer_converter_feed_result(mbfl_buffer_converter *convd, mbfl_string *string, mbfl_string *result); MBFLAPI extern size_t mbfl_buffer_illegalchars(mbfl_buffer_converter *convd); /* * encoding detector */ typedef struct _mbfl_encoding_detector mbfl_encoding_detector; struct _mbfl_encoding_detector { mbfl_identify_filter **filter_list; int filter_list_size; int strict; }; MBFLAPI extern mbfl_encoding_detector * mbfl_encoding_detector_new(const mbfl_encoding **elist, int elistsz, int strict); MBFLAPI extern void mbfl_encoding_detector_delete(mbfl_encoding_detector *identd); MBFLAPI extern int mbfl_encoding_detector_feed(mbfl_encoding_detector *identd, mbfl_string *string); MBFLAPI extern const mbfl_encoding *mbfl_encoding_detector_judge(mbfl_encoding_detector *identd); /* * encoding converter */ MBFLAPI extern mbfl_string * mbfl_convert_encoding(mbfl_string *string, mbfl_string *result, const mbfl_encoding *toenc); /* * identify encoding */ MBFLAPI extern const mbfl_encoding * mbfl_identify_encoding(mbfl_string *string, const mbfl_encoding **elist, int elistsz, int strict); /* Lengths -1 through -16 are reserved for error return values */ static inline int mbfl_is_error(size_t len) { return len >= (size_t) -16; } /* * strlen */ MBFLAPI extern size_t mbfl_strlen(const mbfl_string *string); #define MBFL_ERROR_NOT_FOUND ((size_t) -1) #define MBFL_ERROR_ENCODING ((size_t) -4) #define MBFL_ERROR_EMPTY ((size_t) -8) #define MBFL_ERROR_OFFSET ((size_t) -16) /* * strpos. * Errors: MBFL_ERROR_NOT_FOUND, MBFL_ERROR_ENCODING, MBFL_ERROR_OFFSET */ MBFLAPI extern size_t mbfl_strpos(mbfl_string *haystack, mbfl_string *needle, ssize_t offset, int reverse); /* * substr_count */ MBFLAPI extern size_t mbfl_substr_count(mbfl_string *haystack, mbfl_string *needle); /* * If specified as length, the substr until the end of the string is taken. */ #define MBFL_SUBSTR_UNTIL_END ((size_t) -1) /* * substr */ MBFLAPI extern mbfl_string * mbfl_substr(mbfl_string *string, mbfl_string *result, size_t from, size_t length); /* * strcut */ MBFLAPI extern mbfl_string * mbfl_strcut(mbfl_string *string, mbfl_string *result, size_t from, size_t length); /* * strwidth */ MBFLAPI extern size_t mbfl_strwidth(mbfl_string *string); /* * strimwidth */ MBFLAPI extern mbfl_string * mbfl_strimwidth(mbfl_string *string, mbfl_string *marker, mbfl_string *result, size_t from, size_t width); /* * MIME header encode */ struct mime_header_encoder_data; /* forward declaration */ MBFLAPI extern struct mime_header_encoder_data * mime_header_encoder_new( const mbfl_encoding *incode, const mbfl_encoding *outcode, const mbfl_encoding *encoding); MBFLAPI extern void mime_header_encoder_delete(struct mime_header_encoder_data *pe); MBFLAPI extern mbfl_string * mime_header_encoder_result(struct mime_header_encoder_data *pe, mbfl_string *result); MBFLAPI extern mbfl_string * mbfl_mime_header_encode( mbfl_string *string, mbfl_string *result, const mbfl_encoding *outcode, const mbfl_encoding *encoding, const char *linefeed, int indent); /* * MIME header decode */ struct mime_header_decoder_data; /* forward declaration */ MBFLAPI extern struct mime_header_decoder_data * mime_header_decoder_new(const mbfl_encoding *outcode); MBFLAPI extern void mime_header_decoder_delete(struct mime_header_decoder_data *pd); MBFLAPI extern mbfl_string * mime_header_decoder_result(struct mime_header_decoder_data *pd, mbfl_string *result); MBFLAPI extern mbfl_string * mbfl_mime_header_decode( mbfl_string *string, mbfl_string *result, const mbfl_encoding *outcode); /* * convert HTML numeric entity */ MBFLAPI extern mbfl_string * mbfl_html_numeric_entity(mbfl_string *string, mbfl_string *result, int *convmap, int mapsize, int type); /* * convert of harfwidth and fullwidth for japanese */ MBFLAPI extern mbfl_string * mbfl_ja_jp_hantozen(mbfl_string *string, mbfl_string *result, int mode); #endif /* MBFL_MBFILTER_H */ mbfl/mbfilter_8bit.h 0000644 00000002410 15004441325 0010362 0 ustar 00 /* * "streamable kanji code filter and converter" * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. * * LICENSE NOTICES * * This file is part of "streamable kanji code filter and converter", * which is distributed under the terms of GNU Lesser General Public * License (version 2) as published by the Free Software Foundation. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with "streamable kanji code filter and converter"; * if not, write to the Free Software Foundation, Inc., 59 Temple Place, * Suite 330, Boston, MA 02111-1307 USA * * The author of this file: * */ /* * The source code included in this files was separated from mbfilter.c * by Moriyoshi Koizumi <moriyoshi@php.net> on 20 Dec 2002. The file * mbfilter.c is included in this package . * */ #ifndef MBFL_MBFILTER_8BIT_H #define MBFL_MBFILTER_8BIT_H #include "mbfl_defs.h" #include "mbfilter.h" MBFLAPI extern const mbfl_encoding mbfl_encoding_8bit; #endif /* MBFL_MBFILTER_8BIT_H */ mbfl/mbfilter_pass.h 0000644 00000002530 15004441325 0010465 0 ustar 00 /* * "streamable kanji code filter and converter" * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. * * LICENSE NOTICES * * This file is part of "streamable kanji code filter and converter", * which is distributed under the terms of GNU Lesser General Public * License (version 2) as published by the Free Software Foundation. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with "streamable kanji code filter and converter"; * if not, write to the Free Software Foundation, Inc., 59 Temple Place, * Suite 330, Boston, MA 02111-1307 USA * * The author of this file: * */ /* * The source code included in this files was separated from mbfilter.c * by moriyoshi koizumi <moriyoshi@php.net> on 4 dec 2002. * */ #ifndef MBFL_MBFILTER_PASS_H #define MBFL_MBFILTER_PASS_H #include "mbfl_defs.h" #include "mbfilter.h" MBFLAPI extern const mbfl_encoding mbfl_encoding_pass; MBFLAPI extern const struct mbfl_convert_vtbl vtbl_pass; MBFLAPI extern int mbfl_filt_conv_pass(int c, mbfl_convert_filter *filter); #endif /* MBFL_MBFILTER_PASS_H */ mbfl/mbfilter_wchar.h 0000644 00000002414 15004441325 0010624 0 ustar 00 /* * "streamable kanji code filter and converter" * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. * * LICENSE NOTICES * * This file is part of "streamable kanji code filter and converter", * which is distributed under the terms of GNU Lesser General Public * License (version 2) as published by the Free Software Foundation. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with "streamable kanji code filter and converter"; * if not, write to the Free Software Foundation, Inc., 59 Temple Place, * Suite 330, Boston, MA 02111-1307 USA * * The author of this file: * */ /* * The source code included in this files was separated from mbfilter.c * by Moriyoshi Koizumi <moriyoshi@php.net> on 20 Dec 2002. The file * mbfilter.c is included in this package . * */ #ifndef MBFL_MBFILTER_WCHAR_H #define MBFL_MBFILTER_WCHAR_H #include "mbfl_defs.h" #include "mbfilter.h" MBFLAPI extern const mbfl_encoding mbfl_encoding_wchar; #endif /* MBFL_MBFILTER_WCHAR_H */ mbfl/mbfl_consts.h 0000644 00000010221 15004441325 0010140 0 ustar 00 /* * "streamable kanji code filter and converter" * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. * * LICENSE NOTICES * * This file is part of "streamable kanji code filter and converter", * which is distributed under the terms of GNU Lesser General Public * License (version 2) as published by the Free Software Foundation. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with "streamable kanji code filter and converter"; * if not, write to the Free Software Foundation, Inc., 59 Temple Place, * Suite 330, Boston, MA 02111-1307 USA * * The author of this file: * */ /* * The source code included in this files was separated from mbfilter.h * by Moriyoshi Koizumi <moriyoshi@php.net> on 20 Dec 2002. The file * mbfilter.h is included in this package . * */ #ifndef MBFL_CONSTS_H #define MBFL_CONSTS_H #define MBFL_ENCTYPE_SBCS 0x00000001 /* single-byte encoding */ #define MBFL_ENCTYPE_MBCS 0x00000002 /* multi-byte encoding */ #define MBFL_ENCTYPE_WCS2BE 0x00000010 /* 2 bytes/char, big endian */ #define MBFL_ENCTYPE_WCS2LE 0x00000020 /* 2 bytes/char, little endian */ #define MBFL_ENCTYPE_MWC2BE 0x00000040 /* 2+ bytes/char, big endian */ #define MBFL_ENCTYPE_MWC2LE 0x00000080 /* 2+ bytes/char, little endian */ #define MBFL_ENCTYPE_WCS4BE 0x00000100 /* 4 bytes/char, big endian */ #define MBFL_ENCTYPE_WCS4LE 0x00000200 /* 4 bytes/char, little endian */ #define MBFL_ENCTYPE_GL_UNSAFE 0x00004000 /* wchar plane, special character */ #define MBFL_WCSPLANE_MASK 0xffff #define MBFL_WCSPLANE_UCS2MAX 0x00010000 #define MBFL_WCSPLANE_UTF32MAX 0x00110000 #define MBFL_WCSPLANE_SUPMIN 0x00010000 #define MBFL_WCSPLANE_SUPMAX 0x00200000 #define MBFL_WCSPLANE_JIS0213 0x70e00000 /* JIS HEX : 2121h - 7E7Eh */ #define MBFL_WCSPLANE_JIS0208 0x70e10000 /* JIS HEX : 2121h - 7E7Eh */ #define MBFL_WCSPLANE_JIS0212 0x70e20000 /* JIS HEX : 2121h - 7E7Eh */ #define MBFL_WCSPLANE_WINCP932 0x70e30000 /* JIS HEX : 2121h - 9898h */ #define MBFL_WCSPLANE_8859_1 0x70e40000 /* 00h - FFh */ #define MBFL_WCSPLANE_8859_2 0x70e50000 /* 00h - FFh */ #define MBFL_WCSPLANE_8859_3 0x70e60000 /* 00h - FFh */ #define MBFL_WCSPLANE_8859_4 0x70e70000 /* 00h - FFh */ #define MBFL_WCSPLANE_8859_5 0x70e80000 /* 00h - FFh */ #define MBFL_WCSPLANE_8859_6 0x70e90000 /* 00h - FFh */ #define MBFL_WCSPLANE_8859_7 0x70ea0000 /* 00h - FFh */ #define MBFL_WCSPLANE_8859_8 0x70eb0000 /* 00h - FFh */ #define MBFL_WCSPLANE_8859_9 0x70ec0000 /* 00h - FFh */ #define MBFL_WCSPLANE_8859_10 0x70ed0000 /* 00h - FFh */ #define MBFL_WCSPLANE_8859_13 0x70ee0000 /* 00h - FFh */ #define MBFL_WCSPLANE_8859_14 0x70ef0000 /* 00h - FFh */ #define MBFL_WCSPLANE_8859_15 0x70f00000 /* 00h - FFh */ #define MBFL_WCSPLANE_KSC5601 0x70f10000 /* 2121h - 7E7Eh */ #define MBFL_WCSPLANE_GB2312 0x70f20000 /* 2121h - 7E7Eh */ #define MBFL_WCSPLANE_WINCP936 0x70f30000 /* 2121h - 9898h */ #define MBFL_WCSPLANE_BIG5 0x70f40000 /* 2121h - 9898h */ #define MBFL_WCSPLANE_CNS11643 0x70f50000 /* 2121h - 9898h */ #define MBFL_WCSPLANE_UHC 0x70f60000 /* 8141h - fefeh */ #define MBFL_WCSPLANE_CP1251 0x70f70000 #define MBFL_WCSPLANE_CP866 0x70f80000 #define MBFL_WCSPLANE_KOI8R 0x70f90000 #define MBFL_WCSPLANE_8859_16 0x70fa0000 /* 00h - FFh */ #define MBFL_WCSPLANE_ARMSCII8 0x70fb0000 #define MBFL_WCSPLANE_KOI8U 0x70fc0000 #define MBFL_WCSPLANE_CP1254 0x70fd0000 /* 00h - FFh */ #define MBFL_WCSPLANE_CP850 0x70fe0000 /* 00h - FFh */ #define MBFL_WCSPLANE_GB18030 0x70ff0000 /* a1a1h-e3329a35h */ #define MBFL_WCSGROUP_MASK 0xffffff #define MBFL_WCSGROUP_UCS4MAX 0x70000000 #define MBFL_WCSGROUP_WCHARMAX 0x78000000 #define MBFL_WCSGROUP_THROUGH 0x78000000 /* 000000h - FFFFFFh */ #define MBFL_QPRINT_STS_MIME_HEADER 0x1000000 #define MBFL_BASE64_STS_MIME_HEADER 0x1000000 #endif /* MBFL_CONSTS_H */ mbfl/mbfl_convert.h 0000644 00000007017 15004441325 0010320 0 ustar 00 /* * "streamable kanji code filter and converter" * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. * * LICENSE NOTICES * * This file is part of "streamable kanji code filter and converter", * which is distributed under the terms of GNU Lesser General Public * License (version 2) as published by the Free Software Foundation. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with "streamable kanji code filter and converter"; * if not, write to the Free Software Foundation, Inc., 59 Temple Place, * Suite 330, Boston, MA 02111-1307 USA * * The author of this file: * */ /* * The source code included in this files was separated from mbfilter.h * by Moriyoshi Koizumi <moriyoshi@php.net> on 20 Dec 2002. The file * mbfilter.h is included in this package . * */ #ifndef MBFL_CONVERT_H #define MBFL_CONVERT_H #include "mbfl_defs.h" #include "mbfl_encoding.h" #include "mbfl_memory_device.h" typedef struct _mbfl_convert_filter mbfl_convert_filter; /* internal */ typedef int (*filter_flush_t)(mbfl_convert_filter*); /* defined by mbfl_convert_filter_{new,new2,init} */ typedef int (*output_function_t)(int, void*); typedef int (*flush_function_t)(void *); struct _mbfl_convert_filter { void (*filter_ctor)(mbfl_convert_filter *filter); void (*filter_dtor)(mbfl_convert_filter *filter); void (*filter_copy)(mbfl_convert_filter *src, mbfl_convert_filter *dest); int (*filter_function)(int c, mbfl_convert_filter *filter); filter_flush_t filter_flush; output_function_t output_function; flush_function_t flush_function; void *data; int status; int cache; const mbfl_encoding *from; const mbfl_encoding *to; int illegal_mode; int illegal_substchar; size_t num_illegalchar; void *opaque; }; MBFLAPI extern mbfl_convert_filter *mbfl_convert_filter_new(const mbfl_encoding *from, const mbfl_encoding *to, output_function_t output_function, flush_function_t flush_function, void *data); MBFLAPI extern mbfl_convert_filter *mbfl_convert_filter_new2(const struct mbfl_convert_vtbl *vtbl, output_function_t output_function, flush_function_t flush_function, void *data); MBFLAPI extern void mbfl_convert_filter_delete(mbfl_convert_filter *filter); MBFLAPI extern int mbfl_convert_filter_feed(int c, mbfl_convert_filter *filter); MBFLAPI extern unsigned char* mbfl_convert_filter_feed_string(mbfl_convert_filter *filter, unsigned char *p, size_t len); MBFLAPI extern int mbfl_convert_filter_flush(mbfl_convert_filter *filter); MBFLAPI extern void mbfl_convert_filter_reset(mbfl_convert_filter *filter, const mbfl_encoding *from, const mbfl_encoding *to); MBFLAPI extern void mbfl_convert_filter_copy(mbfl_convert_filter *src, mbfl_convert_filter *dist); MBFLAPI extern int mbfl_filt_conv_illegal_output(int c, mbfl_convert_filter *filter); MBFLAPI extern const struct mbfl_convert_vtbl * mbfl_convert_filter_get_vtbl(const mbfl_encoding *from, const mbfl_encoding *to); MBFLAPI extern void mbfl_filt_conv_common_ctor(mbfl_convert_filter *filter); MBFLAPI extern int mbfl_filt_conv_common_flush(mbfl_convert_filter *filter); MBFLAPI extern void mbfl_convert_filter_devcat(mbfl_convert_filter *filter, mbfl_memory_device *src); MBFLAPI extern int mbfl_convert_filter_strcat(mbfl_convert_filter *filter, const unsigned char *p); #endif /* MBFL_CONVERT_H */ mbfl/mbfl_defs.h 0000644 00000003160 15004441325 0007554 0 ustar 00 /* * "streamable kanji code filter and converter" * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. * * LICENSE NOTICES * * This file is part of "streamable kanji code filter and converter", * which is distributed under the terms of GNU Lesser General Public * License (version 2) as published by the Free Software Foundation. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with "streamable kanji code filter and converter"; * if not, write to the Free Software Foundation, Inc., 59 Temple Place, * Suite 330, Boston, MA 02111-1307 USA * * The author of this file: * */ /* * The source code included in this files was separated from mbfilter.h * by Moriyoshi Koizumi <moriyoshi@php.net> on 20 Dec 2002. The file * mbfilter.h is included in this package . * */ #ifndef MBFL_DEFS_H #define MBFL_DEFS_H #ifndef NULL #ifdef __cplusplus #define NULL (0L) #else #define NULL (void *)(0L) #endif #endif #ifndef SIZE_MAX #define SIZE_MAX ((size_t)~0) #endif #ifdef WIN32 #ifdef MBFL_DLL_EXPORT #define MBFLAPI __declspec(dllexport) #else #define MBFLAPI __declspec(dllimport) #endif /* MBFL_DLL_EXPORT */ #else #if defined(__GNUC__) && __GNUC__ >= 4 #define MBFLAPI __attribute__((visibility("default"))) #else #define MBFLAPI #endif /* defined(__GNUC__) && __GNUC__ >= 4 */ #endif /* WIN32 */ #endif /* MBFL_DEFS_H */ mbfl/mbfl_encoding.h 0000644 00000011465 15004441325 0010430 0 ustar 00 /* * "streamable kanji code filter and converter" * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. * * LICENSE NOTICES * * This file is part of "streamable kanji code filter and converter", * which is distributed under the terms of GNU Lesser General Public * License (version 2) as published by the Free Software Foundation. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with "streamable kanji code filter and converter"; * if not, write to the Free Software Foundation, Inc., 59 Temple Place, * Suite 330, Boston, MA 02111-1307 USA * * The author of this file: * */ /* * The source code included in this files was separated from mbfilter.h * by Moriyoshi Koizumi <moriyoshi@php.net> on 20 Dec 2002. The file * mbfilter.h is included in this package . * */ #ifndef MBFL_ENCODING_H #define MBFL_ENCODING_H #include "mbfl_defs.h" enum mbfl_no_encoding { mbfl_no_encoding_invalid = -1, mbfl_no_encoding_pass, mbfl_no_encoding_wchar, mbfl_no_encoding_byte2be, mbfl_no_encoding_byte2le, mbfl_no_encoding_byte4be, mbfl_no_encoding_byte4le, mbfl_no_encoding_base64, mbfl_no_encoding_uuencode, mbfl_no_encoding_html_ent, mbfl_no_encoding_qprint, mbfl_no_encoding_7bit, mbfl_no_encoding_8bit, mbfl_no_encoding_charset_min, mbfl_no_encoding_ucs4, mbfl_no_encoding_ucs4be, mbfl_no_encoding_ucs4le, mbfl_no_encoding_ucs2, mbfl_no_encoding_ucs2be, mbfl_no_encoding_ucs2le, mbfl_no_encoding_utf32, mbfl_no_encoding_utf32be, mbfl_no_encoding_utf32le, mbfl_no_encoding_utf16, mbfl_no_encoding_utf16be, mbfl_no_encoding_utf16le, mbfl_no_encoding_utf8, mbfl_no_encoding_utf8_docomo, mbfl_no_encoding_utf8_kddi_a, mbfl_no_encoding_utf8_kddi_b, mbfl_no_encoding_utf8_sb, mbfl_no_encoding_utf7, mbfl_no_encoding_utf7imap, mbfl_no_encoding_ascii, mbfl_no_encoding_euc_jp, mbfl_no_encoding_eucjp2004, mbfl_no_encoding_sjis, mbfl_no_encoding_eucjp_win, mbfl_no_encoding_sjis_open, mbfl_no_encoding_sjis_docomo, mbfl_no_encoding_sjis_kddi, mbfl_no_encoding_sjis_sb, mbfl_no_encoding_sjis_mac, mbfl_no_encoding_sjis2004, mbfl_no_encoding_cp932, mbfl_no_encoding_cp51932, mbfl_no_encoding_jis, mbfl_no_encoding_2022jp, mbfl_no_encoding_2022jp_2004, mbfl_no_encoding_2022jp_kddi, mbfl_no_encoding_2022jpms, mbfl_no_encoding_gb18030, mbfl_no_encoding_cp1252, mbfl_no_encoding_cp1254, mbfl_no_encoding_8859_1, mbfl_no_encoding_8859_2, mbfl_no_encoding_8859_3, mbfl_no_encoding_8859_4, mbfl_no_encoding_8859_5, mbfl_no_encoding_8859_6, mbfl_no_encoding_8859_7, mbfl_no_encoding_8859_8, mbfl_no_encoding_8859_9, mbfl_no_encoding_8859_10, mbfl_no_encoding_8859_13, mbfl_no_encoding_8859_14, mbfl_no_encoding_8859_15, mbfl_no_encoding_euc_cn, mbfl_no_encoding_cp936, mbfl_no_encoding_euc_tw, mbfl_no_encoding_big5, mbfl_no_encoding_cp950, mbfl_no_encoding_euc_kr, mbfl_no_encoding_2022kr, mbfl_no_encoding_uhc, mbfl_no_encoding_hz, mbfl_no_encoding_cp1251, mbfl_no_encoding_cp866, mbfl_no_encoding_koi8r, mbfl_no_encoding_koi8u, mbfl_no_encoding_8859_16, mbfl_no_encoding_armscii8, mbfl_no_encoding_cp850, mbfl_no_encoding_jis_ms, mbfl_no_encoding_cp50220, mbfl_no_encoding_cp50220raw, mbfl_no_encoding_cp50221, mbfl_no_encoding_cp50222, mbfl_no_encoding_charset_max }; typedef enum mbfl_no_encoding mbfl_encoding_id; struct _mbfl_convert_filter; struct mbfl_convert_vtbl { enum mbfl_no_encoding from; enum mbfl_no_encoding to; void (*filter_ctor)(struct _mbfl_convert_filter *filter); void (*filter_dtor)(struct _mbfl_convert_filter *filter); int (*filter_function)(int c, struct _mbfl_convert_filter *filter); int (*filter_flush)(struct _mbfl_convert_filter *filter); void (*filter_copy)(struct _mbfl_convert_filter *src, struct _mbfl_convert_filter *dest); }; /* * encoding */ typedef struct _mbfl_encoding { enum mbfl_no_encoding no_encoding; const char *name; const char *mime_name; const char *(*aliases)[]; const unsigned char *mblen_table; unsigned int flag; const struct mbfl_convert_vtbl *input_filter; const struct mbfl_convert_vtbl *output_filter; } mbfl_encoding; MBFLAPI extern const mbfl_encoding * mbfl_name2encoding(const char *name); MBFLAPI extern const mbfl_encoding * mbfl_no2encoding(enum mbfl_no_encoding no_encoding); MBFLAPI extern enum mbfl_no_encoding mbfl_name2no_encoding(const char *name); MBFLAPI extern const mbfl_encoding ** mbfl_get_supported_encodings(); MBFLAPI extern const char * mbfl_no_encoding2name(enum mbfl_no_encoding no_encoding); MBFLAPI extern const char * mbfl_no2preferred_mime_name(enum mbfl_no_encoding no_encoding); #endif /* MBFL_ENCODING_H */ mbfl/mbfl_filter_output.h 0000644 00000002441 15004441325 0011541 0 ustar 00 /* * "streamable kanji code filter and converter" * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. * * LICENSE NOTICES * * This file is part of "streamable kanji code filter and converter", * which is distributed under the terms of GNU Lesser General Public * License (version 2) as published by the Free Software Foundation. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with "streamable kanji code filter and converter"; * if not, write to the Free Software Foundation, Inc., 59 Temple Place, * Suite 330, Boston, MA 02111-1307 USA * * The author of this file: * */ /* * The source code included in this files was separated from mbfilter.h * by Moriyoshi Koizumi <moriyoshi@php.net> on 20 Dec 2002. The file * mbfilter.h is included in this package . * */ #ifndef MBFL_FILTER_OUTPUT_H #define MBFL_FILTER_OUTPUT_H MBFLAPI extern int mbfl_filter_output_pipe(int c, void* data); MBFLAPI extern int mbfl_filter_output_null(int c, void* data); #endif /* MBFL_FILTER_OUTPUT_H */ mbfl/mbfl_ident.h 0000644 00000005063 15004441325 0007742 0 ustar 00 /* * "streamable kanji code filter and converter" * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. * * LICENSE NOTICES * * This file is part of "streamable kanji code filter and converter", * which is distributed under the terms of GNU Lesser General Public * License (version 2) as published by the Free Software Foundation. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with "streamable kanji code filter and converter"; * if not, write to the Free Software Foundation, Inc., 59 Temple Place, * Suite 330, Boston, MA 02111-1307 USA * * The author of this file: * */ /* * The source code included in this files was separated from mbfilter.h * by Moriyoshi Koizumi <moriyoshi@php.net> on 20 Dec 2002. The file * mbfilter.h is included in this package . * */ #ifndef MBFL_IDENT_H #define MBFL_IDENT_H #include "mbfl_defs.h" #include "mbfl_encoding.h" /* * identify filter */ typedef struct _mbfl_identify_filter mbfl_identify_filter; struct _mbfl_identify_filter { void (*filter_ctor)(mbfl_identify_filter *filter); int (*filter_function)(int c, mbfl_identify_filter *filter); int status; int flag; int score; const mbfl_encoding *encoding; }; struct mbfl_identify_vtbl { enum mbfl_no_encoding encoding; void (*filter_ctor)(mbfl_identify_filter *filter); int (*filter_function)(int c, mbfl_identify_filter *filter); }; MBFLAPI extern const struct mbfl_identify_vtbl * mbfl_identify_filter_get_vtbl(enum mbfl_no_encoding encoding); MBFLAPI extern mbfl_identify_filter * mbfl_identify_filter_new(enum mbfl_no_encoding encoding); MBFLAPI extern mbfl_identify_filter * mbfl_identify_filter_new2(const mbfl_encoding *encoding); MBFLAPI extern void mbfl_identify_filter_delete(mbfl_identify_filter *filter); MBFLAPI extern int mbfl_identify_filter_init(mbfl_identify_filter *filter, enum mbfl_no_encoding encoding); MBFLAPI extern int mbfl_identify_filter_init2(mbfl_identify_filter *filter, const mbfl_encoding *encoding); MBFLAPI extern void mbfl_filt_ident_common_ctor(mbfl_identify_filter *filter); MBFLAPI extern void mbfl_filt_ident_false_ctor(mbfl_identify_filter *filter); MBFLAPI extern int mbfl_filt_ident_false(int c, mbfl_identify_filter *filter); MBFLAPI extern int mbfl_filt_ident_true(int c, mbfl_identify_filter *filter); #endif /* MBFL_IDENT_H */ mbfl/mbfl_language.h 0000644 00000005470 15004441325 0010424 0 ustar 00 /* * "streamable kanji code filter and converter" * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. * * LICENSE NOTICES * * This file is part of "streamable kanji code filter and converter", * which is distributed under the terms of GNU Lesser General Public * License (version 2) as published by the Free Software Foundation. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with "streamable kanji code filter and converter"; * if not, write to the Free Software Foundation, Inc., 59 Temple Place, * Suite 330, Boston, MA 02111-1307 USA * * The author of this file: * */ /* * The source code included in this files was separated from mbfilter.h * by Moriyoshi Koizumi <moriyoshi@php.net> on 20 Dec 2002. The file * mbfilter.h is included in this package . * */ #ifndef MBFL_LANGUAGE_H #define MBFL_LANGUAGE_H #include "mbfl_defs.h" #include "mbfl_encoding.h" enum mbfl_no_language { mbfl_no_language_invalid = -1, mbfl_no_language_neutral, mbfl_no_language_uni, mbfl_no_language_min, mbfl_no_language_catalan, /* ca */ mbfl_no_language_danish, /* da */ mbfl_no_language_german, /* de */ mbfl_no_language_english, /* en */ mbfl_no_language_estonian, /* et */ mbfl_no_language_greek, /* el */ mbfl_no_language_spanish, /* es */ mbfl_no_language_french, /* fr */ mbfl_no_language_italian, /* it */ mbfl_no_language_japanese, /* ja */ mbfl_no_language_korean, /* ko */ mbfl_no_language_dutch, /* nl */ mbfl_no_language_polish, /* pl */ mbfl_no_language_portuguese, /* pt */ mbfl_no_language_swedish, /* sv */ mbfl_no_language_simplified_chinese, /* zh-cn */ mbfl_no_language_traditional_chinese, /* zh-tw */ mbfl_no_language_russian, /* ru */ mbfl_no_language_ukrainian, /* ua */ mbfl_no_language_armenian, /* hy */ mbfl_no_language_turkish, /* tr */ mbfl_no_language_max }; typedef enum mbfl_no_language mbfl_language_id; /* * language */ typedef struct _mbfl_language { enum mbfl_no_language no_language; const char *name; const char *short_name; const char *(*aliases)[]; enum mbfl_no_encoding mail_charset; enum mbfl_no_encoding mail_header_encoding; enum mbfl_no_encoding mail_body_encoding; } mbfl_language; MBFLAPI extern const mbfl_language * mbfl_name2language(const char *name); MBFLAPI extern const mbfl_language * mbfl_no2language(enum mbfl_no_language no_language); MBFLAPI extern enum mbfl_no_language mbfl_name2no_language(const char *name); MBFLAPI extern const char * mbfl_no_language2name(enum mbfl_no_language no_language); #endif /* MBFL_LANGUAGE_H */ mbfl/mbfl_memory_device.h 0000644 00000005136 15004441325 0011467 0 ustar 00 /* * "streamable kanji code filter and converter" * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. * * LICENSE NOTICES * * This file is part of "streamable kanji code filter and converter", * which is distributed under the terms of GNU Lesser General Public * License (version 2) as published by the Free Software Foundation. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with "streamable kanji code filter and converter"; * if not, write to the Free Software Foundation, Inc., 59 Temple Place, * Suite 330, Boston, MA 02111-1307 USA * * The author of this file: * */ /* * The source code included in this files was separated from mbfilter.h * by Moriyoshi Koizumi <moriyoshi@php.net> on 20 Dec 2002. The file * mbfilter.h is included in this package . * */ #ifndef MBFL_MEMORY_DEVICE_H #define MBFL_MEMORY_DEVICE_H #include "mbfl_defs.h" #include "mbfl_string.h" #define MBFL_MEMORY_DEVICE_ALLOC_SIZE 64 typedef struct _mbfl_memory_device { unsigned char *buffer; size_t length; size_t pos; size_t allocsz; } mbfl_memory_device; typedef struct _mbfl_wchar_device { unsigned int *buffer; size_t length; size_t pos; size_t allocsz; } mbfl_wchar_device; MBFLAPI extern void mbfl_memory_device_init( mbfl_memory_device *device, size_t initsz, size_t allocsz); MBFLAPI extern void mbfl_memory_device_realloc( mbfl_memory_device *device, size_t initsz, size_t allocsz); MBFLAPI extern void mbfl_memory_device_clear(mbfl_memory_device *device); MBFLAPI extern void mbfl_memory_device_reset(mbfl_memory_device *device); MBFLAPI extern mbfl_string * mbfl_memory_device_result( mbfl_memory_device *device, mbfl_string *result); MBFLAPI extern void mbfl_memory_device_unput(mbfl_memory_device *device); MBFLAPI extern int mbfl_memory_device_output(int c, void *data); MBFLAPI extern int mbfl_memory_device_strcat(mbfl_memory_device *device, const char *psrc); MBFLAPI extern int mbfl_memory_device_strncat( mbfl_memory_device *device, const char *psrc, size_t len); MBFLAPI extern int mbfl_memory_device_devcat(mbfl_memory_device *dest, mbfl_memory_device *src); MBFLAPI extern void mbfl_wchar_device_init(mbfl_wchar_device *device); MBFLAPI extern int mbfl_wchar_device_output(int c, void *data); MBFLAPI extern void mbfl_wchar_device_clear(mbfl_wchar_device *device); #endif /* MBFL_MEMORY_DEVICE_H */ mbfl/mbfl_string.h 0000644 00000003115 15004441325 0010141 0 ustar 00 /* * "streamable kanji code filter and converter" * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. * * LICENSE NOTICES * * This file is part of "streamable kanji code filter and converter", * which is distributed under the terms of GNU Lesser General Public * License (version 2) as published by the Free Software Foundation. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with "streamable kanji code filter and converter"; * if not, write to the Free Software Foundation, Inc., 59 Temple Place, * Suite 330, Boston, MA 02111-1307 USA * * The author of this file: * */ /* * The source code included in this files was separated from mbfilter.h * by Moriyoshi Koizumi <moriyoshi@php.net> on 20 Dec 2002. The file * mbfilter.h is included in this package . * */ #ifndef MBFL_STRING_H #define MBFL_STRING_H #include <stddef.h> #include "mbfl_defs.h" #include "mbfl_encoding.h" #include "mbfl_language.h" /* * string object */ typedef struct _mbfl_string { const mbfl_encoding *encoding; unsigned char *val; size_t len; } mbfl_string; MBFLAPI extern void mbfl_string_init(mbfl_string *string); MBFLAPI extern void mbfl_string_init_set(mbfl_string *string, const mbfl_encoding *encoding); MBFLAPI extern void mbfl_string_clear(mbfl_string *string); #endif /* MBFL_STRING_H */
| ver. 1.4 |
Github
|
.
| PHP 8.1.31 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка