chksum.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright (c) 2007-2012, Novell Inc.
  3. *
  4. * This program is licensed under the BSD license, read LICENSE.BSD
  5. * for further information
  6. */
  7. #ifndef LIBSOLV_CHKSUM_H
  8. #define LIBSOLV_CHKSUM_H
  9. #include "pool.h"
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. struct s_Chksum;
  14. typedef struct s_Chksum Chksum;
  15. Chksum *solv_chksum_create(Id type);
  16. Chksum *solv_chksum_create_clone(Chksum *chk);
  17. Chksum *solv_chksum_create_from_bin(Id type, const unsigned char *buf);
  18. void solv_chksum_add(Chksum *chk, const void *data, int len);
  19. Id solv_chksum_get_type(Chksum *chk);
  20. int solv_chksum_isfinished(Chksum *chk);
  21. const unsigned char *solv_chksum_get(Chksum *chk, int *lenp);
  22. void *solv_chksum_free(Chksum *chk, unsigned char *cp);
  23. const char *solv_chksum_type2str(Id type);
  24. Id solv_chksum_str2type(const char *str);
  25. int solv_chksum_len(Id type);
  26. int solv_chksum_cmp(Chksum *chk, Chksum *chk2);
  27. #ifdef LIBSOLV_INTERNAL
  28. #define case_CHKSUM_TYPES \
  29. case REPOKEY_TYPE_MD5: \
  30. case REPOKEY_TYPE_SHA1: \
  31. case REPOKEY_TYPE_SHA224: \
  32. case REPOKEY_TYPE_SHA256: \
  33. case REPOKEY_TYPE_SHA384: \
  34. case REPOKEY_TYPE_SHA512
  35. #endif
  36. #ifdef __cplusplus
  37. }
  38. #endif
  39. #endif /* LIBSOLV_CHKSUM_H */