A tool for adding anime to your anidb list.
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.

41 lines
691B

  1. #ifndef _CACHE_H
  2. #define _CACHE_H
  3. #include <stdint.h>
  4. #include <stdbool.h>
  5. #include "error.h"
  6. #include "ed2k.h"
  7. struct cache_entry {
  8. uint64_t lid, fsize;
  9. char *fname;
  10. uint8_t ed2k[ED2K_HASH_SIZE];
  11. };
  12. /*
  13. * Init tha cache
  14. */
  15. enum error cache_init();
  16. /*
  17. * Free tha cache
  18. */
  19. void cache_free();
  20. /*
  21. * Add a new mylist entry to the cache
  22. */
  23. enum error cache_add(uint64_t lid, const char *fname,
  24. uint64_t fsize, const uint8_t *ed2k);
  25. /*
  26. * Get a cache entry
  27. *
  28. * out_ce can be NULL. Useful, if we only want
  29. * to check if the entry exists or not.
  30. */
  31. enum error cache_get(const char *fname, uint64_t size,
  32. struct cache_entry *out_ce);
  33. #endif /* _CACHE_H */