vkQuake2 doxygen  1.0 dev
crc.h File Reference

Go to the source code of this file.

Functions

void CRC_Init (unsigned short *crcvalue)
 
void CRC_ProcessByte (unsigned short *crcvalue, byte data)
 
unsigned short CRC_Value (unsigned short crcvalue)
 
unsigned short CRC_Block (byte *start, int count)
 

Function Documentation

◆ CRC_Block()

unsigned short CRC_Block ( byte start,
int  count 
)

Definition at line 82 of file crc.c.

83 {
84  unsigned short crc;
85 
86  CRC_Init (&crc);
87  while (count--)
88  crc = (crc << 8) ^ crctable[(crc >> 8) ^ *start++];
89 
90  return crc;
91 }

◆ CRC_Init()

void CRC_Init ( unsigned short *  crcvalue)

Definition at line 67 of file crc.c.

68 {
69  *crcvalue = CRC_INIT_VALUE;
70 }

◆ CRC_ProcessByte()

void CRC_ProcessByte ( unsigned short *  crcvalue,
byte  data 
)

Definition at line 72 of file crc.c.

73 {
74  *crcvalue = (*crcvalue << 8) ^ crctable[(*crcvalue >> 8) ^ data];
75 }

◆ CRC_Value()

unsigned short CRC_Value ( unsigned short  crcvalue)

Definition at line 77 of file crc.c.

78 {
79  return crcvalue ^ CRC_XOR_VALUE;
80 }
CRC_INIT_VALUE
#define CRC_INIT_VALUE
Definition: crc.c:28
crctable
static unsigned short crctable[256]
Definition: crc.c:31
CRC_XOR_VALUE
#define CRC_XOR_VALUE
Definition: crc.c:29
CRC_Init
void CRC_Init(unsigned short *crcvalue)
Definition: crc.c:67
count
GLint GLsizei count
Definition: qgl_win.c:128