1 /*
2  *    (c) Copyright 2004  Uwe Steinmann.
3  *    All rights reserved.
4  *
5  *    This library is free software; you can redistribute it and/or
6  *    modify it under the terms of the GNU Lesser General Public
7  *    License as published by the Free Software Foundation; either
8  *    version 2 of the License, or (at your option) any later version.
9  *
10  *    This library is distributed in the hope that it will be useful,
11  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  *    Lesser General Public License for more details.
14  *
15  *    You should have received a copy of the GNU Lesser General Public
16  *    License along with this library; if not, write to the
17  *    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  *    Boston, MA 02111-1307, USA.
19  */
20 
21 #ifndef __PS_STRBUF_H__
22 #define __PS_STRBUF_H__
23 
24 struct str_buffer_ {
25 	char *buffer;
26 	size_t cur;
27 	size_t size;
28 };
29 
30 typedef struct str_buffer_ STRBUFFER;
31 
32 STRBUFFER *str_buffer_new(PSDoc *psdoc, size_t size);
33 void str_buffer_delete(PSDoc *psdoc, STRBUFFER *sb);
34 size_t str_buffer_print(PSDoc *psdoc, STRBUFFER *sb, const char *fmt, ...);
35 size_t str_buffer_write(PSDoc *psdoc, STRBUFFER *sb, const char *data, size_t size);
36 const char *str_buffer_get(PSDoc *psdoc, STRBUFFER *sb);
37 size_t str_buffer_len(PSDoc *psdoc, STRBUFFER *sb);
38 void str_buffer_clear(PSDoc *psdoc, STRBUFFER *sb);
39 
40 #endif
41