-rw-r--r-- | libopie2/opiecore/oprocess.h | 80 |
1 files changed, 40 insertions, 40 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,45 +1,49 @@ | |||
1 | /* This file is part of the KDE libraries | 1 | /* |
2 | Copyright (C) 1997 Christian Czezakte (e9025461@student.tuwien.ac.at) | 2 | This file is part of the Opie Project |
3 | 3 | Copyright (C) 2003-2004 Holger Freyther <zecke@handhelds.org> | |
4 | This library is free software; you can redistribute it and/or | 4 | Copyright (C) The Opie Team <opie-devel@handhelds.org> |
5 | modify it under the terms of the GNU Library General Public | 5 | =. Based on KProcess (C) 1997 Christian Czezatke (e9025461@student.tuwien.ac.at) |
6 | License as published by the Free Software Foundation; either | 6 | .=l. |
7 | version 2 of the License, or (at your option) any later version. | 7 | .>+-= |
8 | 8 | _;:, .> :=|. This program is free software; you can | |
9 | This library is distributed in the hope that it will be useful, | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | Library General Public License for more details. | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | 13 | ._= =} : or (at your option) any later version. | |
14 | You should have received a copy of the GNU Library General Public License | 14 | .%`+i> _;_. |
15 | along with this library; see the file COPYING.LIB. If not, write to | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | : .. .:, . . . without even the implied warranty of | ||
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
20 | ..}^=.= = ; Library General Public License for more | ||
21 | ++= -. .` .: details. | ||
22 | : = ...= . :.=- | ||
23 | -. .:....=;==+<; You should have received a copy of the GNU | ||
24 | -_. . . )=. = Library General Public License along with | ||
25 | -- :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
17 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
18 | */ | 29 | */ |
19 | // | ||
20 | // KPROCESS -- A class for handling child processes in KDE without | ||
21 | // having to take care of Un*x specific implementation details | ||
22 | // | ||
23 | // version 0.3.1, Jan 8th 1998 | ||
24 | // | ||
25 | // (C) Christian Czezatke | ||
26 | // e9025461@student.tuwien.ac.at | ||
27 | // Ported by Holger Freyther to the Open Palmtop Integrated Environment | ||
28 | // | ||
29 | 30 | ||
30 | #ifndef __kprocess_h__ | 31 | #ifndef OPROCESS_H |
31 | #define __kprocess_h__ | 32 | #define OPROCESS_H |
33 | |||
34 | /* QT */ | ||
35 | #include <qcstring.h> | ||
36 | #include <qobject.h> | ||
37 | #include <qvaluelist.h> | ||
32 | 38 | ||
39 | /* STD */ | ||
33 | #include <sys/types.h> // for pid_t | 40 | #include <sys/types.h> // for pid_t |
34 | #include <sys/wait.h> | 41 | #include <sys/wait.h> |
35 | #include <signal.h> | 42 | #include <signal.h> |
36 | #include <unistd.h> | 43 | #include <unistd.h> |
37 | #include <qvaluelist.h> | ||
38 | #include <qcstring.h> | ||
39 | #include <qobject.h> | ||
40 | 44 | ||
41 | class QSocketNotifier; | 45 | class QSocketNotifier; |
42 | class OProcessPrivate; | 46 | class OProcessPrivate; |
43 | 47 | ||
44 | /** | 48 | /** |
45 | * Child process invocation, monitoring and control. | 49 | * Child process invocation, monitoring and control. |
@@ -138,13 +142,13 @@ class OProcessPrivate; | |||
138 | *@li void @ref wroteStdin(OProcess *proc); | 142 | *@li void @ref wroteStdin(OProcess *proc); |
139 | *@li -- Indicates that all data that has been sent to the child process | 143 | *@li -- Indicates that all data that has been sent to the child process |
140 | *by a prior call to @ref writeStdin() has actually been transmitted to the | 144 | *by a prior call to @ref writeStdin() has actually been transmitted to the |
141 | *client . | 145 | *client . |
142 | * | 146 | * |
143 | *@author Christian Czezakte e9025461@student.tuwien.ac.at | 147 | *@author Christian Czezakte e9025461@student.tuwien.ac.at |
144 | * | 148 | *@author Holger Freyther (Opie Port) |
145 | * | 149 | * |
146 | **/ | 150 | **/ |
147 | class OProcess : public QObject | 151 | class OProcess : public QObject |
148 | { | 152 | { |
149 | Q_OBJECT | 153 | Q_OBJECT |
150 | 154 | ||
@@ -392,13 +396,16 @@ public: | |||
392 | bool closeStderr(); | 396 | bool closeStderr(); |
393 | 397 | ||
394 | /** | 398 | /** |
395 | * Lets you see what your arguments are for debugging. | 399 | * Lets you see what your arguments are for debugging. |
396 | */ | 400 | */ |
397 | 401 | ||
398 | const QValueList<QCString> &args() { return arguments; } | 402 | const QValueList<QCString> &args() |
403 | { | ||
404 | return arguments; | ||
405 | } | ||
399 | 406 | ||
400 | /** | 407 | /** |
401 | * Controls whether the started process should drop any | 408 | * Controls whether the started process should drop any |
402 | * setuid/segid privileges or whether it should keep them | 409 | * setuid/segid privileges or whether it should keep them |
403 | * | 410 | * |
404 | * The default is @p false : drop privileges | 411 | * The default is @p false : drop privileges |
@@ -451,14 +458,12 @@ public: | |||
451 | * Deleting the OProcess will no longer kill the child process. | 458 | * Deleting the OProcess will no longer kill the child process. |
452 | * Note that the current process remains the parent process of the | 459 | * Note that the current process remains the parent process of the |
453 | * child process. | 460 | * child process. |
454 | */ | 461 | */ |
455 | void detach(); | 462 | void detach(); |
456 | 463 | ||
457 | |||
458 | |||
459 | signals: | 464 | signals: |
460 | 465 | ||
461 | /** | 466 | /** |
462 | * Emitted after the process has terminated when | 467 | * Emitted after the process has terminated when |
463 | * the process was run in the @p NotifyOnExit (==default option to | 468 | * the process was run in the @p NotifyOnExit (==default option to |
464 | * @ref start()) or the @ref Block mode. | 469 | * @ref start()) or the @ref Block mode. |
@@ -519,13 +524,12 @@ signals: | |||
519 | * Emitted after all the data that has been | 524 | * Emitted after all the data that has been |
520 | * specified by a prior call to @ref writeStdin() has actually been | 525 | * specified by a prior call to @ref writeStdin() has actually been |
521 | * written to the child process. | 526 | * written to the child process. |
522 | **/ | 527 | **/ |
523 | void wroteStdin(OProcess *proc); | 528 | void wroteStdin(OProcess *proc); |
524 | 529 | ||
525 | |||
526 | protected slots: | 530 | protected slots: |
527 | 531 | ||
528 | /** | 532 | /** |
529 | * This slot gets activated when data from the child's stdout arrives. | 533 | * This slot gets activated when data from the child's stdout arrives. |
530 | * It usually calls "childOutput" | 534 | * It usually calls "childOutput" |
531 | */ | 535 | */ |
@@ -706,13 +710,12 @@ protected: | |||
706 | /** | 710 | /** |
707 | * @ref OProcessController is a friend of OProcess because it has to have | 711 | * @ref OProcessController is a friend of OProcess because it has to have |
708 | * access to various data members. | 712 | * access to various data members. |
709 | */ | 713 | */ |
710 | friend class OProcessController; | 714 | friend class OProcessController; |
711 | 715 | ||
712 | |||
713 | private: | 716 | private: |
714 | /** | 717 | /** |
715 | * Searches for a valid shell. | 718 | * Searches for a valid shell. |
716 | * Here is the algorithm used for finding an executable shell: | 719 | * Here is the algorithm used for finding an executable shell: |
717 | * | 720 | * |
718 | * @li Try the executable pointed to by the "SHELL" environment | 721 | * @li Try the executable pointed to by the "SHELL" environment |
@@ -734,14 +737,11 @@ private: | |||
734 | // Disallow assignment and copy-construction | 737 | // Disallow assignment and copy-construction |
735 | OProcess( const OProcess& ); | 738 | OProcess( const OProcess& ); |
736 | OProcess& operator= ( const OProcess& ); | 739 | OProcess& operator= ( const OProcess& ); |
737 | 740 | ||
738 | private: | 741 | private: |
739 | void init ( ); | 742 | void init ( ); |
740 | |||
741 | OProcessPrivate *d; | 743 | OProcessPrivate *d; |
742 | }; | 744 | }; |
743 | 745 | ||
744 | |||
745 | |||
746 | #endif | 746 | #endif |
747 | 747 | ||