A clone of btpd with my configuration changes.
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.

29 line
681 B

  1. #ifndef BTPD_METAINFO_H
  2. #define BTPD_METAINFO_H
  3. struct fileinfo {
  4. char *path;
  5. off_t length;
  6. };
  7. struct metainfo {
  8. char *name;
  9. char *announce;
  10. uint8_t info_hash[20];
  11. uint8_t (*piece_hash)[20];
  12. unsigned pieces_off;
  13. uint32_t npieces;
  14. off_t piece_length;
  15. off_t total_length;
  16. unsigned nfiles;
  17. struct fileinfo *files;
  18. };
  19. int fill_fileinfo(const char *fdct, struct fileinfo *fip);
  20. int fill_metainfo(const char *base, struct metainfo *mip, int mem_hashes);
  21. void clear_metainfo(struct metainfo *mip);
  22. void print_metainfo(struct metainfo *mip);
  23. int load_metainfo(const char *path, off_t size, int mem_hashes, struct metainfo **res);
  24. #endif