]> git.saurik.com Git - wxWidgets.git/blob - include/wx/unix/execute.h
upported wxHelpProvider docs fixes from r52197; minor tweaks to Doxygen docs of other...
[wxWidgets.git] / include / wx / unix / execute.h
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
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 #ifndef _WX_UNIX_EXECUTE_H
11 #define _WX_UNIX_EXECUTE_H
12
13 #include "wx/unix/pipe.h"
14
15 class WXDLLIMPEXP_FWD_BASE wxProcess;
16 class wxStreamTempInputBuffer;
17
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 {
23 int pid; // pid of the process
24 int tag; // port dependent value
25 wxProcess *process; // if !NULL: notified on process termination
26 int exitcode; // the exit code
27 };
28
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
44 fdOut =
45 fdErr = wxPipe::INVALID_FD;
46 #endif // wxUSE_STREAMS
47 }
48
49 // get the FD corresponding to the read end of the process end detection
50 // pipe and close the write one
51 int GetEndProcReadFD()
52 {
53 const int fd = pipeEndProcDetect.Detach(wxPipe::Read);
54 pipeEndProcDetect.Close();
55 return fd;
56 }
57
58
59 // wxExecute() flags
60 int flags;
61
62 // the pid of the child process
63 int pid;
64
65 // the associated process object or NULL
66 wxProcess *process;
67
68 // pipe used for end process detection
69 wxPipe pipeEndProcDetect;
70
71 #if wxUSE_STREAMS
72 // the input buffer bufOut is connected to stdout, this is why it is
73 // called bufOut and not bufIn
74 wxStreamTempInputBuffer *bufOut,
75 *bufErr;
76
77 // the corresponding FDs, -1 if not redirected
78 int fdOut,
79 fdErr;
80 #endif // wxUSE_STREAMS
81 };
82
83 // this function is called when the process terminates from port specific
84 // callback function and is common to all ports (src/unix/utilsunx.cpp)
85 extern WXDLLIMPEXP_BASE void wxHandleProcessTermination(wxEndProcessData *proc_data);
86
87 #endif // _WX_UNIX_EXECUTE_H