process.h
Go to the documentation of this file.
/***************************************************************************
begin : Sat Dec 27 2003
copyright : (C) 2003-2010 by Martin Preuss
email : martin@libchipcard.de
***************************************************************************
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
* MA 02111-1307 USA *
* *
***************************************************************************/
#ifndef GWENHYWFAR_PROCESS_H
#define GWENHYWFAR_PROCESS_H
#include <gwenhywfar/gwenhywfarapi.h>
#include <gwenhywfar/types.h>
#include <gwenhywfar/syncio.h>
#include <gwenhywfar/error.h>
#define GWEN_PROCESS_FLAGS_REDIR_STDIN 0x00000001
#define GWEN_PROCESS_FLAGS_REDIR_STDOUT 0x00000002
#define GWEN_PROCESS_FLAGS_REDIR_STDERR 0x00000004
#define GWEN_PROCESS_FLAGS_DEFAULT 0
#ifdef __cplusplus
extern "C" {
#endif
typedef struct GWEN_PROCESS GWEN_PROCESS;
typedef enum {
GWEN_ProcessStateNotStarted=0,
GWEN_ProcessStateRunning,
GWEN_ProcessStateExited,
GWEN_ProcessStateAborted,
GWEN_ProcessStateStopped,
GWEN_ProcessStateUnknown
} GWEN_PROCESS_STATE;
GWENHYWFAR_API GWEN_PROCESS *GWEN_Process_new(void);
GWENHYWFAR_API void GWEN_Process_free(GWEN_PROCESS *pr);
GWENHYWFAR_API
uint32_t GWEN_Process_GetFlags(const GWEN_PROCESS *pr);
GWENHYWFAR_API
void GWEN_Process_SetFlags(GWEN_PROCESS *pr, uint32_t f);
GWENHYWFAR_API
void GWEN_Process_AddFlags(GWEN_PROCESS *pr, uint32_t f);
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_SetFolder(GWEN_PROCESS *pr, const char *s);
GWENHYWFAR_API GWEN_PROCESS_STATE GWEN_Process_Start(GWEN_PROCESS *pr,
const char *prg,
const char *args);
GWENHYWFAR_API GWEN_PROCESS_STATE GWEN_Process_CheckState(GWEN_PROCESS *pr);
GWENHYWFAR_API int GWEN_Process_GetResult(GWEN_PROCESS *pr);
GWENHYWFAR_API int GWEN_Process_Wait(GWEN_PROCESS *pr);
GWENHYWFAR_API int GWEN_Process_Terminate(GWEN_PROCESS *pr);
GWENHYWFAR_API
GWEN_SYNCIO *GWEN_Process_GetStdin(const GWEN_PROCESS *pr);
GWENHYWFAR_API
GWEN_SYNCIO *GWEN_Process_GetStdout(const GWEN_PROCESS *pr);
GWENHYWFAR_API
GWEN_SYNCIO *GWEN_Process_GetStderr(const GWEN_PROCESS *pr);
GWENHYWFAR_API
void GWEN_Process_SetFilenameStdIn(GWEN_PROCESS *pr, const char *s);
GWENHYWFAR_API
void GWEN_Process_SetFilenameStdOut(GWEN_PROCESS *pr, const char *s);
GWENHYWFAR_API
void GWEN_Process_SetFilenameStdErr(GWEN_PROCESS *pr, const char *s);
GWENHYWFAR_API
int GWEN_Process_RunCommandWaitAndGather(const char *prg, const char *args,
GWEN_BUFFER *stdOutBuffer,
GWEN_BUFFER *stdErrBuffer);
#ifdef __cplusplus
}
#endif
#endif /* GWENHYWFAR_PROCESS_H */
error.h
GWEN_BUFFER
struct GWEN_BUFFER GWEN_BUFFER
A dynamically resizeable text buffer.
Definition buffer.h:38
gwenhywfarapi.h
GWENHYWFAR_API
#define GWENHYWFAR_API
Definition gwenhywfarapi.h:67
GWEN_Process_GetStderr
GWENHYWFAR_API GWEN_SYNCIO * GWEN_Process_GetStderr(const GWEN_PROCESS *pr)
GWEN_Process_GetResult
GWENHYWFAR_API int GWEN_Process_GetResult(GWEN_PROCESS *pr)
GWEN_Process_Wait
GWENHYWFAR_API int GWEN_Process_Wait(GWEN_PROCESS *pr)
GWEN_Process_free
GWENHYWFAR_API void GWEN_Process_free(GWEN_PROCESS *pr)
GWEN_Process_SetFolder
GWENHYWFAR_API void GWEN_Process_SetFolder(GWEN_PROCESS *pr, const char *s)
GWEN_Process_new
GWENHYWFAR_API GWEN_PROCESS * GWEN_Process_new(void)
GWEN_Process_Terminate
GWENHYWFAR_API int GWEN_Process_Terminate(GWEN_PROCESS *pr)
GWEN_Process_Start
GWENHYWFAR_API GWEN_PROCESS_STATE GWEN_Process_Start(GWEN_PROCESS *pr, const char *prg, const char *args)
GWEN_Process_SetFilenameStdOut
GWENHYWFAR_API void GWEN_Process_SetFilenameStdOut(GWEN_PROCESS *pr, const char *s)
GWEN_Process_GetStdin
GWENHYWFAR_API GWEN_SYNCIO * GWEN_Process_GetStdin(const GWEN_PROCESS *pr)
GWEN_Process_CheckState
GWENHYWFAR_API GWEN_PROCESS_STATE GWEN_Process_CheckState(GWEN_PROCESS *pr)
GWEN_Process_RunCommandWaitAndGather
GWENHYWFAR_API int GWEN_Process_RunCommandWaitAndGather(const char *prg, const char *args, GWEN_BUFFER *stdOutBuffer, GWEN_BUFFER *stdErrBuffer)
GWEN_Process_SetFilenameStdErr
GWENHYWFAR_API void GWEN_Process_SetFilenameStdErr(GWEN_PROCESS *pr, const char *s)
GWEN_Process_GetStdout
GWENHYWFAR_API GWEN_SYNCIO * GWEN_Process_GetStdout(const GWEN_PROCESS *pr)
GWEN_PROCESS
struct GWEN_PROCESS GWEN_PROCESS
Definition process.h:49
GWEN_Process_SubFlags
GWENHYWFAR_API void GWEN_Process_SubFlags(GWEN_PROCESS *pr, uint32_t f)
GWEN_Process_GetFolder
GWENHYWFAR_API const char * GWEN_Process_GetFolder(const GWEN_PROCESS *pr)
GWEN_Process_AddFlags
GWENHYWFAR_API void GWEN_Process_AddFlags(GWEN_PROCESS *pr, uint32_t f)
GWEN_PROCESS_STATE
GWEN_PROCESS_STATE
Definition process.h:54
GWEN_ProcessStateRunning
@ GWEN_ProcessStateRunning
Definition process.h:58
GWEN_ProcessStateAborted
@ GWEN_ProcessStateAborted
Definition process.h:63
GWEN_ProcessStateStopped
@ GWEN_ProcessStateStopped
Definition process.h:65
GWEN_ProcessStateUnknown
@ GWEN_ProcessStateUnknown
Definition process.h:67
GWEN_ProcessStateNotStarted
@ GWEN_ProcessStateNotStarted
Definition process.h:56
GWEN_ProcessStateExited
@ GWEN_ProcessStateExited
Definition process.h:60
GWEN_Process_SetFilenameStdIn
GWENHYWFAR_API void GWEN_Process_SetFilenameStdIn(GWEN_PROCESS *pr, const char *s)
GWEN_Process_SetFlags
GWENHYWFAR_API void GWEN_Process_SetFlags(GWEN_PROCESS *pr, uint32_t f)
GWEN_Process_GetFlags
GWENHYWFAR_API uint32_t GWEN_Process_GetFlags(const GWEN_PROCESS *pr)
syncio.h
GWEN_SYNCIO
struct GWEN_SYNCIO GWEN_SYNCIO
Definition syncio.h:40
types.h