Lines Matching refs:b
11 void InitBuffer (Buffer *b);
12 void AppendToBuffer (Buffer *b, const char *str, int len);
18 InitBuffer (Buffer *b) in InitBuffer() argument
20 b->room = INIT_BUFFER_SIZE; in InitBuffer()
21 b->used = 0; in InitBuffer()
22 b->buff = (char *)malloc(INIT_BUFFER_SIZE*sizeof(char)); in InitBuffer()
26 AppendToBuffer (Buffer *b, const char *str, int len) in AppendToBuffer() argument
28 while (b->used + len > b->room) { in AppendToBuffer()
29 b->buff = (char *)realloc(b->buff, 2*b->room*(sizeof(char))); in AppendToBuffer()
30 b->room *= 2; in AppendToBuffer()
32 strncpy(b->buff + b->used, str, len); in AppendToBuffer()
33 b->used += len; in AppendToBuffer()