02f1504b4f71a75c0856331803967e3ffe809781
[platform/upstream/libsolv.git] / src / chksum.h
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
8 #ifndef LIBSOLV_CHKSUM_H
9 #define LIBSOLV_CHKSUM_H
10
11 #include "pool.h"
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16
17 struct _Chksum;
18 typedef struct _Chksum Chksum;
19
20 Chksum *solv_chksum_create(Id type);
21 Chksum *solv_chksum_create_clone(Chksum *chk);
22 Chksum *solv_chksum_create_from_bin(Id type, const unsigned char *buf);
23 void solv_chksum_add(Chksum *chk, const void *data, int len);
24 Id solv_chksum_get_type(Chksum *chk);
25 int solv_chksum_isfinished(Chksum *chk);
26 const unsigned char *solv_chksum_get(Chksum *chk, int *lenp);
27 void *solv_chksum_free(Chksum *chk, unsigned char *cp);
28 const char *solv_chksum_type2str(Id type);
29 Id solv_chksum_str2type(const char *str);
30 int solv_chksum_len(Id type);
31
32 #ifdef LIBSOLV_INTERNAL
33
34 #define case_CHKSUM_TYPES \
35     case REPOKEY_TYPE_MD5: \
36     case REPOKEY_TYPE_SHA1: \
37     case REPOKEY_TYPE_SHA224: \
38     case REPOKEY_TYPE_SHA256: \
39     case REPOKEY_TYPE_SHA384: \
40     case REPOKEY_TYPE_SHA512
41
42 #endif
43
44 #ifdef __cplusplus
45 }
46 #endif
47
48 #endif /* LIBSOLV_CHKSUM_H */