]>
Commit | Line | Data |
---|---|---|
518b5d2f VZ |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: unix/execute.h | |
3 | // Purpose: private details of wxExecute() implementation | |
4 | // Author: Vadim Zeitlin | |
5 | // Id: $Id$ | |
6 | // Copyright: (c) 1998 Robert Roebling, Julian Smart, Vadim Zeitlin | |
65571936 | 7 | // Licence: wxWindows licence |
518b5d2f VZ |
8 | ///////////////////////////////////////////////////////////////////////////// |
9 | ||
10 | #ifndef _WX_UNIX_EXECUTE_H | |
11 | #define _WX_UNIX_EXECUTE_H | |
12 | ||
e2478fde VZ |
13 | #include "wx/unix/pipe.h" |
14 | ||
b5dbe15d | 15 | class WXDLLIMPEXP_FWD_BASE wxProcess; |
e2478fde VZ |
16 | class wxStreamTempInputBuffer; |
17 | ||
518b5d2f VZ |
18 | // if pid > 0, the execution is async and the data is freed in the callback |
19 | // executed when the process terminates, if pid < 0, the execution is | |
20 | // synchronous and the caller (wxExecute) frees the data | |
21 | struct wxEndProcessData | |
22 | { | |
46c7e1a1 VS |
23 | int pid; // pid of the process |
24 | int tag; // port dependent value | |
518b5d2f VZ |
25 | wxProcess *process; // if !NULL: notified on process termination |
26 | int exitcode; // the exit code | |
27 | }; | |
28 | ||
e2478fde VZ |
29 | // struct in which information is passed from wxExecute() to wxAppTraits |
30 | // methods | |
31 | struct wxExecuteData | |
32 | { | |
33 | wxExecuteData() | |
34 | { | |
35 | flags = | |
36 | pid = 0; | |
37 | ||
38 | process = NULL; | |
39 | ||
40 | #if wxUSE_STREAMS | |
41 | bufOut = | |
42 | bufErr = NULL; | |
43 | #endif // wxUSE_STREAMS | |
44 | } | |
45 | ||
46 | // wxExecute() flags | |
47 | int flags; | |
48 | ||
49 | // the pid of the child process | |
50 | int pid; | |
51 | ||
52 | // the associated process object or NULL | |
53 | wxProcess *process; | |
54 | ||
55 | // pipe used for end process detection | |
56 | wxPipe pipeEndProcDetect; | |
57 | ||
58 | #if wxUSE_STREAMS | |
59 | // the input buffer bufOut is connected to stdout, this is why it is | |
60 | // called bufOut and not bufIn | |
61 | wxStreamTempInputBuffer *bufOut, | |
62 | *bufErr; | |
63 | #endif // wxUSE_STREAMS | |
64 | }; | |
65 | ||
518b5d2f VZ |
66 | // this function is called when the process terminates from port specific |
67 | // callback function and is common to all ports (src/unix/utilsunx.cpp) | |
20123d49 | 68 | extern WXDLLIMPEXP_BASE void wxHandleProcessTermination(wxEndProcessData *proc_data); |
518b5d2f | 69 | |
518b5d2f | 70 | #endif // _WX_UNIX_EXECUTE_H |