home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 307_01 / rs232.h < prev    next >
C/C++ Source or Header  |  1990-03-20  |  2KB  |  59 lines

  1. /*
  2. HEADER:     ;
  3. TITLE:        COMX driver glue routine prototypes;
  4. VERSION:    1.0;
  5.  
  6. DESCRIPTION:    "Contains function prototypes and definitions used
  7.         to access COMX through the glue routines contained
  8.         in RS232.C";
  9.  
  10. SYSTEM:     MS-DOS v2 or later;
  11. FILENAME:    RS232.H
  12.  
  13. SEE-ALSO:    RS232.C, COMX.C;
  14. AUTHORS:    Hugh Daschbach;
  15. COMPILERS:    Microsoft v5.0,v5.1;
  16. */
  17. /*----------------------------------------------------------------------*/
  18. /* rs232.h: Function prototypes for the "glue" routines that interface
  19.  *   C functions with the COMX driver.
  20.  */
  21.  
  22. /*
  23.  * Function prototypes.
  24.  */
  25. extern    int  rs232_getc(int chan);
  26. extern    int  rs232_icount(int chan);
  27. extern    void rs232_init(int chan,    long speed, char parity,
  28.             int stopbit, int  wordlen);
  29. extern    int  rs232_ocount(int chan);
  30. extern    void rs232_prot(int chan, int prot);
  31. extern    int  rs232_putc(int chan, int c);
  32. extern    int  rs232_read(int chan, char *s, int n);
  33. extern    void rs232_speed(int chan, long speed);
  34. extern    int  rs232_status(int chan);
  35. extern    int  rs232_write(int chan, char *s, int n);
  36.  
  37. /*
  38.  * Line status codes - rs232_getc() or rs232_stat().
  39.  */
  40. #define LSR_RDA  0x0100     /* receive data available        */
  41. #define LSR_OR     0x0200     /* overrun error            */
  42. #define LSR_PE     0x0400     /* parity error             */
  43. #define LSR_FE     0x0800     /* framing error            */
  44. #define LSR_BI     0x1000     /* break interupt            */
  45. #define LSR_TBA  0x2000     /* transmit holding buffer available    */
  46. #define LSR_TSRE 0x4000     /* transmit shift buffer empty        */
  47. #define LSR_TO     0x8000     /* no data available (time out)     */
  48.  
  49.             /* Modem status returned only from rs232_stat() */
  50. #define MSR_DCTS 0x00001    /* delta clear to send            */
  51. #define MSR_DDSR 0x00002    /* delta data set ready         */
  52. #define MSR_TERI 0x00004    /* trailing edge ring indicator     */
  53. #define MSR_DCD  0x00008    /* carrier detect            */
  54. #define MSR_CTS  0x00010    /* clear to send            */
  55. #define MSR_DSR  0x00020    /* data set ready            */
  56. #define MSR_RI     0x00040    /* ring indicator            */
  57. #define MSR_CD     0x00080    /* carrier detect            */
  58.  
  59.