A clone of btpd with my configuration changes.
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
730 B

  1. #ifndef BTPD_STREAM_H
  2. #define BTPD_STREAM_H
  3. typedef int (*fdcb_t)(const char *, int *, void *);
  4. typedef void (*hashcb_t)(uint32_t, uint8_t *, void *);
  5. struct bt_stream {
  6. unsigned nfiles;
  7. struct mi_file *files;
  8. off_t totlen;
  9. fdcb_t fd_cb;
  10. void *fd_arg;
  11. unsigned index;
  12. off_t t_off;
  13. off_t f_off;
  14. int fd;
  15. };
  16. int bts_open(struct bt_stream **res, unsigned nfiles, struct mi_file *files,
  17. fdcb_t fd_cb, void *fd_arg);
  18. int bts_close(struct bt_stream *bts);
  19. int bts_get(struct bt_stream *bts, off_t off, uint8_t *buf, size_t len);
  20. int bts_put(struct bt_stream *bts, off_t off, const uint8_t *buf, size_t len);
  21. int bts_sha(struct bt_stream *bts, off_t start, off_t length, uint8_t *hash);
  22. #endif