author | harlekin <harlekin> | 2002-10-25 19:34:27 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-10-25 19:34:27 (UTC) |
commit | 77347ba522a5913ff17561e6fd2c15981d42e86b (patch) (unidiff) | |
tree | 9e865d9b8d9ca2bfdda98a823531359b3004e46a | |
parent | 9adbe632ec54bf155b9882e4e0b51c293259cdf2 (diff) | |
download | opie-77347ba522a5913ff17561e6fd2c15981d42e86b.zip opie-77347ba522a5913ff17561e6fd2c15981d42e86b.tar.gz opie-77347ba522a5913ff17561e6fd2c15981d42e86b.tar.bz2 |
cough
-rw-r--r-- | noncore/apps/opie-console/MyPty.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/MyPty.cpp b/noncore/apps/opie-console/MyPty.cpp index 2570826..534f79a 100644 --- a/noncore/apps/opie-console/MyPty.cpp +++ b/noncore/apps/opie-console/MyPty.cpp | |||
@@ -1,348 +1,348 @@ | |||
1 | /* -------------------------------------------------------------------------- */ | 1 | /* -------------------------------------------------------------------------- */ |
2 | /* */ | 2 | /* */ |
3 | /* [MyPty.C] Pseudo Terminal Device */ | 3 | /* [MyPty.C] Pseudo Terminal Device */ |
4 | /* */ | 4 | /* */ |
5 | /* -------------------------------------------------------------------------- */ | 5 | /* -------------------------------------------------------------------------- */ |
6 | /* */ | 6 | /* */ |
7 | /* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ | 7 | /* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ |
8 | /* */ | 8 | /* */ |
9 | /* This file is part of Konsole - an X terminal for KDE */ | 9 | /* This file is part of Konsole - an X terminal for KDE */ |
10 | /* -------------------------------------------------------------------------- */ | 10 | /* -------------------------------------------------------------------------- */ |
11 | /* */ | 11 | /* */ |
12 | /* Ported Konsole to Qt/Embedded */ | 12 | /* Ported Konsole to Qt/Embedded */ |
13 | /* */ | 13 | /* */ |
14 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ | 14 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ |
15 | /* */ | 15 | /* */ |
16 | /* -------------------------------------------------------------------------- */ | 16 | /* -------------------------------------------------------------------------- */ |
17 | 17 | ||
18 | /* If you're compiling konsole on non-Linux platforms and find | 18 | /* If you're compiling konsole on non-Linux platforms and find |
19 | problems that you can track down to this file, please have | 19 | problems that you can track down to this file, please have |
20 | a look into ../README.ports, too. | 20 | a look into ../README.ports, too. |
21 | */ | 21 | */ |
22 | 22 | ||
23 | /*! \file | 23 | /*! \file |
24 | */ | 24 | */ |
25 | 25 | ||
26 | /*! \class TEPty | 26 | /*! \class TEPty |
27 | 27 | ||
28 | \brief Ptys provide a pseudo terminal connection to a program. | 28 | \brief Ptys provide a pseudo terminal connection to a program. |
29 | 29 | ||
30 | Although closely related to pipes, these pseudo terminal connections have | 30 | Although closely related to pipes, these pseudo terminal connections have |
31 | some ability, that makes it nessesary to uses them. Most importent, they | 31 | some ability, that makes it nessesary to uses them. Most importent, they |
32 | know about changing screen sizes and UNIX job control. | 32 | know about changing screen sizes and UNIX job control. |
33 | 33 | ||
34 | Within the terminal emulation framework, this class represents the | 34 | Within the terminal emulation framework, this class represents the |
35 | host side of the terminal together with the connecting serial line. | 35 | host side of the terminal together with the connecting serial line. |
36 | 36 | ||
37 | One can create many instances of this class within a program. | 37 | One can create many instances of this class within a program. |
38 | As a side effect of using this class, a signal(2) handler is | 38 | As a side effect of using this class, a signal(2) handler is |
39 | installed on SIGCHLD. | 39 | installed on SIGCHLD. |
40 | 40 | ||
41 | \par FIXME | 41 | \par FIXME |
42 | 42 | ||
43 | [NOTE: much of the technical stuff below will be replaced by forkpty.] | 43 | [NOTE: much of the technical stuff below will be replaced by forkpty.] |
44 | 44 | ||
45 | publish the SIGCHLD signal if not related to an instance. | 45 | publish the SIGCHLD signal if not related to an instance. |
46 | 46 | ||
47 | clearify TEPty::done vs. TEPty::~TEPty semantics. | 47 | clearify TEPty::done vs. TEPty::~TEPty semantics. |
48 | check if pty is restartable via run after done. | 48 | check if pty is restartable via run after done. |
49 | 49 | ||
50 | \par Pseudo terminals | 50 | \par Pseudo terminals |
51 | 51 | ||
52 | Pseudo terminals are a unique feature of UNIX, and always come in form of | 52 | Pseudo terminals are a unique feature of UNIX, and always come in form of |
53 | pairs of devices (/dev/ptyXX and /dev/ttyXX), which are connected to each | 53 | pairs of devices (/dev/ptyXX and /dev/ttyXX), which are connected to each |
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 | 66 | ||
67 | #include <qapplication.h> | 67 | #include <qapplication.h> |
68 | #include <qsocketnotifier.h> | 68 | #include <qsocketnotifier.h> |
69 | #include <qstring.h> | 69 | #include <qstring.h> |
70 | #include <qfile.h> | 70 | #include <qfile.h> |
71 | 71 | ||
72 | #include <stdlib.h> | 72 | #include <stdlib.h> |
73 | #include <stdio.h> | 73 | #include <stdio.h> |
74 | #include <signal.h> | 74 | #include <signal.h> |
75 | #include <fcntl.h> | 75 | #include <fcntl.h> |
76 | #include <unistd.h> | 76 | #include <unistd.h> |
77 | #include <termios.h> | 77 | #include <termios.h> |
78 | #include <sys/types.h> | 78 | #include <sys/types.h> |
79 | #include <sys/ioctl.h> | 79 | #include <sys/ioctl.h> |
80 | #include <sys/wait.h> | 80 | #include <sys/wait.h> |
81 | 81 | ||
82 | #ifdef HAVE_OPENPTY | 82 | #ifdef HAVE_OPENPTY |
83 | #include <pty.h> | 83 | #include <pty.h> |
84 | #endif | 84 | #endif |
85 | 85 | ||
86 | #include "procctl.h" | 86 | #include "procctl.h" |
87 | #include "MyPty.h" | 87 | #include "MyPty.h" |
88 | 88 | ||
89 | 89 | ||
90 | #undef VERBOSE_DEBUG | 90 | #undef VERBOSE_DEBUG |
91 | 91 | ||
92 | 92 | ||
93 | /* -------------------------------------------------------------------------- */ | 93 | /* -------------------------------------------------------------------------- */ |
94 | 94 | ||
95 | /*! | 95 | /*! |
96 | Informs the client program about the | 96 | Informs the client program about the |
97 | actual size of the window. | 97 | actual size of the window. |
98 | */ | 98 | */ |
99 | 99 | ||
100 | void MyPty::setSize(int lines, int columns) | 100 | void MyPty::setSize(int lines, int columns) |
101 | { | 101 | { |
102 | qWarning("setting size"); | 102 | qWarning("setting size"); |
103 | struct winsize wsize; | 103 | struct winsize wsize; |
104 | wsize.ws_row = (unsigned short)lines; | 104 | wsize.ws_row = (unsigned short)lines; |
105 | wsize.ws_col = (unsigned short)columns; | 105 | wsize.ws_col = (unsigned short)columns; |
106 | if(m_fd < 0) return; | 106 | if(m_fd < 0) return; |
107 | ioctl(m_fd,TIOCSWINSZ,(char *)&wsize); | 107 | ioctl(m_fd,TIOCSWINSZ,(char *)&wsize); |
108 | } | 108 | } |
109 | 109 | ||
110 | 110 | ||
111 | void MyPty::donePty() | 111 | void MyPty::donePty() |
112 | { | 112 | { |
113 | // This is code from the Qt DumbTerminal example | 113 | // This is code from the Qt DumbTerminal example |
114 | 114 | ||
115 | ::close(m_fd); | 115 | ::close(m_fd); |
116 | 116 | ||
117 | if (m_cpid) { | 117 | if (m_cpid) { |
118 | kill(m_cpid, SIGHUP); | 118 | kill(m_cpid, SIGHUP); |
119 | //waitpid(m_cpid, &status, 0); | 119 | //waitpid(m_cpid, &status, 0); |
120 | delete m_sn_e; | 120 | delete m_sn_e; |
121 | delete m_sn_r; | 121 | delete m_sn_r; |
122 | m_sn_e = 0l; | 122 | m_sn_e = 0l; |
123 | m_sn_r = 0l; | 123 | m_sn_r = 0l; |
124 | } | 124 | } |
125 | 125 | ||
126 | m_cpid = 0; | 126 | m_cpid = 0; |
127 | m_fd = -1; | 127 | m_fd = -1; |
128 | // emit done(status); | 128 | // emit done(status); |
129 | } | 129 | } |
130 | 130 | ||
131 | 131 | ||
132 | const char* MyPty::deviceName() | 132 | const char* MyPty::deviceName() |
133 | { | 133 | { |
134 | return m_ttynam; | 134 | return m_ttynam; |
135 | } | 135 | } |
136 | 136 | ||
137 | 137 | ||
138 | void MyPty::error() | 138 | void MyPty::error() |
139 | { | 139 | { |
140 | // This is code from the Qt DumbTerminal example | 140 | // This is code from the Qt DumbTerminal example |
141 | donePty(); | 141 | donePty(); |
142 | } | 142 | } |
143 | 143 | ||
144 | void MyPty::start() { | 144 | void MyPty::start() { |
145 | char* cmd = "/bin/sh"; | 145 | char* cmd = "/bin/sh"; |
146 | 146 | ||
147 | if ( QFile::exists( "/bin/bash" ) ) { | 147 | if ( QFile::exists( "/bin/bash" ) ) { |
148 | char* cmd = "/bin/bash"; | 148 | cmd = "/bin/bash"; |
149 | } | 149 | } |
150 | 150 | ||
151 | QStrList lis; | 151 | QStrList lis; |
152 | int r =run(cmd, lis, 0, 0); | 152 | int r =run(cmd, lis, 0, 0); |
153 | r = r; | 153 | r = r; |
154 | } | 154 | } |
155 | /*! | 155 | /*! |
156 | start the client program. | 156 | start the client program. |
157 | */ | 157 | */ |
158 | int MyPty::run(const char* cmd, QStrList &, const char*, int) | 158 | int MyPty::run(const char* cmd, QStrList &, const char*, int) |
159 | { | 159 | { |
160 | // This is code from the Qt DumbTerminal example | 160 | // This is code from the Qt DumbTerminal example |
161 | m_cpid = fork(); | 161 | m_cpid = fork(); |
162 | 162 | ||
163 | if ( !m_cpid ) { | 163 | if ( !m_cpid ) { |
164 | // child - exec shell on tty | 164 | // child - exec shell on tty |
165 | for (int sig = 1; sig < NSIG; sig++) signal(sig,SIG_DFL); | 165 | for (int sig = 1; sig < NSIG; sig++) signal(sig,SIG_DFL); |
166 | int ttyfd = ::open(m_ttynam, O_RDWR); | 166 | int ttyfd = ::open(m_ttynam, O_RDWR); |
167 | dup2(ttyfd, STDIN_FILENO); | 167 | dup2(ttyfd, STDIN_FILENO); |
168 | dup2(ttyfd, STDOUT_FILENO); | 168 | dup2(ttyfd, STDOUT_FILENO); |
169 | dup2(ttyfd, STDERR_FILENO); | 169 | dup2(ttyfd, STDERR_FILENO); |
170 | // should be done with tty, so close it | 170 | // should be done with tty, so close it |
171 | ::close(ttyfd); | 171 | ::close(ttyfd); |
172 | static struct termios ttmode; | 172 | static struct termios ttmode; |
173 | if ( setsid() < 0 ) | 173 | if ( setsid() < 0 ) |
174 | perror( "failed to set process group" ); | 174 | perror( "failed to set process group" ); |
175 | #if defined (TIOCSCTTY) | 175 | #if defined (TIOCSCTTY) |
176 | // grabbed from APUE by Stevens | 176 | // grabbed from APUE by Stevens |
177 | ioctl(STDIN_FILENO, TIOCSCTTY, 0); | 177 | ioctl(STDIN_FILENO, TIOCSCTTY, 0); |
178 | #endif | 178 | #endif |
179 | tcgetattr( STDIN_FILENO, &ttmode ); | 179 | tcgetattr( STDIN_FILENO, &ttmode ); |
180 | ttmode.c_cc[VINTR] = 3; | 180 | ttmode.c_cc[VINTR] = 3; |
181 | ttmode.c_cc[VERASE] = 8; | 181 | ttmode.c_cc[VERASE] = 8; |
182 | tcsetattr( STDIN_FILENO, TCSANOW, &ttmode ); | 182 | tcsetattr( STDIN_FILENO, TCSANOW, &ttmode ); |
183 | setenv("TERM",m_term,1); | 183 | setenv("TERM",m_term,1); |
184 | setenv("COLORTERM","0",1); | 184 | setenv("COLORTERM","0",1); |
185 | 185 | ||
186 | if (getuid() == 0) { | 186 | if (getuid() == 0) { |
187 | char msg[] = "WARNING: You are running this shell as root!\n"; | 187 | char msg[] = "WARNING: You are running this shell as root!\n"; |
188 | write(ttyfd, msg, sizeof(msg)); | 188 | write(ttyfd, msg, sizeof(msg)); |
189 | } | 189 | } |
190 | execl(cmd, cmd, 0); | 190 | execl(cmd, cmd, 0); |
191 | 191 | ||
192 | donePty(); | 192 | donePty(); |
193 | exit(-1); | 193 | exit(-1); |
194 | } | 194 | } |
195 | 195 | ||
196 | // parent - continue as a widget | 196 | // parent - continue as a widget |
197 | delete m_sn_r; | 197 | delete m_sn_r; |
198 | m_sn_r = new QSocketNotifier(m_fd,QSocketNotifier::Read,this); | 198 | m_sn_r = new QSocketNotifier(m_fd,QSocketNotifier::Read,this); |
199 | delete m_sn_e; | 199 | delete m_sn_e; |
200 | m_sn_e = new QSocketNotifier(m_fd,QSocketNotifier::Exception,this); | 200 | m_sn_e = new QSocketNotifier(m_fd,QSocketNotifier::Exception,this); |
201 | connect(m_sn_r,SIGNAL(activated(int)),this,SLOT(readPty())); | 201 | connect(m_sn_r,SIGNAL(activated(int)),this,SLOT(readPty())); |
202 | connect(m_sn_e,SIGNAL(activated(int)),this,SLOT(error())); | 202 | connect(m_sn_e,SIGNAL(activated(int)),this,SLOT(error())); |
203 | 203 | ||
204 | return 0; | 204 | return 0; |
205 | } | 205 | } |
206 | 206 | ||
207 | int MyPty::openPty() | 207 | int MyPty::openPty() |
208 | { | 208 | { |
209 | // This is code from the Qt DumbTerminal example | 209 | // This is code from the Qt DumbTerminal example |
210 | int ptyfd = -1; | 210 | int ptyfd = -1; |
211 | 211 | ||
212 | #ifdef HAVE_OPENPTY | 212 | #ifdef HAVE_OPENPTY |
213 | int ttyfd; | 213 | int ttyfd; |
214 | if ( openpty(&ptyfd,&ttyfd,ttynam,0,0) ) | 214 | if ( openpty(&ptyfd,&ttyfd,ttynam,0,0) ) |
215 | ptyfd = -1; | 215 | ptyfd = -1; |
216 | else | 216 | else |
217 | close(ttyfd); // we open the ttynam ourselves. | 217 | close(ttyfd); // we open the ttynam ourselves. |
218 | #else | 218 | #else |
219 | for (const char* c0 = "pqrstuvwxyzabcde"; ptyfd < 0 && *c0 != 0; c0++) { | 219 | for (const char* c0 = "pqrstuvwxyzabcde"; ptyfd < 0 && *c0 != 0; c0++) { |
220 | for (const char* c1 = "0123456789abcdef"; ptyfd < 0 && *c1 != 0; c1++) { | 220 | for (const char* c1 = "0123456789abcdef"; ptyfd < 0 && *c1 != 0; c1++) { |
221 | sprintf(m_ptynam,"/dev/pty%c%c",*c0,*c1); | 221 | sprintf(m_ptynam,"/dev/pty%c%c",*c0,*c1); |
222 | sprintf(m_ttynam,"/dev/tty%c%c",*c0,*c1); | 222 | sprintf(m_ttynam,"/dev/tty%c%c",*c0,*c1); |
223 | if ((ptyfd = ::open(m_ptynam,O_RDWR)) >= 0) { | 223 | if ((ptyfd = ::open(m_ptynam,O_RDWR)) >= 0) { |
224 | if (geteuid() != 0 && !access(m_ttynam,R_OK|W_OK) == 0) { | 224 | if (geteuid() != 0 && !access(m_ttynam,R_OK|W_OK) == 0) { |
225 | ::close(ptyfd); | 225 | ::close(ptyfd); |
226 | ptyfd = -1; | 226 | ptyfd = -1; |
227 | } | 227 | } |
228 | } | 228 | } |
229 | } | 229 | } |
230 | } | 230 | } |
231 | #endif | 231 | #endif |
232 | 232 | ||
233 | if ( ptyfd < 0 ) { | 233 | if ( ptyfd < 0 ) { |
234 | //qApp->exit(1); | 234 | //qApp->exit(1); |
235 | return -1; | 235 | return -1; |
236 | } | 236 | } |
237 | 237 | ||
238 | return ptyfd; | 238 | return ptyfd; |
239 | } | 239 | } |
240 | 240 | ||
241 | /*! | 241 | /*! |
242 | Create an instance. | 242 | Create an instance. |
243 | */ | 243 | */ |
244 | MyPty::MyPty(const Profile& prof) : m_cpid(0) | 244 | MyPty::MyPty(const Profile& prof) : m_cpid(0) |
245 | { | 245 | { |
246 | 246 | ||
247 | int term = prof.readNumEntry("Terminal", Profile::VT100 ); | 247 | int term = prof.readNumEntry("Terminal", Profile::VT100 ); |
248 | switch( term ) { | 248 | switch( term ) { |
249 | default: | 249 | default: |
250 | case Profile::VT100: | 250 | case Profile::VT100: |
251 | case Profile::VT102: | 251 | case Profile::VT102: |
252 | m_term = "vt100"; | 252 | m_term = "vt100"; |
253 | break; | 253 | break; |
254 | case Profile::Linux: | 254 | case Profile::Linux: |
255 | m_term = "linux"; | 255 | m_term = "linux"; |
256 | break; | 256 | break; |
257 | case Profile::XTerm: | 257 | case Profile::XTerm: |
258 | m_term = "xterm"; | 258 | m_term = "xterm"; |
259 | break; | 259 | break; |
260 | } | 260 | } |
261 | m_sn_e = 0l; | 261 | m_sn_e = 0l; |
262 | m_sn_r = 0l; | 262 | m_sn_r = 0l; |
263 | m_fd = openPty(); | 263 | m_fd = openPty(); |
264 | ProcCtl* ctl = ProcCtl::self(); | 264 | ProcCtl* ctl = ProcCtl::self(); |
265 | Q_UNUSED(ctl); | 265 | Q_UNUSED(ctl); |
266 | } | 266 | } |
267 | 267 | ||
268 | /*! | 268 | /*! |
269 | Destructor. | 269 | Destructor. |
270 | Note that the related client program is not killed | 270 | Note that the related client program is not killed |
271 | (yet) when a instance is deleted. | 271 | (yet) when a instance is deleted. |
272 | */ | 272 | */ |
273 | MyPty::~MyPty() | 273 | MyPty::~MyPty() |
274 | { | 274 | { |
275 | donePty(); | 275 | donePty(); |
276 | } | 276 | } |
277 | QString MyPty::identifier()const { | 277 | QString MyPty::identifier()const { |
278 | return QString::fromLatin1("term"); | 278 | return QString::fromLatin1("term"); |
279 | } | 279 | } |
280 | QString MyPty::name()const{ | 280 | QString MyPty::name()const{ |
281 | return identifier(); | 281 | return identifier(); |
282 | } | 282 | } |
283 | bool MyPty::open() { | 283 | bool MyPty::open() { |
284 | if (m_fd < 0) | 284 | if (m_fd < 0) |
285 | m_fd = openPty(); | 285 | m_fd = openPty(); |
286 | 286 | ||
287 | start(); | 287 | start(); |
288 | return true; | 288 | return true; |
289 | } | 289 | } |
290 | void MyPty::close() { | 290 | void MyPty::close() { |
291 | donePty(); | 291 | donePty(); |
292 | m_fd = openPty(); | 292 | m_fd = openPty(); |
293 | } | 293 | } |
294 | void MyPty::reload( const Profile& ) { | 294 | void MyPty::reload( const Profile& ) { |
295 | 295 | ||
296 | } | 296 | } |
297 | /*! sends len bytes through the line */ | 297 | /*! sends len bytes through the line */ |
298 | void MyPty::send(const QByteArray& ar) | 298 | void MyPty::send(const QByteArray& ar) |
299 | { | 299 | { |
300 | #ifdef VERBOSE_DEBUG | 300 | #ifdef VERBOSE_DEBUG |
301 | // verbose debug | 301 | // verbose debug |
302 | printf("sending bytes:\n"); | 302 | printf("sending bytes:\n"); |
303 | for (uint i = 0; i < ar.count(); i++) | 303 | for (uint i = 0; i < ar.count(); i++) |
304 | printf("%c", ar[i]); | 304 | printf("%c", ar[i]); |
305 | printf("\n"); | 305 | printf("\n"); |
306 | #endif | 306 | #endif |
307 | 307 | ||
308 | ::write(m_fd, ar.data(), ar.count()); | 308 | ::write(m_fd, ar.data(), ar.count()); |
309 | } | 309 | } |
310 | 310 | ||
311 | /*! indicates that a block of data is received */ | 311 | /*! indicates that a block of data is received */ |
312 | void MyPty::readPty() | 312 | void MyPty::readPty() |
313 | { | 313 | { |
314 | QByteArray buf(4096); | 314 | QByteArray buf(4096); |
315 | 315 | ||
316 | int len = ::read( m_fd, buf.data(), 4096 ); | 316 | int len = ::read( m_fd, buf.data(), 4096 ); |
317 | 317 | ||
318 | if (len == -1 || len == 0) { | 318 | if (len == -1 || len == 0) { |
319 | donePty(); | 319 | donePty(); |
320 | return; | 320 | return; |
321 | } | 321 | } |
322 | 322 | ||
323 | if (len < 0) | 323 | if (len < 0) |
324 | return; | 324 | return; |
325 | 325 | ||
326 | 326 | ||
327 | buf.resize(len); | 327 | buf.resize(len); |
328 | emit received(buf); | 328 | emit received(buf); |
329 | 329 | ||
330 | #ifdef VERBOSE_DEBUG | 330 | #ifdef VERBOSE_DEBUG |
331 | // verbose debug | 331 | // verbose debug |
332 | printf("read bytes:\n"); | 332 | printf("read bytes:\n"); |
333 | for (uint i = 0; i < buf.count(); i++) | 333 | for (uint i = 0; i < buf.count(); i++) |
334 | printf("%c", buf[i]); | 334 | printf("%c", buf[i]); |
335 | printf("\n"); | 335 | printf("\n"); |
336 | #endif | 336 | #endif |
337 | 337 | ||
338 | } | 338 | } |
339 | QBitArray MyPty::supports()const { | 339 | QBitArray MyPty::supports()const { |
340 | QBitArray ar(3); | 340 | QBitArray ar(3); |
341 | //autoconnect | 341 | //autoconnect |
342 | ar[0] = 1; | 342 | ar[0] = 1; |
343 | // | 343 | // |
344 | ar[1] = 0; | 344 | ar[1] = 0; |
345 | ar[2] = 0; | 345 | ar[2] = 0; |
346 | 346 | ||
347 | return ar; | 347 | return ar; |
348 | } | 348 | } |