Diffstat (limited to 'libopie2/opiecore/oprocess.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/oprocess.h | 152 |
1 files changed, 76 insertions, 76 deletions
diff --git a/libopie2/opiecore/oprocess.h b/libopie2/opiecore/oprocess.h index 8dd19b5..352485b 100644 --- a/libopie2/opiecore/oprocess.h +++ b/libopie2/opiecore/oprocess.h @@ -1,41 +1,45 @@ -/* This file is part of the KDE libraries - Copyright (C) 1997 Christian Czezakte (e9025461@student.tuwien.ac.at) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. +/* + This file is part of the Opie Project + Copyright (C) 2003-2004 Holger Freyther <zecke@handhelds.org> + Copyright (C) The Opie Team <opie-devel@handhelds.org> + =. Based on KProcess (C) 1997 Christian Czezatke (e9025461@student.tuwien.ac.at) + .=l. + .>+-= +_;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library General Public +.="- .-=="i, .._ License as published by the Free Software +- . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. This program is distributed in the hope that + + . -:. = it will be useful, but WITHOUT ANY WARRANTY; + : .. .:, . . . without even the implied warranty of + =_ + =;=|` MERCHANTABILITY or FITNESS FOR A + _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= = ; Library General Public License for more +++= -. .` .: details. +: = ...= . :.=- +-. .:....=;==+<; You should have received a copy of the GNU + -_. . . )=. = Library General Public License along with + -- :-=` this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ -// -// KPROCESS -- A class for handling child processes in KDE without -// having to take care of Un*x specific implementation details -// -// version 0.3.1, Jan 8th 1998 -// -// (C) Christian Czezatke -// e9025461@student.tuwien.ac.at -// Ported by Holger Freyther to the Open Palmtop Integrated Environment -// - -#ifndef __kprocess_h__ -#define __kprocess_h__ +#ifndef OPROCESS_H +#define OPROCESS_H + +/* QT */ +#include <qcstring.h> +#include <qobject.h> +#include <qvaluelist.h> + +/* STD */ #include <sys/types.h> // for pid_t #include <sys/wait.h> #include <signal.h> #include <unistd.h> -#include <qvaluelist.h> -#include <qcstring.h> -#include <qobject.h> class QSocketNotifier; @@ -142,5 +146,5 @@ class OProcessPrivate; * *@author Christian Czezakte e9025461@student.tuwien.ac.at - * + *@author Holger Freyther (Opie Port) * **/ @@ -188,13 +192,13 @@ public: * Constructor */ - OProcess(QObject *parent = 0, const char *name = 0); + OProcess( QObject *parent = 0, const char *name = 0 ); /** * Constructor */ - OProcess(const QString &arg0, QObject *parent = 0, const char *name = 0); + OProcess( const QString &arg0, QObject *parent = 0, const char *name = 0 ); /** * Constructor */ - OProcess(const QStringList &args, QObject *parent = 0, const char *name = 0); + OProcess( const QStringList &args, QObject *parent = 0, const char *name = 0 ); /** @@ -221,5 +225,5 @@ public: */ - bool setExecutable(const QString& proc); + bool setExecutable( const QString& proc ); @@ -235,13 +239,13 @@ public: * **/ - OProcess &operator<<(const QString& arg); + OProcess &operator<<( const QString& arg ); /** * Similar to previous method, takes a char *, supposed to be in locale 8 bit already. */ - OProcess &operator<<(const char * arg); + OProcess &operator<<( const char * arg ); /** * Similar to previous method, takes a QCString, supposed to be in locale 8 bit already. */ - OProcess &operator<<(const QCString & arg); + OProcess &operator<<( const QCString & arg ); /** @@ -249,5 +253,5 @@ public: * in a single method call, or add a list of arguments. **/ - OProcess &operator<<(const QStringList& args); + OProcess &operator<<( const QStringList& args ); /** @@ -279,6 +283,6 @@ public: * (see above for error conditions) **/ - virtual bool start(RunMode runmode = NotifyOnExit, - Communication comm = NoCommunication); + virtual bool start( RunMode runmode = NotifyOnExit, + Communication comm = NoCommunication ); /** @@ -288,5 +292,5 @@ public: * @return @p true if the signal was delivered successfully. */ - virtual bool kill(int signo = SIGTERM); + virtual bool kill( int signo = SIGTERM ); /** @@ -334,5 +338,5 @@ public: * it does not have a valid exit status. */ - int exitStatus() const; + int exitStatus() const; @@ -361,5 +365,5 @@ public: * the child process is no longer alive... **/ - bool writeStdin(const char *buffer, int buflen); + bool writeStdin( const char *buffer, int buflen ); void flushStdin(); @@ -396,5 +400,8 @@ public: */ - const QValueList<QCString> &args() { return arguments; } + const QValueList<QCString> &args() + { + return arguments; + } /** @@ -404,5 +411,5 @@ public: * The default is @p false : drop privileges */ - void setRunPrivileged(bool keepPrivileges); + void setRunPrivileged( bool keepPrivileges ); /** @@ -416,5 +423,5 @@ public: * This function must be called before starting the process. */ - void setEnvironment(const QString &name, const QString &value); + void setEnvironment( const QString &name, const QString &value ); /** @@ -423,5 +430,5 @@ public: * This function must be called before starting the process. */ - void setWorkingDirectory(const QString &dir); + void setWorkingDirectory( const QString &dir ); /** @@ -436,5 +443,5 @@ public: * @see quote() */ - void setUseShell(bool useShell, const char *shell = 0); + void setUseShell( bool useShell, const char *shell = 0 ); /** @@ -444,5 +451,5 @@ public: * It also prevents expansion of wild cards and environment variables. */ - static QString quote(const QString &arg); + static QString quote( const QString &arg ); /** @@ -455,6 +462,4 @@ public: void detach(); - - signals: @@ -464,5 +469,5 @@ signals: * @ref start()) or the @ref Block mode. **/ - void processExited(OProcess *proc); + void processExited( OProcess *proc ); @@ -481,5 +486,5 @@ signals: * data structures before returning from this slot. **/ - void receivedStdout(OProcess *proc, char *buffer, int buflen); + void receivedStdout( OProcess *proc, char *buffer, int buflen ); /** @@ -498,5 +503,5 @@ signals: * The data still has to be read from file descriptor @p fd. **/ - void receivedStdout(int fd, int &len); + void receivedStdout( int fd, int &len ); @@ -514,5 +519,5 @@ signals: * data structures before returning from this slot. */ - void receivedStderr(OProcess *proc, char *buffer, int buflen); + void receivedStderr( OProcess *proc, char *buffer, int buflen ); /** @@ -521,6 +526,5 @@ signals: * written to the child process. **/ - void wroteStdin(OProcess *proc); - + void wroteStdin( OProcess *proc ); protected slots: @@ -530,5 +534,5 @@ protected slots: * It usually calls "childOutput" */ - void slotChildOutput(int fdno); + void slotChildOutput( int fdno ); /** @@ -536,5 +540,5 @@ protected slots: * It usually calls "childError" */ - void slotChildError(int fdno); + void slotChildError( int fdno ); /* Slot functions for capturing stdout and stderr of the child @@ -546,5 +550,5 @@ protected slots: * available, this function must disable the QSocketNotifier "innot". */ - void slotSendData(int dummy); + void slotSendData( int dummy ); protected: @@ -625,5 +629,5 @@ protected: * network communication, for example. */ - virtual int setupCommunication(Communication comm); + virtual int setupCommunication( Communication comm ); /** @@ -655,5 +659,5 @@ protected: * not running in the "DontCare" mode). */ - virtual void processHasExited(int state); + virtual void processHasExited( int state ); /** @@ -667,7 +671,7 @@ protected: * the socket descriptors for stdin/stdout/stderr. */ - int out[2]; - int in[2]; - int err[2]; + int out[ 2 ]; + int in[ 2 ]; + int err[ 2 ]; /** @@ -689,5 +693,5 @@ protected: * "@ref receivedStderr". */ - int childOutput(int fdno); + int childOutput( int fdno ); /** @@ -696,5 +700,5 @@ protected: * "@ref receivedStderr" */ - int childError(int fdno); + int childError( int fdno ); // information about the data that has to be sent to the child: @@ -710,5 +714,4 @@ protected: friend class OProcessController; - private: /** @@ -730,5 +733,5 @@ private: * is actually executable at all. */ - bool isExecutable(const QCString &filename); + bool isExecutable( const QCString &filename ); // Disallow assignment and copy-construction @@ -738,10 +741,7 @@ private: private: void init ( ); - OProcessPrivate *d; }; - - #endif |