languages/cpp/debugger/stty.h
Go to the documentation of this file.00001 /*************************************************************************** 00002 begin : Mon Sep 13 1999 00003 copyright : (C) 1999 by John Birch 00004 email : jbb@kdevelop.org 00005 00006 This code was originally written by Judin Maxim, from the 00007 KDEStudio project. 00008 00009 It was then updated with later code from konsole (KDE). 00010 00011 It has also been enhanced with an idea from the code in kdbg 00012 written by Johannes Sixt<Johannes.Sixt@telecom.at> 00013 00014 ***************************************************************************/ 00015 00016 /*************************************************************************** 00017 * * 00018 * This program is free software; you can redistribute it and/or modify * 00019 * it under the terms of the GNU General Public License as published by * 00020 * the Free Software Foundation; either version 2 of the License, or * 00021 * (at your option) any later version. * 00022 * * 00023 ***************************************************************************/ 00024 00025 #ifndef _STTY_H_ 00026 #define _STTY_H_ 00027 00028 class QSocketNotifier; 00029 00030 #include <qobject.h> 00031 #include <qstring.h> 00032 00033 namespace GDBDebugger 00034 { 00035 00036 class STTY : public QObject 00037 { 00038 Q_OBJECT 00039 00040 public: 00041 STTY(bool ext=false, const QString &termAppName=QString()); 00042 ~STTY(); 00043 00044 QString getSlave() { return ttySlave; }; 00045 00046 private slots: 00047 void OutReceived(int); 00048 00049 signals: 00050 void OutOutput(const char *); 00051 void ErrOutput(const char*); 00052 00053 private: 00054 int findTTY(); 00055 bool findExternalTTY(const QString &termApp); 00056 00057 private: 00058 int fout; 00059 int ferr; 00060 QSocketNotifier *out; 00061 QSocketNotifier *err; 00062 QString ttySlave; 00063 int pid_; 00064 00065 char pty_master[50]; // "/dev/ptyxx" | "/dev/ptmx" 00066 char tty_slave[50]; // "/dev/ttyxx" | "/dev/pts/########..." 00067 }; 00068 00069 } 00070 00071 #endif