cctools
buffer.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2005- The University of Notre Dame
3 This software is distributed under the GNU General Public License.
4 See the file COPYING for details.
5 */
6 
7 #ifndef BUFFER_H
8 #define BUFFER_H
9 
10 #include <stdlib.h>
11 #include <stdarg.h>
12 
20 typedef struct buffer_t buffer_t;
21 
25 buffer_t *buffer_create(void);
26 
30 void buffer_delete(buffer_t * b);
31 
40 int buffer_vprintf(buffer_t * b, const char *format, va_list ap);
41 
49 int buffer_printf(buffer_t * b, const char *format, ...);
50 
58 const char *buffer_tostring(buffer_t * b, size_t * size);
59 
60 #endif /* BUFFER_H */
int buffer_vprintf(buffer_t *b, const char *format, va_list ap)
Print the formatted output to the buffer.
const char * buffer_tostring(buffer_t *b, size_t *size)
Returns the buffer as a string.
struct buffer_t buffer_t
buffer_t is an opaque object representing a buffer.
Definition: buffer.h:20
int buffer_printf(buffer_t *b, const char *format,...)
Print the formatted output to the buffer.
buffer_t * buffer_create(void)
Create a new buffer.
void buffer_delete(buffer_t *b)
Delete a buffer.