home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 199.lha / GimmeLib / communic.h < prev    next >
C/C++ Source or Header  |  1988-12-27  |  2KB  |  55 lines

  1. #ifndef GIMMELIB_COMMUNIC_H
  2. #define GIMMELIB_COMMUNIC_H
  3.  
  4.  
  5. #ifdef I_AM_COMMUNIC
  6. /* internal constants */
  7. #ifndef MILLION
  8. #define MILLION     1000000L
  9. #endif
  10. #define SMALL_SECS    0L        /* "small" time-out */
  11. #define SMALL_MICROS    (MILLION / 2)
  12. #define BIG_SECS    2L        /* "large" time-out */
  13. #define BIG_MICROS    0L
  14.  
  15. #define DEFAULT_EOL    0x0d        /* CR */
  16. #endif I_AM_COMMUNIC
  17.  
  18.  
  19. /* Constants used for setup parameters */
  20. #define C_SER_7     1    /* 7 wire handshaking */
  21. #define C_SER_3     2    /* 3 wire XON/XOFF handshaking */
  22.  
  23. #define C_NO_PARITY    1    /* No parity */
  24. #define C_EVEN_PARITY    2    /* Even parity */
  25. #define C_ODD_PARITY    3    /* Odd parity */
  26.  
  27. /* Setup parameter structure */
  28. typedef struct c_parameters {
  29.     WORD C_MODE;        /* Mode of communications to be used */
  30.     WORD C_BAUD;
  31.     WORD C_STOP;
  32.     WORD C_PARITY;
  33.     WORD C_RLEN;
  34.     WORD C_WLEN;
  35. } SERPARMS;
  36.  
  37. /* Error Condition values */
  38. #define C_ERR_OK    0    /* No error occured */
  39. #define C_ERR_INITIAL    1    /* System not initialized */
  40. #define C_ERR_OPEN    2    /* Channel already opened */
  41. #define C_ERR_CANT    3    /* Can't open channel */
  42. #define C_ERR_PARAMS    4    /* Can't set parameters as specified */
  43. #define C_ERR_CHAN    5    /* Channel not open */
  44. #define C_ERR_GET    6    /* Timeout before character recieved */
  45. #define C_ERR_PUT    7    /* Can't send character */
  46. #define C_ERR_PARITY    8    /* Parity specified is not valid */
  47. #define C_ERR_ILLEGAL    9    /* Illegal length parameter for get/put s */
  48. #define C_ERR_BADPARM    10    /* Invalid parameter given to routine */
  49.  
  50. #ifndef I_AM_COMMUNIC
  51. extern short c_error;        /* error number of last communic routine */
  52. #endif !I_AM_COMMUNIC
  53.  
  54. #endif !GIMMELIB_COMMUNIC_H
  55.