tinc/src/buffer.h

19 lines
508 B
C
Raw Normal View History

#ifndef __TINC_BUFFER_H__
#define __TINC_BUFFER_H__
typedef struct buffer_t {
char *data;
2015-06-29 13:52:14 +00:00
size_t maxlen;
size_t len;
unsigned int offset;
} buffer_t;
2015-06-29 13:52:14 +00:00
extern void buffer_compact(buffer_t *buffer, size_t maxsize);
extern char *buffer_prepare(buffer_t *buffer, size_t size);
extern void buffer_add(buffer_t *buffer, const char *data, size_t size);
extern char *buffer_readline(buffer_t *buffer);
2015-06-29 13:52:14 +00:00
extern char *buffer_read(buffer_t *buffer, size_t size);
extern void buffer_clear(buffer_t *buffer);
#endif