ctorrent stat collector
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.

31 lines
838B

  1. #ifndef _LINEBUFFER_H_
  2. #define _LINEBUFFER_H_
  3. #include <stdarg.h>
  4. struct linebuffer {
  5. unsigned int size;
  6. unsigned int pos;
  7. char *newline;
  8. char *data;
  9. };
  10. struct linebuffer * create_linebuffer(int size);
  11. void linebuffer_free(struct linebuffer *buf);
  12. int linebuffer_clear(struct linebuffer *buf);
  13. int linebuffer_readfd(struct linebuffer *buf, int fd);
  14. int linebuffer_parsefd(struct linebuffer *buf, int fd);
  15. int linebuffer_writefd(struct linebuffer *buf, int fd);
  16. int linebuffer_put(struct linebuffer *buf, const char *src, unsigned int size);
  17. int linebuffer_vprintf(struct linebuffer *buf, const char *fmt, va_list ap);
  18. int linebuffer_printf(struct linebuffer *buf, const char *fmt, ...);
  19. char * linebuffer_getline(struct linebuffer *buf, int *len);
  20. int linebuffer_freeline(struct linebuffer *buf);
  21. #endif /* _LINEBUFFER_H_ */