process.h

Go to the documentation of this file.
00001 /***************************************************************************
00002   $RCSfile: process.h,v $
00003                              -------------------
00004     cvs         : $Id: process.h,v 1.5 2004/08/20 20:35:27 aquamaniac Exp $
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 
00077   GWENHYWFAR_API GWEN_ERRORCODE GWEN_Process_ModuleInit();
00078 
00082   GWENHYWFAR_API GWEN_ERRORCODE GWEN_Process_ModuleFini();
00083 
00084 
00089   GWENHYWFAR_API GWEN_PROCESS *GWEN_Process_new();
00090 
00097   GWENHYWFAR_API void GWEN_Process_free(GWEN_PROCESS *pr);
00098 
00103   GWENHYWFAR_API
00104     GWEN_TYPE_UINT32 GWEN_Process_GetFlags(const GWEN_PROCESS *pr);
00105 
00110   GWENHYWFAR_API
00111     void GWEN_Process_SetFlags(GWEN_PROCESS *pr, GWEN_TYPE_UINT32 f);
00112 
00117   GWENHYWFAR_API
00118     void GWEN_Process_AddFlags(GWEN_PROCESS *pr, GWEN_TYPE_UINT32 f);
00119 
00124   GWENHYWFAR_API
00125     void GWEN_Process_SubFlags(GWEN_PROCESS *pr, GWEN_TYPE_UINT32 f);
00126 
00134   GWENHYWFAR_API GWEN_PROCESS_STATE GWEN_Process_Start(GWEN_PROCESS *pr,
00135                                                        const char *prg,
00136                                                        const char *args);
00137 
00141   GWENHYWFAR_API GWEN_PROCESS_STATE GWEN_Process_CheckState(GWEN_PROCESS *pr);
00142 
00147   GWENHYWFAR_API int GWEN_Process_GetResult(GWEN_PROCESS *pr);
00148 
00152   GWENHYWFAR_API int GWEN_Process_Wait(GWEN_PROCESS *pr);
00153 
00159   GWENHYWFAR_API int GWEN_Process_Terminate(GWEN_PROCESS *pr);
00160 
00166   GWENHYWFAR_API
00167     GWEN_BUFFEREDIO *GWEN_Process_GetStdin(const GWEN_PROCESS *pr);
00168 
00174   GWENHYWFAR_API
00175     GWEN_BUFFEREDIO *GWEN_Process_GetStdout(const GWEN_PROCESS *pr);
00176 
00182   GWENHYWFAR_API
00183     GWEN_BUFFEREDIO *GWEN_Process_GetStderr(const GWEN_PROCESS *pr);
00184 
00185 
00186 #ifdef __cplusplus
00187 }
00188 #endif
00189 
00190 
00191 #endif /* GWENHYWFAR_PROCESS_H */
00192 
00193 

Generated on Thu Mar 9 17:30:14 2006 for gwenhywfar by  doxygen 1.4.6