home *** CD-ROM | disk | FTP | other *** search
/ Zodiac Super OZ / MEDIADEPOT.ISO / FILES / 13 / DJCRX201.ZIP / include / termios.h < prev    next >
C/C++ Source or Header  |  1996-09-15  |  4KB  |  146 lines

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. #ifndef __dj_include_sys_termios_h_
  3. #define __dj_include_sys_termios_h_
  4.  
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8.  
  9. #ifndef __dj_ENFORCE_ANSI_FREESTANDING
  10.  
  11. #ifndef __STRICT_ANSI__
  12.  
  13. #define B0    0x00000000
  14. #define B50    0x00000001
  15. #define B75    0x00000002
  16. #define B110    0x00000003
  17. #define B134    0x00000004
  18. #define B150    0x00000005
  19. #define B200    0x00000006
  20. #define B300    0x00000007
  21. #define B600    0x00000008
  22. #define B1200    0x00000009
  23. #define B1800    0x0000000a
  24. #define B2400    0x0000000b
  25. #define B4800    0x0000000c
  26. #define B9600    0x0000000d
  27. #define B19200    0x0000000e
  28. #define B38400    0x0000000f
  29.  
  30. #define BRKINT    0x00000100
  31. #define ICRNL    0x00000200
  32. #define IGNBRK    0x00000400
  33. #define IGNCR    0x00000800
  34. #define IGNPAR    0x00001000
  35. #define INLCR    0x00002000
  36. #define INPCK    0x00004000
  37. #define ISTRIP    0x00008000
  38. #define IXOFF    0x00010000
  39. #define IXON    0x00020000
  40. #define PARMRK    0x00040000
  41.  
  42. #define OPOST    0x00000100
  43.  
  44. #define CLOCAL    0x00000100
  45. #define CREAD    0x00000200
  46. #define CS5    0x00000000
  47. #define CS6    0x00000400
  48. #define CS7    0x00000800
  49. #define CS8    0x00000c00
  50. #define CSIZE    0x00000c00
  51. #define CSTOPB    0x00001000
  52. #define HUPCL    0x00002000
  53. #define PARENB    0x00004000
  54. #define PARODD    0x00008000
  55.  
  56. #define ECHO    0x00000100
  57. #define ECHOE    0x00000200
  58. #define ECHOK    0x00000400
  59. #define ECHONL    0x00000800
  60. #define ICANON    0x00001000
  61. #define IEXTEN    0x00002000
  62. #define ISIG    0x00004000
  63. #define NOFLSH    0x00008000
  64. #define TOSTOP    0x00010000
  65.  
  66. #define TCIFLUSH    1
  67. #define TCOFLUSH    2
  68. #define TCIOFLUSH    3
  69. #define TCOOFF        1
  70. #define TCOON        2
  71. #define TCIOFF        3
  72. #define TCION        4
  73.  
  74. #define TCSADRAIN    1
  75. #define TCSAFLUSH    2
  76. #define TCSANOW        3
  77.  
  78. #define VEOF    1
  79. #define VEOL    2
  80. #define VERASE    3
  81. #define VINTR    4
  82. #define VKILL    5
  83. #define VMIN    6
  84. #define VQUIT    7
  85. #define VSTART    8
  86. #define VSTOP    9
  87. #define VSUSP    10
  88. #define VTIME    11
  89. #define NCCS    12
  90.  
  91. typedef unsigned cc_t;
  92. typedef unsigned speed_t;
  93. typedef unsigned tcflag_t;
  94.  
  95. struct termios {
  96.   cc_t        c_cc[NCCS];
  97.   tcflag_t    c_cflag;
  98.   tcflag_t    c_iflag;
  99.   tcflag_t    c_lflag;
  100.   tcflag_t    c_oflag;
  101.   speed_t    c_ispeed;
  102.   speed_t    c_ospeed;
  103. };
  104.  
  105. speed_t    cfgetispeed(const struct termios *_termios_p);
  106. speed_t    cfgetospeed(const struct termios *_termios_p);
  107. int    cfsetispeed(struct termios *_termios_p, speed_t _speed);
  108. int    cfsetospeed(struct termios *_termios_p, speed_t _speed);
  109. int    tcdrain(int _fildes);
  110. int    tcflow(int _fildes, int _action);
  111. int    tcflush(int _fildes, int _queue_selector);
  112. int    tcgetattr(int _fildes, struct termios *_termios_p);
  113. int    tcsendbreak(int _fildes, int _duration);
  114. int    tcsetattr(int _fildes, int _optional_actions, const struct termios *_termios_p);
  115.  
  116. #ifndef _POSIX_SOURCE
  117.  
  118. /* Input flags */
  119. #define IMAXBEL    0x01000000    /* ring bell on input queue full */
  120.  
  121. /* Local flags */
  122. #define ECHOKE    0x01000000    /* visual erase for line kill */
  123. #define ECHOCTL    0x02000000    /* echo control chars as ^x */
  124.  
  125. /* Output flags */
  126. #define ONLCR    0x00000200    /* map NL to CRNL */
  127. #define OCRNL    0x00000400    /* map CR to NL */
  128. #define ONOEOT    0x00000800    /* discard EOT's (^D) on output */
  129.  
  130. /* for compatibility */
  131. void    cfmakeraw(struct termios *_termios_p);
  132. int    cfsetspeed(struct termios *_termios_p, speed_t _speed);
  133.  
  134. #endif /* !_POSIX_SOURCE */
  135. #endif /* !__STRICT_ANSI__ */
  136. #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
  137.  
  138. #ifndef __dj_ENFORCE_FUNCTION_CALLS
  139. #endif /* !__dj_ENFORCE_FUNCTION_CALLS */
  140.  
  141. #ifdef __cplusplus
  142. }
  143. #endif
  144.  
  145. #endif /* !__dj_include_sys_termios_h_ */
  146.