30 #ifndef CPL_SPAWN_H_INCLUDED 31 #define CPL_SPAWN_H_INCLUDED 41 int CPL_DLL CPLSpawn(
const char *
const papszArgv[],
VSILFILE* fin,
VSILFILE* fout,
46 typedef HANDLE CPL_FILE_HANDLE;
47 #define CPL_FILE_INVALID_HANDLE CPL_NULLPTR 48 typedef DWORD CPL_PID;
50 #include <sys/types.h> 51 typedef int CPL_FILE_HANDLE;
52 #define CPL_FILE_INVALID_HANDLE -1 53 typedef pid_t CPL_PID;
56 typedef struct _CPLSpawnedProcess CPLSpawnedProcess;
58 CPLSpawnedProcess CPL_DLL* CPLSpawnAsync(
int (*pfnMain)(CPL_FILE_HANDLE, CPL_FILE_HANDLE),
59 const char *
const papszArgv[],
61 int bCreateOutputPipe,
63 char** papszOptions );
64 CPL_PID CPL_DLL CPLSpawnAsyncGetChildProcessId(CPLSpawnedProcess* p);
65 int CPL_DLL CPLSpawnAsyncFinish(CPLSpawnedProcess* p,
int bWait,
int bKill);
66 CPL_FILE_HANDLE CPL_DLL CPLSpawnAsyncGetInputFileHandle(CPLSpawnedProcess* p);
67 CPL_FILE_HANDLE CPL_DLL CPLSpawnAsyncGetOutputFileHandle(CPLSpawnedProcess* p);
68 CPL_FILE_HANDLE CPL_DLL CPLSpawnAsyncGetErrorFileHandle(CPLSpawnedProcess* p);
69 void CPL_DLL CPLSpawnAsyncCloseInputFileHandle(CPLSpawnedProcess* p);
70 void CPL_DLL CPLSpawnAsyncCloseOutputFileHandle(CPLSpawnedProcess* p);
71 void CPL_DLL CPLSpawnAsyncCloseErrorFileHandle(CPLSpawnedProcess* p);
73 int CPL_DLL CPLPipeRead(CPL_FILE_HANDLE fin,
void* data,
int length);
74 int CPL_DLL CPLPipeWrite(CPL_FILE_HANDLE fout,
const void* data,
int length);
78 #endif // CPL_SPAWN_H_INCLUDED
#define CPL_C_START
Macro to start a block of C symbols.
Definition: cpl_port.h:337
FILE VSILFILE
Opaque type for a FILE that implements the VSIVirtualHandle API.
Definition: cpl_vsi.h:156
#define CPL_C_END
Macro to end a block of C symbols.
Definition: cpl_port.h:339