Debian Codegraph @

Contrib/VPatch/Source/Plugin/checksum.h

raw
1 //---------------------------------------------------------------------------
2 // checksum.h
3 //---------------------------------------------------------------------------
4 // -=* VPatch *=-
5 //---------------------------------------------------------------------------
6 // Copyright (C) 2001-2005 Koen van de Sande / Van de Sande Productions
7 //---------------------------------------------------------------------------
8 // Website: http://www.tibed.net/vpatch
9 //
10 // This software is provided 'as-is', without any express or implied
11 // warranty. In no event will the authors be held liable for any damages
12 // arising from the use of this software.
13 //
14 // Permission is granted to anyone to use this software for any purpose,
15 // including commercial applications, and to alter it and redistribute it
16 // freely, subject to the following restrictions:
17 //
18 // 1. The origin of this software must not be misrepresented; you must not
19 // claim that you wrote the original software. If you use this software
20 // in a product, an acknowledgment in the product documentation would be
21 // appreciated but is not required.
22 // 2. Altered source versions must be plainly marked as such, and must not be
23 // misrepresented as being the original software.
24 // 3. This notice may not be removed or altered from any source distribution.
25 //
26 // Reviewed for Unicode support by Jim Park -- 08/29/2007
27 // The functions return ANSI strings so we use PushStringA to push it on
28 // to the return stack correctly.
29
30 #ifndef checksum_INCLUDED
31 #define checksum_INCLUDED
32
33 #include <windows.h>
34 #include "md5.h"
35
36 /* ------------------------ CRC32 checksum calculation ----------------- */
37
38 BOOL FileCRC(HANDLE hFile, DWORD *crc);
39 void CRC32ToString(char* string, DWORD crc);
40
41 /* ------------------------ MD5 checksum calculation ----------------- */
42
43 BOOL FileMD5(HANDLE hFile, md5_byte_t digest[16]);
44 void MD5ToString(char* string, md5_byte_t checksum[16]);
45
46 #endif