2011-05-14 17:15:04 +00:00
|
|
|
#ifndef __TINC_BUFFER_H__
|
|
|
|
#define __TINC_BUFFER_H__
|
|
|
|
|
|
|
|
typedef struct buffer_t {
|
|
|
|
char *data;
|
|
|
|
int maxlen;
|
|
|
|
int len;
|
|
|
|
int offset;
|
|
|
|
} buffer_t;
|
|
|
|
|
2011-05-22 11:15:05 +00:00
|
|
|
extern void buffer_compact(buffer_t *buffer, int maxsize);
|
2011-05-14 17:15:04 +00:00
|
|
|
extern char *buffer_prepare(buffer_t *buffer, int size);
|
2011-05-17 08:58:22 +00:00
|
|
|
extern void buffer_add(buffer_t *buffer, const char *data, int size);
|
2011-05-14 17:15:04 +00:00
|
|
|
extern char *buffer_readline(buffer_t *buffer);
|
|
|
|
extern char *buffer_read(buffer_t *buffer, int size);
|
|
|
|
extern void buffer_clear(buffer_t *buffer);
|
|
|
|
|
|
|
|
#endif
|