Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

178 lines
4.5 KiB

  1. /*++
  2. Copyright (c) 1991-1996 Microsoft Corporation
  3. Module Name:
  4. termios.h
  5. Abstract:
  6. This module contains the primitive system data types described in section
  7. 7.1.2.1 of IEEE P1003.1-1990
  8. --*/
  9. #ifndef _TERMIOS_
  10. #define _TERMIOS_
  11. #include <sys/types.h>
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. typedef unsigned long cc_t;
  16. typedef unsigned long speed_t;
  17. typedef unsigned long tcflag_t;
  18. #define NCCS 11
  19. struct termios {
  20. tcflag_t c_iflag; /* input modes */
  21. tcflag_t c_oflag; /* output modes */
  22. tcflag_t c_cflag; /* control modes */
  23. tcflag_t c_lflag; /* local modes */
  24. speed_t c_ispeed; /* input speed */
  25. speed_t c_ospeed; /* output speed */
  26. cc_t c_cc[NCCS]; /* control characters */
  27. };
  28. /*
  29. * Input modes, for c_iflag member
  30. */
  31. #define BRKINT 0x00000001 /* signal interrupt on break */
  32. #define ICRNL 0x00000002 /* map CR to NL on input */
  33. #define IGNBRK 0x00000004 /* ignore break condition */
  34. #define IGNCR 0x00000008 /* ignore CR */
  35. #define IGNPAR 0x00000010 /* ignore characters with parity errors */
  36. #define INLCR 0x00000020 /* map NL to CR on input */
  37. #define INPCK 0x00000040 /* Enable input parity check */
  38. #define ISTRIP 0x00000080 /* strip character */
  39. #define IXOFF 0x00000100 /* enable start/stop input control */
  40. #define IXON 0x00000200 /* enable start/stop output control */
  41. #define PARMRK 0x00000400 /* mark parity errors */
  42. /*
  43. * Output modes, for c_oflag member
  44. */
  45. #define OPOST 0x00000001 /* perform output processing */
  46. #define ONLCR 0x00000002 /* map NL to ASCII CR-NL on output */
  47. #define ONLRET 0x00000004 /* NL performs ASCII CR function */
  48. #define OCRNL 0x00000008 /* map ASCII CR to NL on output */
  49. #define ONOCR 0x00000010 /* No ASCII CR output at column 0. */
  50. /*
  51. * Control modes, for c_cflag member
  52. */
  53. #define CLOCAL 0x00000001 /* ignore modem status lines */
  54. #define CREAD 0x00000002 /* enable receiver */
  55. #define CSIZE 0x000000F0 /* number of bits per byte */
  56. #define CS5 0x00000010 /* 5 bits */
  57. #define CS6 0x00000020 /* 6 bits */
  58. #define CS7 0x00000040 /* 7 bits */
  59. #define CS8 0x00000080 /* 8 bits */
  60. #define CSTOPB 0x00000100 /* send two stop bits, else one */
  61. #define HUPCL 0x00000200 /* hang up on last close */
  62. #define PARENB 0x00000400 /* parity enable */
  63. #define PARODD 0x00000800 /* odd parity, else even */
  64. /*
  65. * Local modes, for c_lflag member
  66. */
  67. #define ECHO 0x00000001 /* enable echo */
  68. #define ECHOE 0x00000002 /* echo ERASE as an error-correcting backspace */
  69. #define ECHOK 0x00000004 /* echo KILL */
  70. #define ECHONL 0x00000008 /* echo '\n' */
  71. #define ICANON 0x00000010 /* canonical input (erase and kill processing) */
  72. #define IEXTEN 0x00000020 /* enable extended functions */
  73. #define ISIG 0x00000040 /* enable signals */
  74. #define NOFLSH 0x00000080 /* disable flush after intr, quit, or suspend */
  75. #define TOSTOP 0x00000100 /* send SIGTTOU for background output */
  76. /*
  77. * Indices into c_cc array
  78. */
  79. #define VEOF 0 /* EOF character */
  80. #define VEOL 1 /* EOL character */
  81. #define VERASE 2 /* ERASE character */
  82. #define VINTR 3 /* INTR character */
  83. #define VKILL 4 /* KILL character */
  84. #define VMIN 5 /* MIN value */
  85. #define VQUIT 6 /* QUIT character */
  86. #define VSUSP 7 /* SUSP character */
  87. #define VTIME 8 /* TIME value */
  88. #define VSTART 9 /* START character */
  89. #define VSTOP 10 /* STOP character */
  90. /*
  91. * Values for speed_t's
  92. */
  93. #define B0 0
  94. #define B50 1
  95. #define B75 2
  96. #define B110 3
  97. #define B134 4
  98. #define B150 5
  99. #define B200 6
  100. #define B300 7
  101. #define B600 8
  102. #define B1200 9
  103. #define B1800 10
  104. #define B2400 11
  105. #define B4800 12
  106. #define B9600 13
  107. #define B19200 14
  108. #define B38400 15
  109. /*
  110. * Optional actions for tcsetattr()
  111. */
  112. #define TCSANOW 1
  113. #define TCSADRAIN 2
  114. #define TCSAFLUSH 3
  115. /*
  116. * Queue selectors for tcflush()
  117. */
  118. #define TCIFLUSH 0
  119. #define TCOFLUSH 1
  120. #define TCIOFLUSH 2
  121. /*
  122. * Actions for tcflow()
  123. */
  124. #define TCOOFF 0
  125. #define TCOON 1
  126. #define TCIOFF 2
  127. #define TCION 3
  128. int __cdecl tcgetattr(int, struct termios *);
  129. int __cdecl tcsetattr(int, int, const struct termios *);
  130. int __cdecl tcsendbreak(int, int);
  131. int __cdecl tcdrain(int);
  132. int __cdecl tcflush(int, int);
  133. int __cdecl tcflow(int, int);
  134. pid_t __cdecl tcgetpgrp(int);
  135. int __cdecl tcsetpgrp(int, pid_t);
  136. speed_t __cdecl cfgetospeed(const struct termios *);
  137. int __cdecl cfsetospeed(struct termios *, speed_t);
  138. speed_t __cdecl cfgetispeed(const struct termios *);
  139. int __cdecl cfsetispeed(struct termios *, speed_t);
  140. #ifdef __cplusplus
  141. }
  142. #endif
  143. #endif /* _TERMIOS_ */