A clone of btpd with my configuration changes.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

24 行
630 B

  1. #ifndef BTPD_IOBUF_H
  2. #define BTPD_IOBUF_H
  3. struct iobuf {
  4. uint8_t *buf;
  5. size_t size;
  6. size_t off;
  7. size_t skip;
  8. int error;
  9. };
  10. struct iobuf iobuf_init(size_t size);
  11. void iobuf_free(struct iobuf *iob);
  12. int iobuf_accommodate(struct iobuf *iob, size_t size);
  13. int iobuf_write(struct iobuf *iob, const void *data, size_t size);
  14. __attribute__((format (printf, 2, 3)))
  15. int iobuf_print(struct iobuf *iob, const char *fmt, ...);
  16. void *iobuf_find(struct iobuf *iob, const void *p, size_t plen);
  17. void iobuf_consumed(struct iobuf *iob, size_t count);
  18. #define iobuf_swrite(iob, s) iobuf_write(iob, s, sizeof(s) - 1)
  19. #endif