arsa  2.7
Classes | Macros | Functions
SDL_test_crc32.h File Reference
#include "begin_code.h"
#include "close_code.h"

Go to the source code of this file.

Classes

struct  SDLTest_Crc32Context
 

Macros

#define CrcUint32   unsigned int
 
#define CrcUint8   unsigned char
 
#define CRC32_POLY   0xEDB88320 /* Perl String::CRC32 compatible */
 

Functions

int SDLTest_Crc32Init (SDLTest_Crc32Context *crcContext)
 Initialize the CRC context. More...
 
int SDLTest_Crc32Calc (SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32)
 calculate a crc32 from a data block More...
 
int SDLTest_Crc32CalcStart (SDLTest_Crc32Context *crcContext, CrcUint32 *crc32)
 
int SDLTest_Crc32CalcEnd (SDLTest_Crc32Context *crcContext, CrcUint32 *crc32)
 
int SDLTest_Crc32CalcBuffer (SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32)
 
int SDLTest_Crc32Done (SDLTest_Crc32Context *crcContext)
 clean up CRC context More...
 

Detailed Description

Include file for SDL test framework.

This code is a part of the SDL2_test library, not the main SDL library.

Definition in file SDL_test_crc32.h.

Macro Definition Documentation

◆ CRC32_POLY

#define CRC32_POLY   0xEDB88320 /* Perl String::CRC32 compatible */

Definition at line 60 of file SDL_test_crc32.h.

◆ CrcUint32

#define CrcUint32   unsigned int

Definition at line 51 of file SDL_test_crc32.h.

◆ CrcUint8

#define CrcUint8   unsigned char

Definition at line 54 of file SDL_test_crc32.h.

Function Documentation

◆ SDLTest_Crc32Calc()

int SDLTest_Crc32Calc ( SDLTest_Crc32Context crcContext,
CrcUint8 inBuf,
CrcUint32  inLen,
CrcUint32 crc32 
)

calculate a crc32 from a data block

Parameters
crcContextpointer to context variable
inBufinput buffer to checksum
inLenlength of input buffer
crc32pointer to Uint32 to store the final CRC into
Returns
0 for OK, -1 on error

◆ SDLTest_Crc32CalcBuffer()

int SDLTest_Crc32CalcBuffer ( SDLTest_Crc32Context crcContext,
CrcUint8 inBuf,
CrcUint32  inLen,
CrcUint32 crc32 
)

◆ SDLTest_Crc32CalcEnd()

int SDLTest_Crc32CalcEnd ( SDLTest_Crc32Context crcContext,
CrcUint32 crc32 
)

◆ SDLTest_Crc32CalcStart()

int SDLTest_Crc32CalcStart ( SDLTest_Crc32Context crcContext,
CrcUint32 crc32 
)

◆ SDLTest_Crc32Done()

int SDLTest_Crc32Done ( SDLTest_Crc32Context crcContext)

clean up CRC context

Parameters
crcContextpointer to context variable
Returns
0 for OK, -1 on error

◆ SDLTest_Crc32Init()

int SDLTest_Crc32Init ( SDLTest_Crc32Context crcContext)

Initialize the CRC context.

Note: The function initializes the crc table required for all crc calculations.

Parameters
crcContextpointer to context variable
Returns
0 for OK, -1 on error