3 * Functions and types for CRC checks.
5 * Generated on Wed Mar 18 14:12:15 2009,
6 * by pycrc v0.7, http://www.tty1.net/pycrc/
7 * using the configuration:
14 * Algorithm = table-driven
17 * Modified 2009-03-16 not to include <stdint.h> as our Win32 environment
18 * appears not to have it; we're using GLib types, instead.
19 *****************************************************************************/
20 #ifndef __CRC____PLAIN_H__
21 #define __CRC____PLAIN_H__
31 * The definition of the used algorithm.
32 *****************************************************************************/
33 #define CRC_ALGO_TABLE_DRIVEN 1
36 * The type of the CRC values.
38 * This type must be big enough to contain at least 16 bits.
39 *****************************************************************************/
40 typedef guint16 crc16_plain_t;
43 * Reflect all bits of a \a data word of \a data_len bytes.
45 * \param data The data word to be reflected.
46 * \param data_len The width of \a data expressed in number of bits.
47 * \return The reflected data.
48 *****************************************************************************/
49 long crc16_plain_reflect(long data, size_t data_len);
52 * Calculate the initial crc value.
54 * \return The initial crc value.
55 *****************************************************************************/
56 static inline crc16_plain_t crc16_plain_init(void)
62 * Update the crc value with new data.
64 * \param crc The current crc value.
65 * \param data Pointer to a buffer of \a data_len bytes.
66 * \param data_len Number of bytes in the \a data buffer.
67 * \return The updated crc value.
68 *****************************************************************************/
69 crc16_plain_t crc16_plain_update(crc16_plain_t crc, const unsigned char *data, size_t data_len);
72 * Calculate the final crc value.
74 * \param crc The current crc value.
75 * \return The final crc value.
76 *****************************************************************************/
77 static inline crc16_plain_t crc16_plain_finalize(crc16_plain_t crc)
84 } /* closing brace for extern "C" */
87 #endif /* __CRC____PLAIN_H__ */