home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / snip9707.zip / MODEMIO.H < prev    next >
C/C++ Source or Header  |  1997-07-05  |  2KB  |  85 lines

  1. /* +++Date last modified: 05-Jul-1997 */
  2.  
  3. /*                                           */
  4. /* This source is released to the Public     */
  5. /* domain on December 16, 1992.              */
  6. /*                                           */
  7. /* Curtis Paris                              */
  8. /* Internet: cparis@comtch.spk.wa.usa        */
  9. /*                                           */
  10.  
  11. #ifndef MODEMIO__H
  12. #define MODEMIO__H
  13.  
  14. #include "pchwio.h"
  15.  
  16. #define MAX_BUFFER 1024 /* Max Input Buffer */
  17.  
  18. #define I8088_IMR  0x21
  19. #define XON        0x11
  20. #define XOFF       0x13
  21.  
  22. #ifdef MODEMIO_INIT
  23.  
  24. /*** Modem Buffer Information ***/
  25. int           modem_buffer_count=0;
  26. unsigned char modem_buffer[MAX_BUFFER];
  27. int           modem_buffer_head=0,
  28.               modem_buffer_tail=0;
  29.  
  30. /*** Misc. Modem Status Information ***/
  31. int modem_rts_cts=1;   /* RTS/CTS variable 0=Off, 1=On */
  32. int modem_xon_xoff=1;  /* XON/XOFF variable 0=off, 1=on */
  33. int modem_open=0;      /* IS the port open variable, do not change */
  34. int modem_port=0;      /* What port is it on, 1-5 */
  35. int modem_base=0;      /* The ports BASE address */
  36. int modem_irq =0;      /* The IRQ */
  37. int modem_vect=0;      /* The Interrupt Vector */
  38. int modem_overflow=0;  /* Modem Overflow Alert */
  39. int modem_pause=0;     /* Is it paused for XON/XOFF */
  40.  
  41. /*** Old Port Interrupt Holders ***/
  42. int old_modem_lcr, old_modem_imr,
  43.     old_modem_ier, old_modem_status;
  44.  
  45. #else
  46.  
  47. /*** Modem Buffer Information ***/
  48. extern int           modem_buffer_count;
  49. extern unsigned char modem_buffer[MAX_BUFFER];
  50. extern int           modem_buffer_head,
  51.                      modem_buffer_tail;
  52.  
  53. /*** Misc. Modem Status Information ***/
  54. extern int modem_rts_cts;
  55. extern int modem_xon_xoff;
  56. extern int modem_open;
  57. extern int modem_port;
  58. extern int modem_base;
  59. extern int modem_vect;
  60. extern int modem_overflow;
  61. extern int modem_pause;
  62.  
  63. /*** Old Port Interrupt Holders ***/
  64. extern int old_modem_lcr, old_modem_imr,
  65.        old_modem_ier, old_modem_status;
  66.  
  67. #endif
  68.  
  69. int com_carrier(void);
  70.  
  71. int  com_ch_ready(void);
  72. int  com_read_ch(void);
  73. void com_send_ch(unsigned char ch);
  74.  
  75. void com_parity(char p);
  76. void com_data_bits(unsigned char bits);
  77. void com_stop_bits(unsigned char bits);
  78. void com_speed(long speed);
  79.  
  80. int com_open(int comport, long speed, int data_bit, unsigned char parity,
  81.       unsigned char stop_bit);
  82. void com_close(void);
  83.  
  84. #endif /* MODEMIO__H */
  85.