00001 /* 00002 * 00003 * This file is part of the 'NewsService Journaline(R) Decoder' 00004 * 00005 * Copyright (c) 2003, 2004 by Fraunhofer IIS, Erlangen, Germany 00006 * 00007 * -------------------------------------------------------------------- 00008 * 00009 * For NON-COMMERCIAL USE, 00010 * the 'NewsService Journaline(R) Decoder' is free software; 00011 * you can redistribute it and/or modify it under the terms of 00012 * the GNU General Public License as published by the 00013 * Free Software Foundation; either version 2 of the License, or 00014 * (at your option) any later version. 00015 * 00016 * The 'NewsService Journaline(R) Decoder' is distributed in the hope 00017 * that it will be useful, but WITHOUT ANY WARRANTY; 00018 * without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 * GNU General Public License for more details. 00021 * 00022 * You should have received a copy of the GNU General Public License 00023 * along with the 'NewsService Journaline(R) Decoder'; 00024 * if not, write to the Free Software Foundation, Inc., 00025 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00026 * 00027 * 00028 * If you use this software in a project with user interaction, please 00029 * provide the following text to the user in an appropriate place: 00030 * "Features NewsService Journaline(R) decoder technology by 00031 * Fraunhofer IIS, Erlangen, Germany. 00032 * For more information visit http://www.iis.fhg.de/dab" 00033 * 00034 * -------------------------------------------------------------------- 00035 * 00036 * To use the 'NewsService Journaline(R) Decoder' software for 00037 * COMMERCIAL purposes, please contact Fraunhofer IIS for a 00038 * commercial license (see below for contact information)! 00039 * 00040 * -------------------------------------------------------------------- 00041 * 00042 * Contact: 00043 * Fraunhofer IIS, Department 'Broadcast Applications' 00044 * Am Wolfsmantel 33, 91058 Erlangen, Germany 00045 * http://www.iis.fraunhofer.de/dab 00046 * mailto:bc-info@iis.fraunhofer.de 00047 * 00048 */ 00049 00050 00051 00070 #include <stdio.h> 00071 #include <stdlib.h> 00072 #include <assert.h> 00073 #include <malloc.h> 00074 00075 00076 #ifdef __cplusplus 00077 extern "C" 00078 { 00079 #endif /* __cplusplus */ 00080 00081 /* calculates the CRC-16 value */ 00082 unsigned short CRC_Build_16(const unsigned char *cDataPointer, 00083 const unsigned long iLength); 00084 00085 /* calculates the CRC-8 value */ 00086 unsigned char CRC_Build_8(const unsigned char *cDataPointer, 00087 const unsigned long iLength); 00088 00089 /* checks if there are errors in the received data */ 00090 char CRC_Check_16(const unsigned char *cDataPointer, 00091 const unsigned long iLength, 00092 const unsigned short iCRC_16); 00093 00094 /* checks if there are errors in the received data */ 00095 char CRC_Check_8(const unsigned char *cDataPointer, 00096 const unsigned long iLength, 00097 const unsigned char iCRC_8); 00098 00099 00100 #ifdef __cplusplus 00101 } 00102 #endif /* __cplusplus */