Diffstat (limited to 'noncore/apps/opie-console/MyPty.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/MyPty.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/noncore/apps/opie-console/MyPty.cpp b/noncore/apps/opie-console/MyPty.cpp index a37f980..6d57703 100644 --- a/noncore/apps/opie-console/MyPty.cpp +++ b/noncore/apps/opie-console/MyPty.cpp | |||
@@ -54,59 +54,63 @@ | |||
54 | other by the operating system. One may think of them as two serial devices | 54 | other by the operating system. One may think of them as two serial devices |
55 | linked by a null-modem cable. Being based on devices the number of | 55 | linked by a null-modem cable. Being based on devices the number of |
56 | simultanous instances of this class is (globally) limited by the number of | 56 | simultanous instances of this class is (globally) limited by the number of |
57 | those device pairs, which is 256. | 57 | those device pairs, which is 256. |
58 | 58 | ||
59 | Another technic are UNIX 98 PTY's. These are supported also, and prefered | 59 | Another technic are UNIX 98 PTY's. These are supported also, and prefered |
60 | over the (obsolete) predecessor. | 60 | over the (obsolete) predecessor. |
61 | 61 | ||
62 | There's a sinister ioctl(2), signal(2) and job control stuff | 62 | There's a sinister ioctl(2), signal(2) and job control stuff |
63 | nessesary to make everything work as it should. | 63 | nessesary to make everything work as it should. |
64 | */ | 64 | */ |
65 | 65 | ||
66 | #include "procctl.h" | ||
67 | #include "MyPty.h" | ||
66 | 68 | ||
69 | /* OPIE */ | ||
70 | #include <opie2/odebug.h> | ||
71 | using namespace Opie::Core; | ||
72 | |||
73 | /* QT */ | ||
67 | #include <qsocketnotifier.h> | 74 | #include <qsocketnotifier.h> |
68 | #include <qfile.h> | 75 | #include <qfile.h> |
69 | 76 | ||
77 | /* STD */ | ||
70 | #include <stdlib.h> | 78 | #include <stdlib.h> |
71 | #include <stdio.h> | 79 | #include <stdio.h> |
72 | #include <signal.h> | 80 | #include <signal.h> |
73 | #include <fcntl.h> | 81 | #include <fcntl.h> |
74 | #include <unistd.h> | 82 | #include <unistd.h> |
75 | #include <termios.h> | 83 | #include <termios.h> |
76 | #include <sys/types.h> | 84 | #include <sys/types.h> |
77 | #include <sys/ioctl.h> | 85 | #include <sys/ioctl.h> |
78 | #include <sys/wait.h> | 86 | #include <sys/wait.h> |
79 | 87 | ||
80 | #ifdef HAVE_OPENPTY | 88 | #ifdef HAVE_OPENPTY |
81 | #include <pty.h> | 89 | #include <pty.h> |
82 | #endif | 90 | #endif |
83 | 91 | ||
84 | #include "procctl.h" | ||
85 | #include "MyPty.h" | ||
86 | |||
87 | |||
88 | #undef VERBOSE_DEBUG | 92 | #undef VERBOSE_DEBUG |
89 | 93 | ||
90 | 94 | ||
91 | /* -------------------------------------------------------------------------- */ | 95 | /* -------------------------------------------------------------------------- */ |
92 | 96 | ||
93 | /*! | 97 | /*! |
94 | Informs the client program about the | 98 | Informs the client program about the |
95 | actual size of the window. | 99 | actual size of the window. |
96 | */ | 100 | */ |
97 | 101 | ||
98 | void MyPty::setSize(int lines, int columns) | 102 | void MyPty::setSize(int lines, int columns) |
99 | { | 103 | { |
100 | qWarning("setting size"); | 104 | owarn << "setting size" << oendl; |
101 | struct winsize wsize; | 105 | struct winsize wsize; |
102 | wsize.ws_row = (unsigned short)lines; | 106 | wsize.ws_row = (unsigned short)lines; |
103 | wsize.ws_col = (unsigned short)columns; | 107 | wsize.ws_col = (unsigned short)columns; |
104 | if(m_fd < 0) return; | 108 | if(m_fd < 0) return; |
105 | ioctl(m_fd,TIOCSWINSZ,(char *)&wsize); | 109 | ioctl(m_fd,TIOCSWINSZ,(char *)&wsize); |
106 | } | 110 | } |
107 | 111 | ||
108 | 112 | ||
109 | void MyPty::donePty() | 113 | void MyPty::donePty() |
110 | { | 114 | { |
111 | // This is code from the Qt DumbTerminal example | 115 | // This is code from the Qt DumbTerminal example |
112 | 116 | ||