Back to index

php5  5.3.10
mbfl_memory_device.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_MEMORY_DEVICE_H
00032 #define MBFL_MEMORY_DEVICE_H
00033 
00034 #include "mbfl_defs.h"
00035 #include "mbfl_string.h"
00036 
00037 #define MBFL_MEMORY_DEVICE_ALLOC_SIZE     64
00038 
00039 typedef struct _mbfl_memory_device {
00040        unsigned char *buffer;
00041        int length;
00042        int pos;
00043        int allocsz;
00044 } mbfl_memory_device;
00045 
00046 typedef struct _mbfl_wchar_device {
00047        unsigned int *buffer;
00048        int length;
00049        int pos;
00050        int allocsz;
00051 } mbfl_wchar_device;
00052 
00053 MBFLAPI extern void mbfl_memory_device_init(mbfl_memory_device *device, int initsz, int allocsz);
00054 MBFLAPI extern void mbfl_memory_device_realloc(mbfl_memory_device *device, int initsz, int allocsz);
00055 MBFLAPI extern void mbfl_memory_device_clear(mbfl_memory_device *device);
00056 MBFLAPI extern void mbfl_memory_device_reset(mbfl_memory_device *device);
00057 MBFLAPI extern mbfl_string * mbfl_memory_device_result(mbfl_memory_device *device, mbfl_string *result);
00058 MBFLAPI extern void mbfl_memory_device_unput(mbfl_memory_device *device);
00059 MBFLAPI extern int mbfl_memory_device_output(int c, void *data);
00060 MBFLAPI extern int mbfl_memory_device_output2(int c, void *data);
00061 MBFLAPI extern int mbfl_memory_device_output4(int c, void *data);
00062 MBFLAPI extern int mbfl_memory_device_strcat(mbfl_memory_device *device, const char *psrc);
00063 MBFLAPI extern int mbfl_memory_device_strncat(mbfl_memory_device *device, const char *psrc, int len);
00064 MBFLAPI extern int mbfl_memory_device_devcat(mbfl_memory_device *dest, mbfl_memory_device *src);
00065 
00066 MBFLAPI extern void mbfl_wchar_device_init(mbfl_wchar_device *device);
00067 MBFLAPI extern int mbfl_wchar_device_output(int c, void *data);
00068 MBFLAPI extern void mbfl_wchar_device_clear(mbfl_wchar_device *device);
00069 
00070 
00071 
00072 #endif /* MBFL_MEMORY_DEVICE_H */
00073