home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / ckl196.zip / ckupty.h < prev    next >
C/C++ Source or Header  |  1999-12-05  |  5KB  |  173 lines

  1. /* C K U P T Y . H  --  Includes and definitions for ckupty.c  */
  2.  
  3. /*
  4.   Copyright 1995 by the Massachusetts Institute of Technology.
  5.  
  6.   Modified for use in C-Kermit by:
  7.  
  8.   Jeffrey Altman <jaltman@columbia.edu>
  9.   The Kermit Project, Columbia University, New York City
  10.   November 1999
  11. */
  12. #ifndef __PTY_INT_H__
  13. #include <sys/types.h>
  14.  
  15. /* #define WANT_UTMP */
  16. /* We don't want all the utmp/wtmp stuff */
  17.  
  18. #ifdef WANT_UTMP
  19. #ifdef HAVE_UTMP_H
  20. #include <utmp.h>
  21. #endif /* HAVE_UTMP_H */
  22. #ifdef HAVE_UTMPX_H
  23. #include <utmpx.h>
  24. #endif /* HAVE_UTMPX_H */
  25. #endif /* WANT_UTMP */
  26.  
  27. #ifdef HAVE_UNISTD_H
  28. #include <unistd.h>
  29. #endif /* HAVE_UNISTD_H */
  30. #ifdef __SCO__
  31. #include <sys/unistd.h>
  32. #endif /* __SCO__ */
  33. #ifdef HAVE_STDLIB_H
  34. #include <stdlib.h>
  35. #endif /* HAVE_STDLIB_H */
  36.  
  37. #include <stdio.h>
  38.  
  39. #include <sys/stat.h>
  40. #include <sys/ioctl.h>
  41. #include <sys/file.h>
  42. #include <sys/time.h>
  43. #include <ctype.h>
  44. #include <fcntl.h>
  45. #include <netinet/in.h>
  46. #include <errno.h>
  47. #include <pwd.h>
  48.  
  49. #ifdef HAVE_SYS_LABEL_H
  50. /* only SunOS 4? */
  51. #include <sys/label.h>
  52. #include <sys/audit.h>
  53. #include <pwdadj.h>
  54. #endif /* HAVE_SYS_LABEL_H */
  55.  
  56. #include <signal.h>
  57.  
  58. #ifdef HPUX
  59. #include <sys/ptyio.h>
  60. #endif /* HPUX */
  61. #ifdef sysvimp
  62. #include <compat.h>
  63. #endif /* sysvimp */
  64.  
  65. #ifdef COMMENT
  66. /* I don't think we actually use this for anything */
  67. /* and it kills Slackware builds, where there is no select.h. */
  68. #ifndef NO_SYS_SELECT_H
  69. #ifdef HAVE_SYS_SELECT_H
  70. #include <sys/select.h>
  71. #endif /* HAVE_SYS_SELECT_H */
  72. #endif /* NO_SYS_SELECT_H */
  73. #endif /* COMMENT */
  74.  
  75. #ifdef HAVE_STREAMS
  76. #include <sys/stream.h>
  77. #include <sys/stropts.h>
  78. #endif /* HAVE_STREAMS */
  79.  
  80. #ifdef POSIX_TERMIOS
  81. #ifndef ultrix
  82. #include <termios.h>
  83. #else
  84. #include <sgtty.h>
  85. #endif /* ultrix */
  86. #else /* POSIX_TERMIOS */
  87. #include <sgtty.h>
  88. #endif /* POSIX_TERMIOS */
  89.  
  90. #include <netdb.h>
  91. /* #include <syslog.h> */
  92. #include <string.h>
  93. #include <sys/param.h>
  94.  
  95. #ifdef HAVE_STREAMS
  96. /* krlogin doesn't test sys/tty... */
  97. #ifdef HAVE_SYS_TTY_H
  98. #include <sys/tty.h>
  99. #endif /* HAVE_SYS_TTY_H */
  100.  
  101. #ifdef HAVE_SYS_PTYVAR_H
  102. /* Solaris actually uses packet mode, so the real macros are needed too */
  103. #include <sys/ptyvar.h>
  104. #endif /* HAVE_SYS_PTYVAR_H */
  105. #endif /* HAVE_STREAMS */
  106.  
  107. #ifdef HAVE_VHANGUP
  108. #ifndef OPEN_CTTY_ONLY_ONCE
  109. /*
  110.   Breaks under Ultrix and others where you cannot get controlling
  111.   terminal twice.
  112. */
  113. #define VHANG_first
  114. #define VHANG_LAST
  115. #endif /* OPEN_CTTY_ONLY_ONCE */
  116. #endif /* HAVE_VHANGUP */
  117.  
  118. /* Internal functions */
  119. _PROTOTYP(long ptyint_void_association,(void));
  120. _PROTOTYP(long ptyint_open_ctty ,(char *, int *));
  121. _PROTOTYP(VOID ptyint_vhangup, (void));
  122.  
  123. #ifdef WANT_UTMP
  124. _PROTOTYP(long ptyint_update_wtmp, (struct utmp *, char *, char *));
  125. #endif /* WANT_UTMP */
  126.  
  127. #define __PTY_INT_H__
  128. #endif /* __PTY_INT_H__ */
  129.  
  130. #ifndef __LIBPTY_H__
  131.  
  132. #ifdef WANT_UTMP
  133. /* Constants for pty_update_utmp */
  134. #define PTY_LOGIN_PROCESS 0
  135. #define PTY_USER_PROCESS 1
  136. #define PTY_DEAD_PROCESS 2
  137. #define PTY_TTYSLOT_USABLE (0x1)    /* flags to update_utmp*/
  138. #define PTY_UTMP_USERNAME_VALID (0x2)
  139. #endif /* WANT_UTMP */
  140.  
  141. _PROTOTYP(long pty_init,(void));
  142. _PROTOTYP(long pty_getpty, ( int *, char *, int));
  143. _PROTOTYP(long pty_open_slave, (char *, int *));
  144. _PROTOTYP(long pty_open_ctty, (char *, int *));
  145. _PROTOTYP(long pty_initialize_slave, (int));
  146. #ifdef WANT_UTMP
  147. _PROTOTYP(long pty_update_utmp, (int, int, char *, char *, char *, int));
  148. _PROTOTYP(long pty_logwtmp, (char *, char *, char *));
  149. #endif /* WANT_UTMP */
  150. _PROTOTYP(long pty_cleanup, (char *, int, int));
  151.  
  152. #define PTY_GETPTY_STREAMS               (44806912L)
  153. #define PTY_GETPTY_FSTAT                 (44806913L)
  154. #define PTY_GETPTY_NOPTY                 (44806914L)
  155. #define PTY_GETPTY_SLAVE_TOOLONG         (44806915L)
  156. #define PTY_OPEN_SLAVE_OPENFAIL          (44806916L)
  157. #define PTY_OPEN_SLAVE_CHMODFAIL         (44806917L)
  158. #define PTY_OPEN_SLAVE_NOCTTY            (44806918L)
  159. #define PTY_OPEN_SLAVE_CHOWNFAIL         (44806919L)
  160. #define PTY_OPEN_SLAVE_LINE_PUSHFAIL     (44806920L)
  161. #define PTY_OPEN_SLAVE_PUSH_FAIL         (44806921L)
  162. #define PTY_OPEN_SLAVE_REVOKEFAIL        (44806922L)
  163. #ifdef WANT_UTMP
  164. #define PTY_UPDATE_UTMP_PROCTYPE_INVALID (44806923L)
  165. #endif /* WANT_UTMP */
  166. #define PTY_OPEN_SLAVE_TOOSHORT          (44806924L)
  167. #define ERROR_TABLE_BASE_pty             (44806912L)
  168.  
  169. extern struct error_table et_pty_error_table;
  170.  
  171. #define __LIBPTY_H__
  172. #endif /* __LIBPTY_H__ */
  173.