home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1999 February / MACPOWER-1999-02.ISO.7z / MACPOWER-1999-02.ISO / 9902⁄AMUG / UTILITY / mac06-0.95.sit / mac06-0.95 / usr / include / termios.h < prev    next >
Text File  |  1998-09-23  |  3KB  |  138 lines

  1. /* mac06ゥ1998 by HNS/DSITRI hns@computer.org
  2. ** termios.h
  3. */
  4.  
  5. #pragma once
  6.  
  7. /* baud rates */
  8.  
  9. #define    B0        0
  10. #define B50        50
  11. #define    B75        75
  12. #define B110    110
  13. #define B134    134
  14. #define B150    150
  15. #define    B200    200
  16. #define B300    300
  17. #define B600    600
  18. #define B1200    1200
  19. #define B1800    1800
  20. #define B2400    2400
  21. #define B4800    4800
  22. #define B9600    9600
  23. #define B19200    19200
  24. #define B38400    38400
  25. #define B56000    56000
  26. #define B115000    115000
  27.  
  28. /* input flags */
  29.  
  30. #define BRKINT        0x0001
  31. #define IGNBRK        0x0002
  32. #define IGNPAR        0x0004
  33. #define PARMRK        0x0008
  34. #define INPCK        0x0010
  35. #define ISTRIP        0x0020
  36. #define INLCR        0x0040
  37. #define IGNCR        0x0080
  38. #define ICRNL        0x0100
  39. #define IXON        0x0200
  40. #define IXOFF        0x0400
  41.  
  42. /* output flags */
  43.  
  44. #define OPOST        0x0001
  45. /* control flags */
  46.  
  47. #define CLOCAL        0x0001
  48. #define CREAD        0x0002
  49. #define CSIZE        0x000c
  50. #define CSTOPB        0x0010
  51. #define HUPCL        0x0020
  52. #define PARENB        0x0040
  53. #define PARODD        0x0080
  54.  
  55. /* values for CSIZE */
  56.  
  57. #define CS5            0x0000
  58. #define CS6            0x0004
  59. #define CS7            0x0008
  60. #define CS8            0x000c
  61.  
  62. /* local flags */
  63.  
  64. #define ECHO        0x0001
  65. #define ECHOE        0x0002
  66. #define ECHOK        0x0004
  67. #define ECHONL        0x0008
  68. #define ICANON        0x0010
  69. #define ISIG        0x0020
  70. #define NOFLSH        0x0040
  71. #define TOSTOP        0x0080
  72. #define IEXTEN        0x0100
  73.  
  74. /* control characters */
  75.  
  76. #define VINTR        0
  77. #define VQUIT        1
  78. #define VSTART        2
  79. #define VSUSP        3
  80. #define VSTOP        4
  81. /* canonical only */
  82. #define VEOF        5
  83. #define VEOL        6
  84. #define VERASE        7
  85. #define VKILL        8
  86. /* not canonical only */
  87. #define VTIME        VEOL    /* shared */
  88. #define VMIN        VEOF    /* shared */
  89. /* number of entries in control character vector */
  90. #define NCCS        9
  91.  
  92. /* parameters to tcflush() */
  93.  
  94. #define TCIFLUSH    1
  95. #define TCOFLUSH    2
  96. #define TCIOFLUSH    (TCIFLUSH|TCOFLUSH)
  97.  
  98. /* parameters to tcflow() */
  99.  
  100. #define TCIOFF        0
  101. #define TCION        1
  102. #define TCOOFF        2
  103. #define TCOON        3
  104.  
  105. /* parameters to tcsetattr() */
  106.  
  107. #define TCSADRAIN    0
  108. #define TCSAFLUSH    1
  109. #define TCSANOW        2
  110.  
  111. typedef unsigned char cc_t[NCCS];
  112. typedef unsigned long speed_t;
  113. typedef unsigned short tcflag_t;    /* up to 16 flags */
  114.  
  115. struct termios
  116.     {
  117.     tcflag_t c_iflag;    /* input flags */
  118.     tcflag_t c_oflag;    /* output flags */
  119.     tcflag_t c_cflag;    /* control flags */
  120.     tcflag_t c_lflag;    /* local flags */
  121.     speed_t    __ispeed;
  122.     speed_t __ospeed;
  123.     cc_t c_cc;
  124.     };
  125.  
  126. speed_t cfgetispeed(const struct termios *ptr);
  127. speed_t cfgetospeed(const struct termios *ptr);
  128. int cfsetispeed(struct termios *ptr, speed_t spd);
  129. int cfsetospeed(struct termios *ptr, speed_t spd);
  130.  
  131. int tcdrain(int fd);
  132. int tcflow(int fd, int action);
  133. int tcflush(int fd, int option);
  134. int tcsendbreak(int fd, int duration);
  135. int tcgetattr(int fd, struct termios *ptr);
  136. int tcsetattr(int fd, int option, struct termios *ptr);
  137.  
  138. /* EOF */