gwenhywfar 5.11.2beta
process.h
Go to the documentation of this file.
1/***************************************************************************
2 begin : Sat Dec 27 2003
3 copyright : (C) 2003-2010 by Martin Preuss
4 email : martin@libchipcard.de
5
6
7 ***************************************************************************
8 * *
9 * This library is free software; you can redistribute it and/or *
10 * modify it under the terms of the GNU Lesser General Public *
11 * License as published by the Free Software Foundation; either *
12 * version 2.1 of the License, or (at your option) any later version. *
13 * *
14 * This library is distributed in the hope that it will be useful, *
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
17 * Lesser General Public License for more details. *
18 * *
19 * You should have received a copy of the GNU Lesser General Public *
20 * License along with this library; if not, write to the Free Software *
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
22 * MA 02111-1307 USA *
23 * *
24 ***************************************************************************/
25
26
27#ifndef GWENHYWFAR_PROCESS_H
28#define GWENHYWFAR_PROCESS_H
29
31#include <gwenhywfar/types.h>
32#include <gwenhywfar/syncio.h>
33#include <gwenhywfar/error.h>
34
36#define GWEN_PROCESS_FLAGS_REDIR_STDIN 0x00000001
38#define GWEN_PROCESS_FLAGS_REDIR_STDOUT 0x00000002
40#define GWEN_PROCESS_FLAGS_REDIR_STDERR 0x00000004
41
42#define GWEN_PROCESS_FLAGS_DEFAULT 0
43
44
45#ifdef __cplusplus
46extern "C" {
47#endif
48
50
54typedef enum {
69
70
76
84
91
97void GWEN_Process_SetFlags(GWEN_PROCESS *pr, uint32_t f);
98
105
112
118
123void GWEN_Process_SetFolder(GWEN_PROCESS *pr, const char *s);
124
125
134 const char *prg,
135 const char *args);
136
141
147
152
159
167
175
183
184
185
188
191
194
195
208int GWEN_Process_RunCommandWaitAndGather(const char *prg, const char *args,
209 GWEN_BUFFER *stdOutBuffer,
210 GWEN_BUFFER *stdErrBuffer);
211
212
213#ifdef __cplusplus
214}
215#endif
216
217
218#endif /* GWENHYWFAR_PROCESS_H */
219
220
struct GWEN_BUFFER GWEN_BUFFER
A dynamically resizeable text buffer.
Definition: buffer.h:38
#define GWENHYWFAR_API
Definition: gwenhywfarapi.h:67
GWENHYWFAR_API GWEN_SYNCIO * GWEN_Process_GetStderr(const GWEN_PROCESS *pr)
GWENHYWFAR_API int GWEN_Process_GetResult(GWEN_PROCESS *pr)
GWENHYWFAR_API int GWEN_Process_Wait(GWEN_PROCESS *pr)
GWENHYWFAR_API void GWEN_Process_free(GWEN_PROCESS *pr)
GWENHYWFAR_API void GWEN_Process_SetFolder(GWEN_PROCESS *pr, const char *s)
GWENHYWFAR_API GWEN_PROCESS * GWEN_Process_new(void)
GWENHYWFAR_API int GWEN_Process_Terminate(GWEN_PROCESS *pr)
GWENHYWFAR_API GWEN_PROCESS_STATE GWEN_Process_Start(GWEN_PROCESS *pr, const char *prg, const char *args)
GWENHYWFAR_API void GWEN_Process_SetFilenameStdOut(GWEN_PROCESS *pr, const char *s)
GWENHYWFAR_API GWEN_SYNCIO * GWEN_Process_GetStdin(const GWEN_PROCESS *pr)
GWENHYWFAR_API GWEN_PROCESS_STATE GWEN_Process_CheckState(GWEN_PROCESS *pr)
GWENHYWFAR_API int GWEN_Process_RunCommandWaitAndGather(const char *prg, const char *args, GWEN_BUFFER *stdOutBuffer, GWEN_BUFFER *stdErrBuffer)
GWENHYWFAR_API void GWEN_Process_SetFilenameStdErr(GWEN_PROCESS *pr, const char *s)
GWENHYWFAR_API GWEN_SYNCIO * GWEN_Process_GetStdout(const GWEN_PROCESS *pr)
struct GWEN_PROCESS GWEN_PROCESS
Definition: process.h:49
GWENHYWFAR_API void GWEN_Process_SubFlags(GWEN_PROCESS *pr, uint32_t f)
GWENHYWFAR_API const char * GWEN_Process_GetFolder(const GWEN_PROCESS *pr)
GWENHYWFAR_API void GWEN_Process_AddFlags(GWEN_PROCESS *pr, uint32_t f)
GWEN_PROCESS_STATE
Definition: process.h:54
@ GWEN_ProcessStateRunning
Definition: process.h:58
@ GWEN_ProcessStateAborted
Definition: process.h:63
@ GWEN_ProcessStateStopped
Definition: process.h:65
@ GWEN_ProcessStateUnknown
Definition: process.h:67
@ GWEN_ProcessStateNotStarted
Definition: process.h:56
@ GWEN_ProcessStateExited
Definition: process.h:60
GWENHYWFAR_API void GWEN_Process_SetFilenameStdIn(GWEN_PROCESS *pr, const char *s)
GWENHYWFAR_API void GWEN_Process_SetFlags(GWEN_PROCESS *pr, uint32_t f)
GWENHYWFAR_API uint32_t GWEN_Process_GetFlags(const GWEN_PROCESS *pr)
struct GWEN_SYNCIO GWEN_SYNCIO
Definition: syncio.h:40