blob: bc1669bd194c7fe53ef232bd4b43d67d884d7a38 [file] [log] [blame]
Michael Clarkf0d08882007-03-13 08:26:18 +00001/*
Michael Clarkf6a6e482007-03-13 08:26:23 +00002 * $Id: printbuf.h,v 1.4 2006/01/26 02:16:28 mclark Exp $
Michael Clarkf0d08882007-03-13 08:26:18 +00003 *
Michael Clarkf6a6e482007-03-13 08:26:23 +00004 * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd.
Michael Clarkf0d08882007-03-13 08:26:18 +00005 * Michael Clark <michael@metaparadigm.com>
6 *
Michael Clarkf6a6e482007-03-13 08:26:23 +00007 * This library is free software; you can redistribute it and/or modify
8 * it under the terms of the MIT license. See COPYING for details.
Michael Clarkf0d08882007-03-13 08:26:18 +00009 *
10 */
11
12#ifndef _printbuf_h_
13#define _printbuf_h_
14
Michael Clark4504df72007-03-13 08:26:20 +000015#undef PRINTBUF_DEBUG
16
Michael Clarkf0d08882007-03-13 08:26:18 +000017struct printbuf {
18 char *buf;
19 int bpos;
20 int size;
21};
22
23extern struct printbuf*
24printbuf_new();
25
26extern int
27printbuf_memappend(struct printbuf *p, char *buf, int size);
28
29extern int
30sprintbuf(struct printbuf *p, const char *msg, ...);
31
32extern void
33printbuf_reset(struct printbuf *p);
34
35extern void
36printbuf_free(struct printbuf *p);
37
38#endif