summaryrefslogtreecommitdiff
path: root/graphics/sam2p/crc32.h
blob: fe12eb73d9fdc7ed31c07654f9501150ffe30c77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* crc32.c -- Calculate CRC-32 for GZIP + PNG
 */

#ifndef CRC32_H
#define CRC32_H 1

#ifdef __GNUC__
#ifndef __clang__
#pragma interface
#endif
#endif

#include "config2.h"

#define CRC32_INITIAL ((unsigned PTS_INT32_T)0)
/** Usage:
 * unsigned PTS_INT32_T crc=CRC32_INITIAL;
 * crc=crc32(crc, "alma", 4);
 * crc=crc32(crc, "korte", 5);
 * ...
 * putchar( (char)(crc & 0xff) );
 * putchar( (char)((crc >> 8) & 0xff) );
 * putchar( (char)((crc >> 16) & 0xff) );
 * putchar( (char)((crc >> 24) & 0xff) );
 */
extern
#ifdef __cplusplus
"C"
#endif
unsigned PTS_INT32_T crc32 _((unsigned PTS_INT32_T oldcrc, char PTS_const *s, slen_t slen));

#endif /* CRC32_H */