2014-12-03 00:39:06 -08:00
|
|
|
/* Copyright (c) 2013-2014 Jeffrey Pfau
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2014-07-07 01:54:40 -07:00
|
|
|
#ifndef CRC32_H
|
|
|
|
#define CRC32_H
|
|
|
|
|
2016-12-30 17:00:22 -08:00
|
|
|
#include <mgba-util/common.h>
|
2014-07-07 01:54:40 -07:00
|
|
|
|
2016-12-26 21:01:55 -08:00
|
|
|
CXX_GUARD_START
|
|
|
|
|
2014-07-20 15:11:22 -07:00
|
|
|
struct VFile;
|
|
|
|
|
2017-09-09 10:51:40 -07:00
|
|
|
#ifndef HAVE_CRC32
|
|
|
|
uint32_t crc32(uint32_t crc, const void* buf, size_t size);
|
|
|
|
#else
|
|
|
|
#include <zlib.h>
|
|
|
|
#endif
|
|
|
|
|
2014-10-15 01:41:50 -07:00
|
|
|
uint32_t doCrc32(const void* buf, size_t size);
|
2014-07-20 15:11:22 -07:00
|
|
|
uint32_t fileCrc32(struct VFile* file, size_t endOffset);
|
2014-07-07 01:54:40 -07:00
|
|
|
|
2016-12-26 21:01:55 -08:00
|
|
|
CXX_GUARD_END
|
|
|
|
|
2014-07-07 01:54:40 -07:00
|
|
|
#endif
|