home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR3 / KA9Q212.ZIP / RBSB.H < prev    next >
C/C++ Source or Header  |  1993-02-07  |  3KB  |  82 lines

  1. /****************************************************************************
  2. *    Language     :    Turbo C 2.0                                                *
  3. *    Logfile        :    rbsb.h                                                    *
  4. *    Project        :    Comms library.                                            *
  5. *    Date         :    25 Jan 90                                                *
  6. *    Revision     :    1.1        GT    Originate.                                    *
  7. *    25 Oct 92    :    1.2        GT    KA9Q mods.                                    *
  8. *****************************************************************************
  9. *    Purpose        :    Prototypes and externs for rbsb.c.                        *
  10. *    $Id: rbsb.h 1.1 93/02/07 03:26:10 ROOT_DOS Exp $
  11. ****************************************************************************/
  12.  
  13. #ifndef    RBSB_H
  14. #define    RBSB_H
  15.  
  16. /****************************************************************************
  17. *    sndbrk                                                                    *
  18. *    Send break to the modem.                                                *
  19. ****************************************************************************/
  20.  
  21. void _sendbrk (void);
  22.  
  23. /****************************************************************************
  24. *    _rdchk                                                                    *
  25. *    Returns nz if something to read from remote.                            *
  26. ****************************************************************************/
  27.  
  28. int _rdchk (void);
  29.  
  30. /****************************************************************************
  31. *    _send                                                                    *
  32. *    Send some data to the remote.                                            *
  33. ****************************************************************************/
  34.  
  35. int _send (unsigned char *buf, int len);
  36.  
  37.  
  38. /****************************************************************************
  39. *    _flush                                                                    *
  40. *    Flush output.                                                            *
  41. ****************************************************************************/
  42.  
  43. void _flush (void);
  44.  
  45. /****************************************************************************
  46. *    _receive                                                                *
  47. *    Receive some data from the remote.                                        *
  48. ****************************************************************************/
  49.  
  50. int _receive (unsigned char *buf, int len);
  51.  
  52. extern unsigned short _crctab[];
  53. extern unsigned long _cr3tab[];
  54. extern int _z_socket;
  55.  
  56. /*
  57.  * updcrc macro derived from article Copyright (C) 1986 Stephen Satchell. 
  58.  *  NOTE: First srgument must be in range 0 to 255.
  59.  *        Second argument is referenced twice.
  60.  * 
  61.  * Programmers may incorporate any or all code into their programs, 
  62.  * giving proper credit within the source. Publication of the 
  63.  * source routines is permitted so long as proper credit is given 
  64.  * to Stephen Satchell, Satchell Evaluations and Chuck Forsberg, 
  65.  * Omen Technology.
  66.  */
  67.  
  68. #if    0
  69. #define updcrc(cp, crc) (_crctab[((crc >> 8) & 255)] ^ (crc << 8) ^ cp)
  70. #endif
  71.  
  72. #define updcrc(cp, crc) (_crctab[(((crc) >> 8) & 255)] ^ ((crc) << 8) ^ (cp))
  73.  
  74. #if 0
  75. #define UPDC32(b, c) (_cr3tab[((int) c ^ b) & 0xff] ^ ((c >> 8) & 0x00FFFFFFL))
  76. #endif
  77.  
  78. #define UPDC32(b, c) (_cr3tab[((unsigned) (c) ^ (b)) & 0xff] ^ (((c) >> 8) & 0x00FFFFFFL))
  79.  
  80. #endif
  81.  
  82.