A
download aglcrc.h
Language: C
Copyright: (C) 1992-1993; ALL RIGHTS RESERVED Copyright 1987-96, Bit Bucket Software Co.
LOC: 60
Project Info
BinkleyTerm XE(btxe)
Server: SourceForge
Type: cvs
...e\b\btxe\btxe\btnt\sources\
   Addr.cpp
   Addr.h
   aglcrc.cpp
   aglcrc.h
   asyn_lnx.cpp
   asyn_os2.cpp
   asyn_w32.cpp
   async.h
   asyos2v1.h
   b_banner.cpp
   b_bbs.cpp
   b_faxrcv.cpp
   b_flofil.cpp
   b_frproc.cpp
   b_help.cpp
   b_initva.cpp
   b_logs.cpp
   b_passwo.cpp
   b_proto.cpp
   b_rspfil.cpp
   b_sbinit.cpp
   b_script.cpp
   b_search.cpp
   b_sessio.cpp
   b_spawn.cpp
   b_term.cpp
   b_termov.cpp
   b_today.cpp
   b_wazoo.cpp
   b_whack.cpp
   b_wzsend.cpp
   banner.cpp
   banner.h
   BasicString.h
   bbs_ctra.cpp
   bbs_data.cpp
   bbs_incl.h
   bbs_io.cpp
   bink.h
   bink_asm.cpp
   binkdlg.cpp
   binkpipe.h
   box.h
   brec.cpp
   bsend.cpp
   bt.cpp
   btconfig.cpp
   btutil.cpp
   buffer.h
   cache.cpp
   cache.h
   callback.cpp
   callerid.cpp
   callwin.cpp
   callwin.h
   capi.cpp
   cfosline.cpp
   chat.cpp
   com.h
   com_dos.h
   com_lnx.h
   com_os2.h
   com_w32.h
   common.cpp
   cpuload.cpp
   css.cpp
   css.h
   data.cpp
   debug.cpp
   debug.h
   defines.h
   dosfuncs.cpp
   emsi.cpp
   emxmxcom.cpp
   evtparse.cpp
   evtsetup.cpp
   exceptio.cpp
   exceptio.h
   Exceptions.cpp
   Exceptions.h
   externs.h
   faxproto.h
   fcfgread.cpp
   fidomail.h
   file_all.cpp
   file_dos.cpp
   file_io.h
   file_lnx.cpp
   file_os2.cpp
   file_w32.cpp
   foffsets.h
   fossil.cpp
   freepoll.cpp
   ftsc.cpp
   gethcomm.h
   heap.cpp
   history.cpp
   history.h
   hydra.cpp
   hydra.h
   includes.cpp
   includes.h
   janus.cpp
   janus.h
   keybd.h
   keyfncs.h
   keymap.cpp
   langload.cpp
   language.h
   lngmagic.h
   m7rec.cpp
   m7send.cpp
   mailer.cpp
   mailovly.cpp
   mailroot.cpp
   maxcomm.h
   maxmcp.cpp
   maxmcp.h
   maxprm.cpp
   mdm_proc.cpp
   misc.cpp
   msgs.h
   Node.cpp
   Node.h
   NodeList.cpp
   NodeList.h
   nodeproc.cpp
   os2_pm.cpp
   outbound.cpp
   pipe.cpp
   pktmsgs.cpp
   pktmsgs.h
   protcomm.cpp
   prototyp.h
   recvbark.cpp
   recvsync.cpp
   sbuf.cpp
   sbuf.h
   sched.cpp
   sched.h
   script2.cpp
   SelfTest.cpp
   SelfTest.h
   sendbark.cpp
   sendsync.cpp
   squish.cpp
   squish.h
   srif.cpp
   statetbl.cpp
   stats.cpp
   stdafx.cpp
   stdafx.h
   timer.cpp
   timer.h
   times.cpp
   types.h
   v7debug.cpp
   version.cpp
   version7.cpp
   version7.h
   vfos_dos.cpp
   vfos_lnx.cpp
   vfos_os2.cpp
   vfos_qnx.cpp
   vfos_w32.cpp
   vfossil.h
   video.h
   vt100.cpp
   vt100.h
   xfer.h
   xmrec.cpp
   xmsend.cpp
   xstring.h
   yoohoo.cpp
   zmodem.cpp
   zmodem.h

/*---------------------------------------------------------------------------*
 *
 *                               BinkleyTerm
 *
 *              (C) Copyright 1987-96, Bit Bucket Software Co.
 *     For license and contact information see /doc/orig_260/license.260.
 *
 *           This version was modified by the BinkleyTerm XE Team.
 *        For contact information see /doc/team.lst and /doc/join.us.
 *  For a complete list of changes see /doc/xe_user.doc and /doc/xe_hist.doc.
 *
 * Filename    : $Source: /cvsroot/btxe/btnt/sources/aglcrc.h,v $
 * Revision    : $Revision: 1.1 $
 * Tagname     : $Name:  $
 * Last updated: $Date: 2005/01/01 15:18:10 $
 * State       : $State: Exp $
 * Orig. Author: Arjen Lentz, contributed by Michael Buenter
 *
 * Description : Hydra CRC definitions for BinkleyTerm
 *
 * Note        :
 *
 *   Routines for table driven CRC-16 & CRC-32, including building tables
 *   Refer to CRC.DOC for information and documentation.
 *
 *   Information collected and edited by Arjen G. Lentz
 *   Sourcecode in C and 80x86 ASM written by Arjen G. Lentz
 *   COPYRIGHT (C) 1992-1993; ALL RIGHTS RESERVED
 *
 *   CONTACT ADDRESS
 *
 *     LENTZ SOFTWARE-DEVELOPMENT   Arjen Lentz @
 *     Langegracht 7B               AINEX-BBS +31-33-633916
 *     3811 BT  Amersfoort          FidoNet 2:283/512
 *     The Netherlands              arjen_lentz@f512.n283.z2.fidonet.org
 *
 *   DISCLAIMER
 *
 *     This information is provided "as is" and comes with no warranties of
 *     any kind, either expressed or implied. It's intended to be used by
 *     programmers and developers. In no event shall the author be liable to
 *     you or anyone else for any damages, including any lost profits, lost
 *     savings or other incidental or consequential damages arising out of the
 *     use or inability to use this information.
 *
 *   LICENCE
 *
 *     This package may be freely distributed provided the files remain
 *     together, in their original unmodified form.
 *     All files, executables and sourcecode remain the copyrighted property
 *     of Arjen G. Lentz and LENTZ SOFTWARE-DEVELOPMENT.
 *     Licence for any use granted, provided this notice & CRC.DOC are
 *     included. For executable applications, credit should be given in the
 *     appropriate places in the program and documentation.
 *     These notices must be retained in any copies of any part of this
 *     documentation and/or software.
 *
 *     Any use of, or operation on (including copying/distributing) any of
 *     the above mentioned files implies full and unconditional acceptance of
 *     this licence and disclaimer.
 *
 *---------------------------------------------------------------------------*/

#ifndef __CRC_DEF_
#define __CRC_DEF_
/*#include "2types.h" */

#ifndef FAR
#ifdef __MSDOS__
#   if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__)
#      define FAR far
#   else
#      define FAR
#   endif
#else
#   define FAR
#endif
#endif

#ifdef __cplusplus
extern "C"
{
#endif

  /* --------------------------------------------------------------------- */
  /* CRC-16 used by ARC and LH, use crc16___ routines                      */
  /* --------------------------------------------------------------------- */
#define CRC16APOLY  (0xA001)    /* Generator polynomial number       */
#define CRC16AINIT  (0)         /* Initial CRC value for calculation */
#define CRC16APOST(crc) (crc)   /* CRC Postconditioning before xmit  */
#define CRC16ATEST  (0)         /* Result to test for at receiver    */

  /* --------------------------------------------------------------------- */
  /* CRC-16 CCITT proper                                                   */
  /* --------------------------------------------------------------------- */
#define CRC16POLY   (0x8408)    /* Generator polynomial number       */
#define CRC16INIT   (0xFFFF)    /* Initial CRC value for calculation */
#define CRC16POST(crc)  (~(crc))  /* CRC Postconditioning before xmit  */
#define CRC16TEST   (0xF0B8)    /* Result to test for at receiver    */

  /* --------------------------------------------------------------------- */
  /* CRC-16 CCITT upside-down                                              */
  /* --------------------------------------------------------------------- */
#define CRC16RPOLY  (0x1021)    /* Generator polynomial number       */
#define CRC16RINIT  (0)         /* Initial CRC value for calculation */
#define CRC16RPOST(crc) (crc)   /* CRC Postconditioning before xmit  */
#define CRC16RTEST  (0)         /* Result to test for at receiver    */

  /* --------------------------------------------------------------------- */
  /* CRC-32 CCITT                                                          */
  /* --------------------------------------------------------------------- */
#define CRC32POLY      (0xEDB88320L)  /* Generator polynomial number       */
#define CRC32INIT      (0xFFFFFFFFL)  /* Initial CRC value for calculation */
#define CRC32POST(crc) (~(crc)) /* CRC Postconditioning before xmit  */
#define CRC32TEST      (0xDEBB20E3L)  /* Result to test for at receiver    */

  /* --------------------------------------------------------------------- */
  /* Number of items in CRC table                                          */
  /* --------------------------------------------------------------------- */
#ifndef CRC_TINY
#define CRC_TABSIZE (256)       /* Normal 256-entry table            */
#else
#define CRC_TABSIZE (2 * 16)    /* Tiny 2x16-entry table             */
#endif

  /* --------------------------------------------------------------------- */
  /* CRC-16 proper, used for both CCITT and the one used by ARC            */
  /* --------------------------------------------------------------------- */

  /* MR 961103: added cdecl */
  void cdecl crc16init (word FAR * crctab, word poly);

  /* MR 961103: added cdecl */
  word cdecl crc16block (word FAR * crctab, word crc, byte FAR * buf, word len);

#ifndef CRC_TINY
#define crc16upd(crctab,crc,c) ((crctab)[((crc) ^ (c)) & 0xff] ^ ((crc) >> 8))
#else
  word crc16upd (word FAR * crctab, word crc, byte c);
#endif

#ifndef CRC_TINY
#define crc16rupd(crctab,crc,c) ((crctab)[(((crc) >> 8) ^ (c)) & 0xff] ^ ((crc) << 8))
#else
  word crc16rupd (word FAR * crctab, word crc, byte c);
#endif

  /* --------------------------------------------------------------------- */
  /* CRC-32                                                                */
  /* --------------------------------------------------------------------- */

  /* MR 961103: added cdecl */
  /* MR 961103: crc32int commented out (see modification of aglcrc.c
   *            done by TJW 960522) */
  /* void cdecl crc32init (ULONG FAR * crctab, ULONG poly);                */

  /* MR 961103: added cdecl */
  ULONG cdecl crc32block (ULONG FAR * crctab, ULONG crc, byte FAR * buf, word len);

#ifndef CRC_TINY
#define crc32upd(crctab,crc,c) ((crctab)[((int) (crc) ^ (c)) & 0xff] ^ ((crc) >> 8))
#else
  ULONG crc32upd (ULONG FAR * crctab, ULONG crc, byte c);
#endif

#ifdef __cplusplus
}

#endif
#endif                          /* __CRC_DEF_ */

/* $Id: aglcrc.h,v 1.1 2005/01/01 15:18:10 vildanov Exp $ */

About Koders | Resources | Downloads | Support | Black Duck | Terms of Service | DMCA | Privacy Policy | Contact Us