Back to index

citadel  8.12
Defines | Typedefs | Functions
crc16.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define _CRC16_BYTES   1 /* ig */
#define __CRC16_H__

Typedefs

typedef unsigned short CRC16

Functions

CRC16 CalcCRC16Words (unsigned int count, short *buffer)
CRC16 CalcCRC16Bytes (unsigned int count, char *buffer)

Define Documentation

#define __CRC16_H__

Definition at line 41 of file crc16.h.

#define _CRC16_BYTES   1 /* ig */

Definition at line 38 of file crc16.h.


Typedef Documentation

typedef unsigned short CRC16

Definition at line 48 of file crc16.h.


Function Documentation

CRC16 CalcCRC16Bytes ( unsigned int  count,
char *  buffer 
)

Definition at line 138 of file crc16.c.

                                                       {

    int crc = 0;

    do {

       int value = *buffer++;
       crc = ByteCRC16(value, crc);
    }
       while (--count);
    return crc;
}

Here is the caller graph for this function:

CRC16 CalcCRC16Words ( unsigned int  count,
short *  buffer 
)

Definition at line 110 of file crc16.c.

                                                        {

    int crc = 0;

    do {

       int value = *buffer++;
#ifdef _BIG_ENDIAN
       crc = ByteCRC16(value >> 8, crc);
       crc = ByteCRC16(value, crc);
#else
       crc = ByteCRC16(value, crc);
       crc = ByteCRC16(value >> 8, crc);
#endif
    }
       while (--count);
    return (CRC16) crc;
}