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.

38 line
812 B

  1. #ifndef BTPD_METAINFO_H
  2. #define BTPD_METAINFO_H
  3. struct mi_file {
  4. char *path;
  5. off_t length;
  6. };
  7. struct mi_tier {
  8. int nurls;
  9. char **urls;
  10. };
  11. struct mi_announce {
  12. int ntiers;
  13. struct mi_tier *tiers;
  14. };
  15. char *mi_name(const char *p);
  16. uint8_t *mi_info_hash(const char *p, uint8_t *hash);
  17. uint8_t *mi_hashes(const char *p);
  18. int mi_simple(const char *p);
  19. size_t mi_npieces(const char *p);
  20. off_t mi_total_length(const char *p);
  21. off_t mi_piece_length(const char *p);
  22. struct mi_announce *mi_announce(const char *p);
  23. void mi_free_announce(struct mi_announce *ann);
  24. size_t mi_nfiles(const char *p);
  25. struct mi_file *mi_files(const char *p);
  26. void mi_free_files(unsigned nfiles, struct mi_file *files);
  27. int mi_test(const char *p, size_t size);
  28. char *mi_load(const char *path, size_t *size);
  29. #endif