stringbuffer.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2006  SRI International
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00017  *
00018  * SRI International: 333 Ravenswood Ave, Menlo Park, CA 94025
00019  */
00020 
00021 #ifndef STRINGBUFFER_H
00022 #define STRINGBUFFER_H
00023 
00024 #include <stdlib.h>
00025 
00026 #ifdef __cplusplus
00027 extern "C" {
00028 #endif
00029 
00030   struct stringbuffer_s;
00031   typedef struct stringbuffer_s stringbuffer_t;
00032   typedef int* (*stringbuffer_filter_t)(void* state, char toFilter, int* spaceForChar);
00033 
00034   stringbuffer_t* stringbuffer_new(char* data, size_t len);
00035   stringbuffer_t* stringbuffer_reset(stringbuffer_t* buf, char* data, size_t len);
00036   int stringbuffer_read(stringbuffer_t* buf);
00037   stringbuffer_t* stringbuffer_rewind(stringbuffer_t* buf, size_t rewindLen);
00038   void stringbuffer_delete(stringbuffer_t* buf);
00039   char* stringbuffer_getData(stringbuffer_t* buf);
00040   size_t stringbuffer_getLen(stringbuffer_t* buf);
00041   size_t stringbuffer_getIndex(stringbuffer_t* buf);
00042   stringbuffer_t* stringbuffer_filter(void* state, stringbuffer_filter_t filterFunction, stringbuffer_t* toFilter);
00043 
00044 #ifdef __cplusplus
00045 }
00046 #endif
00047 
00048 #endif

Generated on Wed May 23 17:20:13 2007 using doxygen 1.5.2