Back to index

php5  5.3.10
mbfl_ident.h
Go to the documentation of this file.
00001 /*
00002  * "streamable kanji code filter and converter"
00003  * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved.
00004  *
00005  * LICENSE NOTICES
00006  *
00007  * This file is part of "streamable kanji code filter and converter",
00008  * which is distributed under the terms of GNU Lesser General Public 
00009  * License (version 2) as published by the Free Software Foundation.
00010  *
00011  * This software is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with "streamable kanji code filter and converter";
00018  * if not, write to the Free Software Foundation, Inc., 59 Temple Place,
00019  * Suite 330, Boston, MA  02111-1307  USA
00020  *
00021  * The author of this file:
00022  *
00023  */
00024 /*
00025  * The source code included in this files was separated from mbfilter.h
00026  * by Moriyoshi Koizumi <moriyoshi@php.net> on 20 Dec 2002. The file
00027  * mbfilter.h is included in this package .
00028  *
00029  */
00030 
00031 #ifndef MBFL_IDENT_H
00032 #define MBFL_IDENT_H
00033 
00034 #include "mbfl_defs.h"
00035 #include "mbfl_encoding.h"
00036 
00037 /*
00038  * identify filter
00039  */
00040 typedef struct _mbfl_identify_filter mbfl_identify_filter;
00041 
00042 struct _mbfl_identify_filter {
00043        void (*filter_ctor)(mbfl_identify_filter *filter);
00044        void (*filter_dtor)(mbfl_identify_filter *filter);
00045        int (*filter_function)(int c, mbfl_identify_filter *filter);
00046        int status;
00047        int flag;
00048        int score;
00049        const mbfl_encoding *encoding;
00050 };
00051 
00052 struct mbfl_identify_vtbl {
00053        enum mbfl_no_encoding encoding;
00054        void (*filter_ctor)(mbfl_identify_filter *filter);
00055        void (*filter_dtor)(mbfl_identify_filter *filter);
00056        int (*filter_function)(int c, mbfl_identify_filter *filter);
00057 };
00058 
00059 MBFLAPI extern const struct mbfl_identify_vtbl * mbfl_identify_filter_get_vtbl(enum mbfl_no_encoding encoding);
00060 MBFLAPI extern mbfl_identify_filter * mbfl_identify_filter_new(enum mbfl_no_encoding encoding);
00061 MBFLAPI extern void mbfl_identify_filter_delete(mbfl_identify_filter *filter);
00062 MBFLAPI extern int mbfl_identify_filter_init(mbfl_identify_filter *filter, enum mbfl_no_encoding encoding);
00063 MBFLAPI void mbfl_identify_filter_cleanup(mbfl_identify_filter *filter);
00064 
00065 MBFLAPI extern void mbfl_filt_ident_common_ctor(mbfl_identify_filter *filter);
00066 MBFLAPI extern void mbfl_filt_ident_common_dtor(mbfl_identify_filter *filter);
00067 MBFLAPI extern void mbfl_filt_ident_false_ctor(mbfl_identify_filter *filter);
00068 
00069 MBFLAPI extern int mbfl_filt_ident_false(int c, mbfl_identify_filter *filter);
00070 MBFLAPI extern int mbfl_filt_ident_true(int c, mbfl_identify_filter *filter);
00071 
00072 #endif /* MBFL_IDENT_H */