File: strbuf.h

package info (click to toggle)
librra 0.9.0-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,032 kB
  • ctags: 1,045
  • sloc: ansic: 9,914; sh: 8,954; makefile: 125
file content (31 lines) | stat: -rw-r--r-- 676 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef __strbuf_h__
#define __strbuf_h__

#include <stdarg.h>
#include <sys/types.h>
#include <synce.h>

struct _StrBuf
{
  char *buffer;
  int length;
  size_t buffer_size;
};

typedef struct _StrBuf StrBuf;


StrBuf* strbuf_new (const char *init);
void strbuf_destroy (StrBuf *strbuf, bool free_contents);
StrBuf* strbuf_append (StrBuf *strbuf, const char* str);
StrBuf* strbuf_append_wstr(StrBuf* strbuf, WCHAR* wstr);
StrBuf* strbuf_append_c (StrBuf *strbuf, int c);
StrBuf* strbuf_append_crlf (StrBuf *strbuf);

#if 0
StrBuf* strbuf_printf(StrBuf *strbuf, const char* format, ...);
StrBuf* strbuf_vprintf(StrBuf *strbuf, const char* format, va_list ap);
#endif

#endif