ptyLib.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:2k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* ptyLib.h - UNIX library for allocating pseudo-terminal devices */
  2. /* Copyright 1992-2002 Wind River Systems, Inc. */
  3. /* modification history
  4. -----------------------
  5. 02b,08may02,dat  cplusplus protection SPR 74987
  6. 02a,14dec93,gae  tweaked for the simulator.
  7. 01h,19aug93,c_s  Added ptySetNonBlocking (); mod history corrected.
  8. 01g,18aug93,c_s  Adjusted Ultrix port.
  9. 01f,17aug93,c_s  Added ptySetCanonical ().
  10. 01e,02aug93,c_s  Added #include of <sys/stropts.h> in the svr4 streams case.
  11. 01d,18sep92,c_s  Ported to Ultrix.
  12. 01c,16sep92,c_s  Ported to IRIX.  Adjusted port to HP-UX.
  13. 01b,10sep92,maf  conditionally include <sys/ioctl.h> or <sys/filio.h> based
  14.    on presence of HP-UX predefined macro "hpux."
  15. 01a,09jul92,c_s  Adapted from PtyConnection.h (in C++).
  16. */
  17. #ifndef INCptyLibh
  18. #define INCptyLibh
  19. #if defined(hpux) || defined(__hpux)
  20. #define _INCLUDE_XOPEN_SOURCE
  21. #define _INCLUDE_HPUX_SOURCE
  22. #define _INCLUDE_POSIX_SOURCE
  23. #define _INCLUDE_AES_SOURCE
  24. #endif
  25. #include <stdio.h>
  26. #include <stdlib.h>
  27. #include <sys/stat.h>
  28. #include <sys/signal.h>
  29. #include <fcntl.h>
  30. #include <sys/file.h>
  31. #if defined(hpux) || defined(__hpux)
  32. #define hpux
  33. #include <sys/ioctl.h>
  34. #include <sys/termios.h>
  35. #define TCSETS TCSETATTR
  36. #define TCGETS TCGETATTR
  37. #else
  38. #if defined(ultrix)
  39. #include <sys/termios.h>
  40. #include <sys/ioctl.h>
  41. #define TCSETS TCSETA
  42. #define TCGETS TCGETA
  43. #else
  44. #if defined(sgi)
  45. #include <sys/ioctl.h>
  46. #include <sys/termio.h>
  47. #define termios termio
  48. #define TCSETS TCSETA
  49. #define TCGETS TCGETA
  50. #else
  51. #if defined(_AIX)
  52. #include <sys/ioctl.h>
  53. #include <termio.h>
  54. #include <unistd.h>
  55. #else
  56. #if defined(HAVE_STREAMS_TERMIO)
  57. #include <errno.h>
  58. #include <sys/conf.h>
  59. #include <sys/stropts.h>
  60. #endif
  61. #include <termios.h>
  62. #include <sys/filio.h>
  63. #include <unistd.h>
  64. #endif
  65. #endif
  66. #endif
  67. #endif
  68. #define PTY_MASTER  0
  69. #define PTY_SLAVE  1
  70. #ifdef __cplusplus
  71. extern "C" {
  72. #endif
  73. #ifdef __STDC__
  74. int ptyOpen (int fd[2], char name[2]);
  75. int ptyBind (int fd[2], char *pgm);
  76. int ptyBindToXterm (int fd[2], char name[2], char *title, int detachPgm);
  77. #else
  78. int ptyOpen (/* int fd[2], char name[2] */);
  79. int ptyBind (/* int fd[2], char *pgm */);
  80. int ptyBindToXterm (/* int fd[2], char name[2], char *title, int detachPgm */);
  81. #endif /* __STDC__ */
  82. #ifdef __cplusplus
  83. }
  84. #endif
  85. #endif /* INCptyLibh */