blob: ab1ccd3d7ef5506538e2fe6842a039fe60d71731 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#ifndef _BUFFER_H_
#define _BUFFER_H_
#include <stddef.h>
struct buffer {
unsigned char *data;
size_t size;
size_t cur_size;
};
struct buffer *buffer_create(size_t size);
void buffer_destroy(struct buffer *b);
int buffer_add(struct buffer *b, void *data, size_t size);
void buffer_flush(struct buffer *b,
void (*cb)(void *buffer_data,
void *data),
void *data);
size_t buffer_size(const struct buffer *b);
#endif
|