1 | /** @file
|
---|
2 | * innotek Portable Runtime - CRC32.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2006-2007 innotek GmbH
|
---|
7 | *
|
---|
8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | * available from http://www.virtualbox.org. This file is free software;
|
---|
10 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
11 | * General Public License (GPL) as published by the Free Software
|
---|
12 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
13 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
14 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 | *
|
---|
16 | * The contents of this file may alternatively be used under the terms
|
---|
17 | * of the Common Development and Distribution License Version 1.0
|
---|
18 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
19 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
20 | * CDDL are applicable instead of those of the GPL.
|
---|
21 | *
|
---|
22 | * You may elect to license modified versions of this file under the
|
---|
23 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
24 | */
|
---|
25 |
|
---|
26 | #ifndef ___iprt_crc32_h
|
---|
27 | #define ___iprt_crc32_h
|
---|
28 |
|
---|
29 | #include <iprt/cdefs.h>
|
---|
30 | #include <iprt/types.h>
|
---|
31 |
|
---|
32 |
|
---|
33 | __BEGIN_DECLS
|
---|
34 |
|
---|
35 | /** @defgroup grp_rt_crc32 RTCrc32 - CRC32 Calculation
|
---|
36 | * @ingroup grp_rt
|
---|
37 | * @{
|
---|
38 | */
|
---|
39 |
|
---|
40 | /**
|
---|
41 | * Calculate CRC32 for a memory block.
|
---|
42 | *
|
---|
43 | * @returns CRC32 for the memory block.
|
---|
44 | * @param pv Pointer to the memory block.
|
---|
45 | * @param cb Size of the memory block in bytes.
|
---|
46 | */
|
---|
47 | RTDECL(uint32_t) RTCrc32(const void *pv, size_t cb);
|
---|
48 |
|
---|
49 | /**
|
---|
50 | * Start a multiblock CRC32 calculation.
|
---|
51 | *
|
---|
52 | * @returns Start CRC32.
|
---|
53 | */
|
---|
54 | RTDECL(uint32_t) RTCrc32Start(void);
|
---|
55 |
|
---|
56 | /**
|
---|
57 | * Processes a multiblock of a CRC32 calculation.
|
---|
58 | *
|
---|
59 | * @returns Intermediate CRC32 value.
|
---|
60 | * @param uCRC32 Current CRC32 intermediate value.
|
---|
61 | * @param pv The data block to process.
|
---|
62 | * @param cb The size of the data block in bytes.
|
---|
63 | */
|
---|
64 | RTDECL(uint32_t) RTCrc32Process(uint32_t uCRC32, const void *pv, size_t cb);
|
---|
65 |
|
---|
66 | /**
|
---|
67 | * Complete a multiblock CRC32 calculation.
|
---|
68 | *
|
---|
69 | * @returns CRC32 value.
|
---|
70 | * @param uCRC32 Current CRC32 intermediate value.
|
---|
71 | */
|
---|
72 | RTDECL(uint32_t) RTCrc32Finish(uint32_t uCRC32);
|
---|
73 |
|
---|
74 |
|
---|
75 |
|
---|
76 | /** @} */
|
---|
77 |
|
---|
78 | __END_DECLS
|
---|
79 |
|
---|
80 | #endif
|
---|
81 |
|
---|