00001 // Copyright (C) 2001, Compaq Computer Corporation 00002 // 00003 // This file is part of Vesta. 00004 // 00005 // Vesta is free software; you can redistribute it and/or 00006 // modify it under the terms of the GNU Lesser General Public 00007 // License as published by the Free Software Foundation; either 00008 // version 2.1 of the License, or (at your option) any later version. 00009 // 00010 // Vesta is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 // Lesser General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public 00016 // License along with Vesta; if not, write to the Free Software 00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 00019 // File: PrimRunTool.H 00020 // Last Modified On Mon Aug 18 14:03:47 EDT 2003 by ken@xorian.net 00021 // Modified On Mon Jan 31 13:39:07 PST 2000 by yuanyu 00022 // Modified On Wed Feb 10 16:58:42 PST 1999 by heydon 00023 // Modified On Fri Mar 1 12:49:46 PST 1996 by levin 00024 // Modified On Fri Jan 26 18:58:51 PST 1996 by horning 00025 00026 #ifndef PrimRunTool_H 00027 #define PrimRunTool_H 00028 00029 #include "Val.H" 00030 #include <FP.H> 00031 #include <VestaSource.H> 00032 00033 typedef struct { 00034 SrcLoc *loc; 00035 TextVC *platform; 00036 ListVC *command_line; 00037 TextVC *stdin_data; 00038 TextVC *stdout_treatment; 00039 TextVC *stderr_treatment; 00040 TextVC *status_treatment; 00041 TextVC *signal_treatment; 00042 IntegerVC *fp_content; 00043 TextVC *wd_name; 00044 BooleanVC *existing_writable; 00045 BindingVC *dot; 00046 } RunToolArgs; 00047 00048 // Launch a tool: 00049 Val RunTool(const RunToolArgs &args, VestaSource*& rootForTool); 00050 /* 00051 run_tool_result = 00052 [ 00053 code: INT, if 'signal' is 0, 'code' is the result 00054 (i.e., the exit status) reported by the tool 00055 signal: INT, if the tool terminated abnormally, this 00056 specifies the reason. 00057 stdout_written: BOOL, meaningful only for "reportError" 00058 stderr_written: BOOL, meaningful only for "reportError" 00059 stdout: TEXT, defined iff stdoutTreatment == "value" 00060 stderr: TEXT, defined iff stderrTreatment == "value" 00061 root: BINDING, files created elsewhere in the file system 00062 ] 00063 run_tool_result->dps records the files requested during this run. 00064 */ 00065 00066 typedef struct { 00067 VestaSource::typeTag type; 00068 Text arc; 00069 unsigned int index; 00070 } nodeinfo; 00071 00072 typedef nodeinfo* NodeInfo; 00073 00074 void DeleteRootForTool(VestaSource* rootForTool); 00075 void CreateRootForDeriveds(); 00076 void DeleteRootForDeriveds(); 00077 ShortId CreateDerived(); 00078 void PrimRunToolInit(); 00079 00080 // Convert the command-line of the tool invocation to a single text 00081 // string. (Used for debugging messages.) 00082 Text ToolCommandLineAsText(const RunToolArgs &args); 00083 00084 #endif // PrimRunTool_H