Back to index

citadel  8.12
crc16.h
Go to the documentation of this file.
00001 /****************************************************************************
00002 
00003   Filename:     crc16.h
00004   Description:  Cyclic Redundancy Check 16 functions
00005   Created:      24-Feb-1999
00006 
00007   Copyright (c) 2002-2003, Indigo Systems Corporation
00008   All rights reserved.
00009 
00010   Redistribution and use in source and binary forms, with or without
00011   modification, are permitted provided that the following conditions are met:
00012 
00013   Redistributions of source code must retain the above copyright notice, this
00014   list of conditions and the following disclaimer.
00015 
00016   Redistributions in binary form must reproduce the above copyright notice,
00017   this list of conditions and the following disclaimer in the documentation
00018   and/or other materials provided with the distribution.
00019 
00020   Neither the name of the Indigo Systems Corporation nor the names of its
00021   contributors may be used to endorse or promote products derived from this
00022   software without specific prior written permission.
00023 
00024   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00025   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00026   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00027   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
00028   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00029   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00030   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00031   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00032   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00033   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
00034   THE POSSIBILITY OF SUCH DAMAGE.
00035 
00036 ****************************************************************************/
00037 
00038 #define _CRC16_BYTES 1             /* ig */
00039 
00040 #ifndef __CRC16_H__
00041 #define __CRC16_H__
00042 
00043 #ifdef __cplusplus
00044 extern "C"
00045 {
00046 #endif
00047 
00048 typedef unsigned short CRC16;
00049 
00050 #ifdef _OPT_SIZE
00051     int ByteCRC16(int value, int crcin);
00052 #else
00053     CRC16 CalcCRC16Words(unsigned int count, short *buffer);
00054 #endif
00055 
00056 #ifdef _CRC16_BYTES
00057     CRC16 CalcCRC16Bytes(unsigned int count, char *buffer);
00058 #endif
00059 
00060 #ifdef __cplusplus
00061 }
00062 #endif
00063 
00064 #endif /* __CRC16_H__ */
00065 
00066 
00067