rpm 5.2.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

crc.h
Go to the documentation of this file.
1
5 #include <sys/types.h>
6 #include <rpmiotypes.h>
7
8 #ifndef _CRC_H
9 #define _CRC_H
10
13 typedef struct {
14 rpmuint32_t crc;
15 rpmuint32_t (*update) (rpmuint32_t crc, const rpmuint8_t * data, size_t size);
16 rpmuint32_t (*combine) (rpmuint32_t crc1, rpmuint32_t crc2, size_t len2);
17 } sum32Param;
18
21 typedef struct {
22 rpmuint64_t crc;
23 rpmuint64_t (*update) (rpmuint64_t crc, const rpmuint8_t * data, size_t size);
24 rpmuint64_t (*combine) (rpmuint64_t crc1, rpmuint64_t crc2, size_t len2);
25 } sum64Param;
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
33 rpmuint32_t __crc32(rpmuint32_t crc, const rpmuint8_t * data, size_t size)
34 /*@*/;
35
38 rpmuint32_t __crc32_combine(rpmuint32_t crc1, rpmuint32_t crc2, size_t len2)
39 /*@*/;
40
43 rpmuint64_t __crc64(rpmuint64_t crc, const rpmuint8_t * data, size_t size)
44 /*@*/;
45
48 rpmuint64_t __crc64_combine(rpmuint64_t crc1, rpmuint64_t crc2, size_t len2)
49 /*@*/;
50
53 rpmuint32_t __adler32(rpmuint32_t adler, const rpmuint8_t * buf, rpmuint32_t len)
54 /*@*/;
55
58 rpmuint32_t __adler32_combine(rpmuint32_t adler1, rpmuint32_t adler2, size_t len2)
59 /*@*/;
60
63 int sum32Reset(sum32Param * mp)
64 /*@modifies *mp @*/;
65
68 int sum32Update(sum32Param * mp, const rpmuint8_t * data, size_t size)
69 /*@modifies *mp @*/;
70
73 int sum32Digest(sum32Param * mp, rpmuint8_t * data)
74 /*@modifies *mp, data @*/;
75
78 int sum64Reset(sum64Param * mp)
79 /*@modifies *mp @*/;
80
83 int sum64Update(sum64Param * mp, const rpmuint8_t * data, size_t size)
84 /*@modifies *mp @*/;
85
88 int sum64Digest(sum64Param * mp, rpmuint8_t * data)
89 /*@modifies *mp, data @*/;
90
91 #ifdef __cplusplus
92 }
93 #endif
94
95 #endif /* _CRC_H */