You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
770 B
38 lines
770 B
#ifndef __BUFFER_H__
|
|
#define __BUFFER_H__
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
#include <time.h>
|
|
#include <glib.h>
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
struct poller;
|
|
|
|
|
|
|
|
struct streambuf {
|
|
GString *buf;
|
|
int fd;
|
|
struct poller *poller;
|
|
time_t active;
|
|
};
|
|
|
|
|
|
|
|
struct streambuf *streambuf_new(struct poller *, int);
|
|
void streambuf_destroy(struct streambuf *);
|
|
int streambuf_writeable(struct streambuf *);
|
|
int streambuf_readable(struct streambuf *);
|
|
char *streambuf_getline(struct streambuf *);
|
|
unsigned int streambuf_bufsize(struct streambuf *);
|
|
void streambuf_printf(struct streambuf *, const char *, ...) __attribute__ ((format (printf, 2, 3)));
|
|
void streambuf_vprintf(struct streambuf *, const char *, va_list);
|
|
void streambuf_write(struct streambuf *, const char *, unsigned int);
|
|
|
|
|
|
#endif
|