home *** CD-ROM | disk | FTP | other *** search
/ Super Net 1 / SUPERNET_1.iso / PC / OTROS / EXTRAS / UUCODE / UUPC / TEST / UPC12ES2.ZIP / UUCICO / fossil.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-11-07  |  7.5 KB  |  158 lines

  1. #ifndef FOSSIL_H
  2. #define FOSSIL_H
  3.  
  4. /*--------------------------------------------------------------------*/
  5. /*       f o s s i l . h                                              */
  6. /*                                                                    */
  7. /*       UUPC/extended defines for accessing FOSSIL functions via     */
  8. /*       INT 14 under MS-DOS.                                         */
  9. /*--------------------------------------------------------------------*/
  10.  
  11. /*--------------------------------------------------------------------*/
  12. /*    Changes Copyright (c) 1990-1993 by Kendra Electronic            */
  13. /*    Wonderworks.                                                    */
  14. /*                                                                    */
  15. /*    All rights reserved except those explicitly granted by the      */
  16. /*    UUPC/extended license agreement.                                */
  17. /*--------------------------------------------------------------------*/
  18.  
  19. /*--------------------------------------------------------------------*/
  20. /*                          RCS Information                           */
  21. /*--------------------------------------------------------------------*/
  22.  
  23. /*
  24.  *    $Id: fossil.h 1.4 1993/11/06 17:57:46 rhg Exp $
  25.  *
  26.  *    Revision history:
  27.  *    $Log: fossil.h $
  28.  * Revision 1.4  1993/11/06  17:57:46  rhg
  29.  * Drive Drew nuts by submitting cosmetic changes mixed in with bug fixes
  30.  *
  31.  * Revision 1.3  1993/10/12  01:35:12  ahd
  32.  * Normalize comments to PL/I style
  33.  *
  34.  * Revision 1.2  1993/05/30  15:27:22  ahd
  35.  * Correct CTS high macro
  36.  *
  37.  * Revision 1.1  1993/05/30  00:16:35  ahd
  38.  * Initial revision
  39.  *
  40.  */
  41.  
  42. /*--------------------------------------------------------------------*/
  43. /*       FOSSIL function calls, taken from "Fundamentals of FOSSIL    */
  44. /*       Implementation and Use:  Version 5, February 11, 1988 by     */
  45. /*       Rick Moore of Solar Wind Computing.                          */
  46. /*--------------------------------------------------------------------*/
  47.  
  48. #define FS_INTERRUPT 0x14        /* Fossil uses INT 14                 */
  49.  
  50. /*--------------------------------------------------------------------*/
  51. /*       Function calls numbers, placed in AH before interrupt        */
  52. /*--------------------------------------------------------------------*/
  53.  
  54. #define FS_SPEED     0x00        /* Set speed, parity, stop bits, char len  */
  55. #define FS_XMIT1     0x01        /* Transmit one character (blocking write)  */
  56. #define FS_RECV1     0x02        /* Receive one character (blocking read)  */
  57. #define FS_STATPORT  0x03        /* Return port status                 */
  58. #define FS_OPENPORT  0x04        /* Initialize port                    */
  59. #define FS_CLOSPORT  0x05        /* Close port                        */
  60. #define FS_DTR       0x06        /* Raise/lower DTR                    */
  61. #define FS_TIMESTAT  0x07        /* Return system timer parameters     */
  62. #define FS_XMITWAIT  0x08        /* Wait for output queue to transmit  */
  63. #define FS_XMITPURG  0X09        /* Purge output queue w/o transmit   */
  64. #define FS_RECVPURG  0x0a        /* Purge unread input queue           */
  65. #define FS_XMIT1NOW  0x0b        /* Transmit one character (nonblocking)  */
  66. #define FS_PEEK1     0x0c        /* Non-destructive port read         */
  67. #define FS_KEYBPEEK  0x0d        /* Non-destructive keyboard read     */
  68. #define FS_KEYBREAD  0x0e        /* Destructive keyboard read (blocking)  */
  69. #define FS_FLOWCNTL  0x0f        /* Enable/disable flow control        */
  70. #define FS_CNTLCHEK  0x10        /* Enable/disable Cntl-C/Cntl-K checking  */
  71. #define FS_SCURSOR   0x11        /* Set screeen cursor location        */
  72. #define FS_RCURSOR   0x12        /* Read screen cursor location        */
  73. #define FS_ANSICHAR  0x13        /* Write character with ANSI control  */
  74. #define FS_WATCHDOG  0x14        /* Auto-reboot on lost carrier        */
  75. #define FS_PUTCHAR   0x15        /* BIOS level screen put              */
  76. #define FS_TIMECHN   0x16        /* Insert/delete items on timer chain  */
  77. #define FS_REBOOT    0x17        /* Perform Vulcan nerve pinch on system  */
  78. #define FS_READBLOK  0x18        /* Read block of data from port      */
  79. #define FS_WRITBLOK  0x19        /* Write block of data to port        */
  80. #define FS_BREAK     0x1A        /* Enable/disable break on port      */
  81. #define FS_DRIVINFO  0x1B        /* Get driver information            */
  82.  
  83. typedef struct _FS_INFO {        /* Data returned by FS_DRIVINFO      */
  84.    short size;                   /* Data bytes returned               */
  85.    char  version;                /* FOSSIL specification version used  */
  86.    char  revision;               /* Driver revision level              */
  87.    char  UUFAR *id;              /* Pointer to ASCII driver id        */
  88.    short inputSize;              /* Input buffer size                 */
  89.    short inputFree;              /* Bytes free in input queue         */
  90.    short outputSize;             /* Bytes queued for output;           */
  91.    short outputFree;             /* Bytes free in output queue        */
  92.    char  width;                  /* Screen width in characters        */
  93.    char  height;                 /* Screen height in characters        */
  94.    char  baudmask;               /* Baud rate in format used by FS_SPEED  */
  95. } FS_INFO;
  96.  
  97. /*--------------------------------------------------------------------*/
  98. /*              Define macros to perform basic functions              */
  99. /*--------------------------------------------------------------------*/
  100.  
  101. #define FSSetSpeed( speed, parity, stopBits, charLen ) \
  102.          FossilCntl(FS_SPEED, (unsigned char) \
  103.                     ((speed << 5) | (parity << 3) | \
  104.                     (stopBits << 2) | charLen))
  105.  
  106. #define FS_NO_PARITY    0
  107. #define FS_NO_PARITYX   1
  108. #define FS_ODD_PARITY   2
  109. #define FS_EVEN_PARITY  3
  110.  
  111. #define FS_STOPBIT_1    0
  112. #define FS_STOPBIT_15   1           /* For five bit character only     */
  113. #define FS_STOPBIT_2    1           /* For all but five bit characters  */
  114.  
  115. #define FS_CHARLEN_5    0
  116. #define FS_CHARLEN_6    1
  117. #define FS_CHARLEN_7    2
  118. #define FS_CHARLEN_8    3
  119.  
  120. #define FSOpen( )           FossilCntl(FS_OPENPORT, 0)
  121.  
  122. #define FS_COOKIE    0x1954      /* Success result from FS_OPENPORT   */
  123.  
  124. #define FSClose( )          FossilCntl(FS_CLOSPORT, 0)
  125.  
  126. #define FSStatus( )         FossilCntl(FS_STATPORT, 0)
  127.  
  128. #define FS_STAT_OUTPEMPT   0x4000   /* Output buffer empty            */
  129. #define FS_STAT_OUTPROOM   0x2000   /* Output buffer not full         */
  130. #define FS_STAT_OVERRUN    0x0200   /* Input buffer overrun           */
  131. #define FS_STAT_INQUEUED   0x0100   /* Characters in input buffer     */
  132. #define FS_STAT_DCD        0x0080   /* Data carrier detected           */
  133.  
  134. #define FSFlushXmit( )      FossilCntl(FS_XMITPURG, 0)
  135.  
  136. #define FSFlushRecv( )      FossilCntl(FS_RECVPURG, 0)
  137.  
  138. #define FSFlowControl(type) FossilCntl(FS_FLOWCNTL, (unsigned char) (0xf0 | (type)))
  139.  
  140. #define FS_NOFLOW   0x00
  141. #define FS_XONXMIT  0x01
  142. #define FS_CTSRTS   0x04
  143. #define FS_XONRECV  0x08
  144.  
  145. #define FSDTR( onoroff )    FossilCntl(FS_DTR, onoroff)
  146.  
  147. #define FSBreak( onoroff )  FossilCntl(FS_BREAK, onoroff)
  148.  
  149. /*--------------------------------------------------------------------*/
  150. /*        Define information for routines and data in fossil.c        */
  151. /*--------------------------------------------------------------------*/
  152.  
  153. extern short portNum;        /* Must be set by openline()              */
  154.  
  155. short FossilCntl( const char function, const unsigned char info );
  156.  
  157. #endif
  158.