‰PNG

   IHDR         ôxÔú   sBIT|dˆ   	pHYs  Ä  Ä•+   tEXtSoftware www.inkscape.org›î<  ,àtEXtComment 
/*
 * "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"

/* 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

#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
#define MBFL_OUTPUTFILTER_ILLEGAL_MODE_BADUTF8 4 /* For internal use only; deliberately uses invalid UTF-8 byte sequence as error marker */

/*
 * convenience macros
 */
#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
#endif

/* Lengths -1 through -16 are reserved for error return values */
static inline int mbfl_is_error(size_t len) {
	return len >= (size_t) -16;
}

#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)

/*
 * If specified as length, the substr until the end of the string is taken.
 */
#define MBFL_SUBSTR_UNTIL_END ((size_t) -1)

/*
 * strcut
 */
MBFLAPI extern mbfl_string *
mbfl_strcut(mbfl_string *string, mbfl_string *result, size_t from, size_t length);

#endif	/* MBFL_MBFILTER_H */
