00001 /* ut_process.h 00002 * 00003 * Copyright (C) 2002 AbiWord developers (see CREDITS.TXT for list). 00004 * Initially written by Kenneth J. Davis, I disclaim any copyright. 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00019 * 02110-1301 USA. 00020 */ 00021 00022 #ifndef UT_PROCESS_H 00023 #define UT_PROCESS_H 00024 00025 00026 /* include standard headers */ 00027 #include <stddef.h> /* NULL and other common definitions */ 00028 #include <stdlib.h> 00029 #include <stdio.h> 00030 00031 /* Note: sys/types.h should be included before sys/stat.h */ 00032 #include <sys/types.h> 00033 #include <sys/stat.h> 00034 00035 00036 /* platform specific code */ 00037 #define WIN32_LEAN_AND_MEAN /* skip some unnecessary extras */ 00038 #include <windows.h> 00039 typedef PROCESS_INFORMATION ProcessInfo; /* Win32 specific structure */ 00040 00041 00042 // returns true if process is still alive 00043 bool isProcessStillAlive(ProcessInfo &pI); 00044 // returns true if process successfully started, false otherwise 00045 bool createChildProcess(const char *app, const char *args, ProcessInfo *pI); 00046 // will [try to] kill the process if it is still running 00047 void endProcess(ProcessInfo &pI); 00048 00049 00050 #endif /* UT_PROCESS_H */