home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / bbs_mail / bsrc_250.arj / COM_DOS.H < prev    next >
C/C++ Source or Header  |  1991-09-15  |  12KB  |  191 lines

  1. /*--------------------------------------------------------------------------*/
  2. /*                                                                          */
  3. /*                                                                          */
  4. /*      ------------         Bit-Bucket Software, Co.                       */
  5. /*      \ 10001101 /         Writers and Distributors of                    */
  6. /*       \ 011110 /          Freely Available<tm> Software.                 */
  7. /*        \ 1011 /                                                          */
  8. /*         ------                                                           */
  9. /*                                                                          */
  10. /*  (C) Copyright 1987-91, Bit Bucket Software Co., a Delaware Corporation. */
  11. /*                                                                          */
  12. /*                                                                          */
  13. /*           Communications (FOSSIL) definitions for BinkleyTerm            */
  14. /*                                                                          */
  15. /*                                                                          */
  16. /*    For complete  details  of the licensing restrictions, please refer    */
  17. /*    to the License  agreement,  which  is published in its entirety in    */
  18. /*    the MAKEFILE and BT.C, and also contained in the file LICENSE.250.    */
  19. /*                                                                          */
  20. /*    USE  OF THIS FILE IS SUBJECT TO THE  RESTRICTIONS CONTAINED IN THE    */
  21. /*    BINKLEYTERM  LICENSING  AGREEMENT.  IF YOU DO NOT FIND THE TEXT OF    */
  22. /*    THIS  AGREEMENT IN ANY OF THE  AFOREMENTIONED FILES,  OR IF YOU DO    */
  23. /*    NOT HAVE THESE FILES,  YOU  SHOULD  IMMEDIATELY CONTACT BIT BUCKET    */
  24. /*    SOFTWARE CO.  AT ONE OF THE  ADDRESSES  LISTED BELOW.  IN NO EVENT    */
  25. /*    SHOULD YOU  PROCEED TO USE THIS FILE  WITHOUT HAVING  ACCEPTED THE    */
  26. /*    TERMS  OF  THE  BINKLEYTERM  LICENSING  AGREEMENT,  OR  SUCH OTHER    */
  27. /*    AGREEMENT AS YOU ARE ABLE TO REACH WITH BIT BUCKET SOFTWARE, CO.      */
  28. /*                                                                          */
  29. /*                                                                          */
  30. /* You can contact Bit Bucket Software Co. at any one of the following      */
  31. /* addresses:                                                               */
  32. /*                                                                          */
  33. /* Bit Bucket Software Co.        FidoNet  1:104/501, 1:343/491             */
  34. /* P.O. Box 460398                AlterNet 7:491/0                          */
  35. /* Aurora, CO 80046               BBS-Net  86:2030/1                        */
  36. /*                                Internet f491.n343.z1.fidonet.org         */
  37. /*                                                                          */
  38. /* Please feel free to contact us at any time to share your comments about  */
  39. /* our software and/or licensing policies.                                  */
  40. /*                                                                          */
  41. /*--------------------------------------------------------------------------*/
  42.  
  43.  
  44. /*--------------------------------------------------------------------------*/
  45. /* MACROS that call the routines in COM_ASM                                 */
  46. /*--------------------------------------------------------------------------*/
  47. extern  unsigned Com_           (char, byte);
  48. extern  unsigned Cominit        (int, int);
  49. extern  int      READBYTE();
  50. /*#define M_INSTALL(b)       {Cominit(com_port);Com_(0x0f,0);Com_(0x0f,handshake_mask);new_baud(0,b);}*/
  51.  
  52.  
  53.                            /*-----------------------------------------------*/
  54.                            /* Service 0: SET BAUD(etc)                      */
  55.                            /*-----------------------------------------------*/
  56. /*#define MDM_ENABLE(b)      (Com_(0x00,b|NO_PARITY|STOP_1|BITS_8))*/
  57.  
  58.                            /*-----------------------------------------------*/
  59.                            /* Service 1: SEND CHAR (wait)                   */
  60.                            /*-----------------------------------------------*/
  61. /*#define SENDBYTE(x)    (Com_(0x01,x))*/
  62.                            /*-----------------------------------------------*/
  63.                            /* Service 2: GET CHAR (wait)                    */
  64.                            /*-----------------------------------------------*/
  65. /*#define MODEM_IN()         (Com_(0x02)&0x00ff)*/
  66.  
  67.                            /*-----------------------------------------------*/
  68.                            /* Service 3: GET STATUS                         */
  69.                            /*-----------------------------------------------*/
  70. /*#define MODEM_STATUS()     (Com_(0x03))*/
  71. #define CARRIER            (Com_(0x03,0)&carrier_mask)
  72. #define CHAR_AVAIL()       (MODEM_STATUS()&DATA_READY)
  73. #define OUT_EMPTY()        (Com_(0x03,0)&TX_SHIFT_EMPTY)
  74. #define OUT_FULL()         (!(Com_(0x03,0)&TX_HOLD_EMPTY))
  75.  
  76.                            /*-----------------------------------------------*/
  77.                            /* Service 4: INIT/INSTALL                       */
  78.                            /*-----------------------------------------------*/
  79.  
  80.                            /*-----------------------------------------------*/
  81.                            /* Service 5: UNINSTALL                          */
  82.                            /*-----------------------------------------------*/
  83. /*#define MDM_DISABLE()      (Com_(0x05,BAUD_2400|NO_PARITY|STOP_1|BITS_8))*/
  84.  
  85.                            /*-----------------------------------------------*/
  86.                            /* Service 6: SET DTR                            */
  87.                            /*-----------------------------------------------*/
  88. #define LOWER_DTR()        ((void) Com_(0x06,0))
  89. #define RAISE_DTR()        ((void) Com_(0x06,1))
  90.  
  91.                            /*-----------------------------------------------*/
  92.                            /* Service 7: GET TIMER TICK PARMS               */
  93.                            /*-----------------------------------------------*/
  94.  
  95.                            /*-----------------------------------------------*/
  96.                            /* Service 8: FLUSH OUTBOUND RING-BUFFER         */
  97.                            /*-----------------------------------------------*/
  98.  
  99.                            /*-----------------------------------------------*/
  100.                            /* Service 9: NUKE OUTBOUND RING-BUFFER          */
  101.                            /*-----------------------------------------------*/
  102. /*#define CLEAR_OUTBOUND()   (Com_(0x09,0))*/
  103.  
  104.                            /*-----------------------------------------------*/
  105.                            /* Service a: NUKE INBOUND RING-BUFFER           */
  106.                            /*-----------------------------------------------*/
  107. /*#define CLEAR_INBOUND()    (Com_(0x0a,0))*/
  108.  
  109.                            /*-----------------------------------------------*/
  110.                            /* Service b: SEND CHAR (no wait)                */
  111.                            /*-----------------------------------------------*/
  112. #define Com_Tx_NW(c)       (Com_(0x0b,c))
  113.  
  114.                            /*-----------------------------------------------*/
  115.                            /* Service c: GET CHAR (no wait)                 */
  116.                            /*-----------------------------------------------*/
  117. /*#define PEEKBYTE()         (Com_(0x0c,0))*/
  118.  
  119.                            /*-----------------------------------------------*/
  120.                            /* Service d: GET KEYBOARD STATUS                */
  121.                            /*-----------------------------------------------*/
  122. #ifndef MILQ
  123. #define KEYPRESS()         (Com_(0x0d,0)!=(0xffff))
  124. #define FOSSIL_PEEKKB()    (Com_(0x0d,0))
  125. #endif
  126.                            /*-----------------------------------------------*/
  127.                            /* Service e: GET KEYBOARD CHARACTER (wait)      */
  128.                            /*-----------------------------------------------*/
  129. #ifndef MILQ
  130. #define READKB()           (Com_(0x0e,0)&0xff)
  131. #define READSCAN()         (Com_(0x0e,0))
  132. #endif
  133. #define FOSSIL_CHAR()      READSCAN()
  134.  
  135.                            /*-----------------------------------------------*/
  136.                            /* Service f: SET/GET FLOW CONTROL STATUS        */
  137.                            /*-----------------------------------------------*/
  138. #define XON_ENABLE()       ((void) Com_(0x0f,(byte)handshake_mask))
  139. #define XON_DISABLE()      ((void) Com_(0x0f,(byte)(handshake_mask&(~USE_XON))))
  140. #define IN_XON_ENABLE()    ((void) Com_(0x0f,(byte)(handshake_mask|OTHER_XON)))
  141. #define IN_XON_DISABLE()   ((void) Com_(0x0f,(byte)(handshake_mask&(~OTHER_XON))))
  142.  
  143.                            /*-----------------------------------------------*/
  144.                            /* Service 10: SET/GET CTL-BREAK CONTROLS        */
  145.                            /*             Note that the "break" here refers */
  146.                            /*             to ^C and ^K rather than the      */
  147.                            /*             tradition modem BREAK.            */
  148.                            /*-----------------------------------------------*/
  149. #define _BRK_ENABLE()      (Com_(0x10,BRK))
  150. #define _BRK_DISABLE()     (Com_(0x10,0))
  151. #define RECVD_BREAK()      (Com_(0x10,BRK)&BRK)
  152.  
  153.                            /*-----------------------------------------------*/
  154.                            /* Service 11: SET LOCAL VIDEO CURSOR POSITION   */
  155.                            /*-----------------------------------------------*/
  156.  
  157.                            /*-----------------------------------------------*/
  158.                            /* Service 12: GET LOCAL VIDEO CURSOR POSITION   */
  159.                            /*-----------------------------------------------*/
  160.  
  161.                            /*-----------------------------------------------*/
  162.                            /* Service 13: WRITE LOCAL ANSI CHARACTER        */
  163.                            /*-----------------------------------------------*/
  164. #ifndef MILQ
  165. #define WRITE_ANSI(c)    ((void) Com_(0x13,(byte)(c)))
  166. #endif
  167.                            /*-----------------------------------------------*/
  168.                            /* Service 14: WATCHDOG on/off                   */
  169.                            /*-----------------------------------------------*/
  170. #define FOSSIL_WATCHDOG(x) (Com_(0x14,x))
  171.                            /*-----------------------------------------------*/
  172.                            /* Service 15: BIOS write to screen              */
  173.                            /*-----------------------------------------------*/
  174. #ifndef MILQ
  175. #define WRITE_BIOS(c) (Com_(0x15,(byte)c))
  176. #endif
  177.  
  178. /*--------------------------------------------------------------------------*/
  179. /*                                                                          */
  180. /* A no-stall ReadByte routine might look like this:                        */
  181. /*                                                                          */
  182. /*    int READBYTE()                                                        */
  183. /*       {                                                                  */
  184. /*       return( CHAR_AVAIL() ? MODEM_IN() : (-1) );                        */
  185. /*       }                                                                  */
  186. /*                                                                          */
  187. /*--------------------------------------------------------------------------*/
  188.  
  189. /* END OF FILE: com.h */
  190.  
  191.