release
[hcoop/zz_old/debian/djbdns.git] / stralloc.h
CommitLineData
dc0d77d7
CE
1#ifndef STRALLOC_H
2#define STRALLOC_H
3
4#include "gen_alloc.h"
5
6GEN_ALLOC_typedef(stralloc,char,s,len,a)
7
8extern int stralloc_ready(stralloc *,unsigned int);
9extern int stralloc_readyplus(stralloc *,unsigned int);
10extern int stralloc_copy(stralloc *,const stralloc *);
11extern int stralloc_cat(stralloc *,const stralloc *);
12extern int stralloc_copys(stralloc *,const char *);
13extern int stralloc_cats(stralloc *,const char *);
14extern int stralloc_copyb(stralloc *,const char *,unsigned int);
15extern int stralloc_catb(stralloc *,const char *,unsigned int);
16extern int stralloc_append(stralloc *,const char *); /* beware: this takes a pointer to 1 char */
17extern int stralloc_starts(stralloc *,const char *);
18
19#define stralloc_0(sa) stralloc_append(sa,"")
20
21extern int stralloc_catulong0(stralloc *,unsigned long,unsigned int);
22extern int stralloc_catlong0(stralloc *,long,unsigned int);
23
24#define stralloc_catlong(sa,l) (stralloc_catlong0((sa),(l),0))
25#define stralloc_catuint0(sa,i,n) (stralloc_catulong0((sa),(i),(n)))
26#define stralloc_catint0(sa,i,n) (stralloc_catlong0((sa),(i),(n)))
27#define stralloc_catint(sa,i) (stralloc_catlong0((sa),(i),0))
28
29#endif