Files
smmapdfw/smmapdfw/libsmmapdfw/htbuffer.h
2006-09-18 14:56:22 +00:00

60 lines
1.9 KiB
C

/*
Copyright (C) 2005, Wolfgang Hottgenroth
This file is part of smmapdfw.
smmapdfw is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
smmapdfw 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 General Public
License for more details.
You should have received a copy of the GNU General Public License
along with smmapdfw. If not, write to the Free Software Foundation, 59
Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _HTBUFFER_H_
#define _HTBUFFER_H_
#define DEFAULT_MAX_SIZE 16*1024*1024
#define DEFAULT_CHUNK_SIZE 1024
typedef struct htbuffer_s {
char *buf;
unsigned int current_buf_size;
unsigned int max_size;
} htbuffer_t;
void htbuffer_set_max_size(htbuffer_t *b, unsigned int s);
htbuffer_t *htbuffer_init(unsigned int start_size);
void htbuffer_free(htbuffer_t *b);
unsigned int htbuffer_strlen(htbuffer_t *b);
htbuffer_t *htbuffer_memcpy_w_offset(htbuffer_t *dest, unsigned int offset, const char *src, unsigned int src_size);
htbuffer_t *htbuffer_memcpy(htbuffer_t *dest, const char *src, unsigned int src_size);
htbuffer_t *htbuffer_strcpy_w_offset(htbuffer_t *dest, unsigned int offset, const char *src);
htbuffer_t *htbuffer_strcpy(htbuffer_t *dest, const char *src);
htbuffer_t *htbuffer_strncpy_w_offset(htbuffer_t *dest, unsigned int offset, const char *src, unsigned int n);
htbuffer_t *htbuffer_strncpy(htbuffer_t *dest, const char *src, unsigned int n);
htbuffer_t *htbuffer_strncat(htbuffer_t *dest, const char *src, unsigned int n);
htbuffer_t *htbuffer_strcat(htbuffer_t *dest, const char *src);
#endif /* _HTBUFFER_H_ */