process.h

Go to the documentation of this file.
00001 /***************************************************************************
00002   $RCSfile$
00003                              -------------------
00004     cvs         : $Id$
00005     begin       : Sat Dec 27 2003
00006     copyright   : (C) 2003 by Martin Preuss
00007     email       : martin@libchipcard.de
00008 
00009 
00010  ***************************************************************************
00011  *                                                                         *
00012  *   This library is free software; you can redistribute it and/or         *
00013  *   modify it under the terms of the GNU Lesser General Public            *
00014  *   License as published by the Free Software Foundation; either          *
00015  *   version 2.1 of the License, or (at your option) any later version.    *
00016  *                                                                         *
00017  *   This library is distributed in the hope that it will be useful,       *
00018  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00019  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00020  *   Lesser General Public License for more details.                       *
00021  *                                                                         *
00022  *   You should have received a copy of the GNU Lesser General Public      *
00023  *   License along with this library; if not, write to the Free Software   *
00024  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
00025  *   MA  02111-1307  USA                                                   *
00026  *                                                                         *
00027  ***************************************************************************/
00028 
00029 
00030 #ifndef GWENHYWFAR_PROCESS_H
00031 #define GWENHYWFAR_PROCESS_H
00032 
00033 #include <gwenhywfar/gwenhywfarapi.h>
00034 #include <gwenhywfar/types.h>
00035 #include <gwenhywfar/bufferedio.h>
00036 #include <gwenhywfar/error.h>
00037 
00039 #define GWEN_PROCESS_FLAGS_REDIR_STDIN  0x00000001
00040 
00041 #define GWEN_PROCESS_FLAGS_REDIR_STDOUT 0x00000002
00042 
00043 #define GWEN_PROCESS_FLAGS_REDIR_STDERR 0x00000004
00044 
00045 #define GWEN_PROCESS_FLAGS_DEFAULT 0
00046 
00047 
00048 #ifdef __cplusplus
00049 extern "C" {
00050 #endif
00051 
00052   typedef struct GWEN_PROCESS GWEN_PROCESS;
00053 
00057   typedef enum {
00059     GWEN_ProcessStateNotStarted=0,
00061     GWEN_ProcessStateRunning,
00063     GWEN_ProcessStateExited,
00066     GWEN_ProcessStateAborted,
00068     GWEN_ProcessStateStopped,
00070     GWEN_ProcessStateUnknown
00071   } GWEN_PROCESS_STATE;
00072 
00073 
00078   GWENHYWFAR_API GWEN_PROCESS *GWEN_Process_new();
00079 
00086   GWENHYWFAR_API void GWEN_Process_free(GWEN_PROCESS *pr);
00087 
00092   GWENHYWFAR_API
00093     uint32_t GWEN_Process_GetFlags(const GWEN_PROCESS *pr);
00094 
00099   GWENHYWFAR_API
00100     void GWEN_Process_SetFlags(GWEN_PROCESS *pr, uint32_t f);
00101 
00106   GWENHYWFAR_API
00107     void GWEN_Process_AddFlags(GWEN_PROCESS *pr, uint32_t f);
00108 
00113   GWENHYWFAR_API
00114     void GWEN_Process_SubFlags(GWEN_PROCESS *pr, uint32_t f);
00115 
00123   GWENHYWFAR_API GWEN_PROCESS_STATE GWEN_Process_Start(GWEN_PROCESS *pr,
00124                                                        const char *prg,
00125                                                        const char *args);
00126 
00130   GWENHYWFAR_API GWEN_PROCESS_STATE GWEN_Process_CheckState(GWEN_PROCESS *pr);
00131 
00136   GWENHYWFAR_API int GWEN_Process_GetResult(GWEN_PROCESS *pr);
00137 
00141   GWENHYWFAR_API int GWEN_Process_Wait(GWEN_PROCESS *pr);
00142 
00148   GWENHYWFAR_API int GWEN_Process_Terminate(GWEN_PROCESS *pr);
00149 
00155   GWENHYWFAR_API
00156     GWEN_BUFFEREDIO *GWEN_Process_GetStdin(const GWEN_PROCESS *pr);
00157 
00163   GWENHYWFAR_API
00164     GWEN_BUFFEREDIO *GWEN_Process_GetStdout(const GWEN_PROCESS *pr);
00165 
00171   GWENHYWFAR_API
00172     GWEN_BUFFEREDIO *GWEN_Process_GetStderr(const GWEN_PROCESS *pr);
00173 
00174 
00175 #ifdef __cplusplus
00176 }
00177 #endif
00178 
00179 
00180 #endif /* GWENHYWFAR_PROCESS_H */
00181 
00182 

Generated on Wed Jul 9 13:12:28 2008 for gwenhywfar by  doxygen 1.5.6