• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdesu
 

tdesu

  • tdesu
process.h
1 /*
2  *
3  * $Id$
4  *
5  * This file is part of the KDE project, module tdesu.
6  * Copyright (C) 1999,2000 Geert Jansen <jansen@kde.org>
7  *
8  * This is free software; you can use this library under the GNU Library
9  * General Public License, version 2. See the file "COPYING.LIB" for the
10  * exact licensing terms.
11  */
12 
13 #ifndef __Process_h_Included__
14 #define __Process_h_Included__
15 
16 #include <sys/types.h>
17 
18 #include <tqcstring.h>
19 #include <tqstring.h>
20 #include <tqstringlist.h>
21 #include <tqvaluelist.h>
22 
23 #include <tdelibs_export.h>
24 
25 class PTY;
26 typedef TQValueList<TQCString> QCStringList;
27 
36 class TDESU_EXPORT PtyProcess
37 {
38 public:
39  PtyProcess();
40  virtual ~PtyProcess();
41 
49  int exec(const TQCString &command, const QCStringList &args);
50 
57  TQCString readLine(bool block=true);
63  TQCString readAll(bool block=true);
64 
70  void writeLine(const TQCString &line, bool addNewline=true);
71 
77  void unreadLine(const TQCString &line, bool addNewline=true);
78 
83  void setExitString(const TQCString &exit) { m_Exit = exit; }
84 
88  int waitForChild();
89 
95  int WaitSlave();
96 
100  int enableLocalEcho(bool enable=true);
101 
105  void setTerminal(bool terminal) { m_bTerminal = terminal; }
106 
111  void setErase(bool erase) { m_bErase = erase; }
112 
116  void setEnvironment( const QCStringList &env );
117 
121  int fd() {return m_Fd;}
122 
126  int pid() {return m_Pid;}
127 
128 public: /* static */
129  /*
130  ** This is a collection of static functions that can be
131  ** used for process control inside tdesu. I'd suggest
132  ** against using this publicly. There are probably
133  ** nicer Qt based ways to do what you want.
134  */
135 
145  static int waitMS(int fd,int ms);
146 
147 
153  static bool checkPid(pid_t pid);
154 
162  enum checkPidStatus { Error=-1, NotExited=-2, Killed=-3 } ;
163  static int checkPidExited(pid_t pid);
164 
165 
166 protected:
167  const QCStringList& environment() const;
168 
169  bool m_bErase, m_bTerminal;
170  int m_Pid, m_Fd;
171  TQCString m_Command, m_Exit;
172 
173 private:
174  int init();
175  int SetupTTY(int fd);
176 
177  PTY *m_pPTY;
178  TQCString m_Inbuf, m_TTY;
179 
180 protected:
181  virtual void virtual_hook( int id, void* data );
182 private:
183  class PtyProcessPrivate;
184  PtyProcessPrivate *d;
185 };
186 
187 
188 #endif
PTY
PTY compatibility routines.
Definition: tdesu_pty.h:25
PtyProcess
Synchronous communication with tty programs.
Definition: process.h:37
PtyProcess::fd
int fd()
Returns the filedescriptor of the process.
Definition: process.h:121
PtyProcess::setErase
void setErase(bool erase)
Overwrites the password as soon as it is used.
Definition: process.h:111
PtyProcess::setExitString
void setExitString(const TQCString &exit)
Sets the exit string.
Definition: process.h:83
PtyProcess::pid
int pid()
Returns the pid of the process.
Definition: process.h:126
PtyProcess::setTerminal
void setTerminal(bool terminal)
Enables/disables terminal output.
Definition: process.h:105
PtyProcess::checkPidStatus
checkPidStatus
Check process exit status for process pid.
Definition: process.h:162

tdesu

Skip menu "tdesu"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

tdesu

Skip menu "tdesu"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdesu by doxygen 1.9.1
This website is maintained by Timothy Pearson.