1 /////////////////////////////////////////////////////////////////////////////
2 // Name: unix/execute.h
3 // Purpose: private details of wxExecute() implementation
4 // Author: Vadim Zeitlin
6 // Copyright: (c) 1998 Robert Roebling, Julian Smart, Vadim Zeitlin
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_UNIX_EXECUTE_H
11 #define _WX_UNIX_EXECUTE_H
13 #include "wx/unix/pipe.h"
15 class WXDLLIMPEXP_FWD_BASE wxProcess
;
16 class wxStreamTempInputBuffer
;
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
23 int pid
, // pid of the process
24 tag
; // port dependent value
25 wxProcess
*process
; // if !NULL: notified on process termination
26 int exitcode
; // the exit code
29 // struct in which information is passed from wxExecute() to wxAppTraits
43 #endif // wxUSE_STREAMS
49 // the pid of the child process
52 // the associated process object or NULL
55 // pipe used for end process detection
56 wxPipe pipeEndProcDetect
;
59 // the input buffer bufOut is connected to stdout, this is why it is
60 // called bufOut and not bufIn
61 wxStreamTempInputBuffer
*bufOut
,
63 #endif // wxUSE_STREAMS
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)
68 extern WXDLLIMPEXP_BASE
void wxHandleProcessTermination(wxEndProcessData
*proc_data
);
70 // this function is called to associate the port-specific callback with the
71 // child process. The return valus is port-specific.
72 extern WXDLLIMPEXP_CORE
int wxAddProcessCallback(wxEndProcessData
*proc_data
, int fd
);
74 #if defined(__DARWIN__) && (defined(__WXMAC__) || defined(__WXCOCOA__))
75 // For ports (e.g. DARWIN) which can add callbacks based on the pid
76 extern int wxAddProcessCallbackForPid(wxEndProcessData
*proc_data
, int pid
);
79 #endif // _WX_UNIX_EXECUTE_H