summaryrefslogtreecommitdiffstats
path: root/include/buffer.h
blob: aa753b417cbf066092f71f5c145032291d1d970a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef _BUFFER_H_
#define _BUFFER_H_

struct buffer {
	unsigned char *data;
	unsigned int size;
	unsigned int cur_size;
};

struct buffer *buffer_create(unsigned int size);
int buffer_add(struct buffer *b, void *data, unsigned int size);
void buffer_flush(struct buffer *b, 
		  void (*cb)(void *buffer_data, 
		  void *data),
		  void *data);
unsigned int buffer_size(const struct buffer *b);

#endif