-
Notifications
You must be signed in to change notification settings - Fork 31
/
processpil.h
56 lines (51 loc) · 1.37 KB
/
processpil.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*******************************************************************
* Process Platform Independent Layer
* Distributed under GPL license
* Copyright (c) 2005-06 Stanley Huang <[email protected]>
* All rights reserved.
*******************************************************************/
#ifndef _PROCESSPIL_H
#define _PROCESSPIL_H
#define SF_ALLOC 0x1
#define SF_SHOW_WINDOW 0x2
#define SF_READ_STDOUT_ALL 0x4
#define SF_CONVERT_LF 0x8
#define SF_REDIRECT_STDIN 0x1000
#define SF_REDIRECT_STDOUT 0x2000
#define SF_REDIRECT_STDERR 0x4000
#define SF_REDIRECT_OUTPUT (0x8000 | SF_REDIRECT_STDOUT)
typedef struct {
unsigned int flags;
char *pchCurDir;
char *pchPath;
#ifdef WIN32
HANDLE fdRead;
HANDLE fdWrite;
int fdStdErr;
PROCESS_INFORMATION piProcInfo;
HWND hWnd;
#else
int fdRead;
int fdWrite;
int pid;
#endif
char *pchEnv;
char *buffer;
int iRetCode;
int iBufferSize;
int locked;
}SHELL_PARAM;
#ifdef __cplusplus
extern "C" {
#endif
int ShellRead(SHELL_PARAM* param, int timeout);
int ShellWrite(SHELL_PARAM* param, void* data, int bytes);
void ShellClean(SHELL_PARAM* param);
int ShellWait(SHELL_PARAM* param, int iTimeout);
int ShellExec(SHELL_PARAM* param, const char* cmdline);
int ShellTerminate(SHELL_PARAM* param);
int ShellRun(SHELL_PARAM* param, const char* cmdline);
#ifdef __cplusplus
}
#endif
#endif