hl7parse
buffer.h
Go to the documentation of this file.
1 
4 #ifndef BUFFER_H
5 #define BUFFER_H
6 #include <stdlib.h>
7 #include <string.h>
8 
12 typedef struct buf {
14  int length;
16  int allocated;
18  unsigned char *buffer;
19 } buf_t;
20 
24 buf_t *new_buf_t();
25 
31 void free_buf(buf_t *buffer);
32 
52 int append_buf_str(buf_t *buffer, int size, unsigned char* data);
53 
63 int append_bufc(buf_t *buffer, unsigned char c);
64 
65 #endif // BUFFER_H
int allocated
Definition: buffer.h:16
dynamically growing generic bytearray
Definition: buffer.h:12
struct buf buf_t
dynamically growing generic bytearray
int append_bufc(buf_t *buffer, unsigned char c)
append a character
Definition: buffer.c:84
buf_t * new_buf_t()
allocate initial memory
Definition: buffer.c:9
int length
Definition: buffer.h:14
int append_buf_str(buf_t *buffer, int size, unsigned char *data)
add data to buffer
Definition: buffer.c:62
unsigned char * buffer
Definition: buffer.h:18
void free_buf(buf_t *buffer)
release all memory of buffer
Definition: buffer.c:19