1 /**************************************************************************** 2 Copyright (C) 1987-2015 by Jeffery P. Hansen 3 4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License as published by 6 the Free Software Foundation; either version 2 of the License, or 7 (at your option) any later version. 8 9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License along 15 with this program; if not, write to the Free Software Foundation, Inc., 16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 ****************************************************************************/ 18 #ifndef __script_h 19 #define __script_h 20 21 #define SCRIPT_ERRORBLOCKSIZE 32 /* Error list array allocation block size */ 22 23 /* Script states */ 24 #define SCS_GO 0 /* The script it currently executing. */ 25 #define SCS_PAUSE 1 /* The script is paused. */ 26 #define SCS_STOP 2 /* The script has terminated. */ 27 #define SCS_DISABLE 0x101 /* The script is disabled */ 28 #define SCS_UNLOADED 0x102 /* The script has not been loaded to simulator */ 29 #define SCS_INVALID 0x103 /* The script file was invalid. */ 30 #define SCS_UNLOADED_F 0x100 /* Flag for all states that are not loaded */ 31 32 /***************************************************************************** 33 * 34 * Simulator breakpoint 35 * 36 *****************************************************************************/ 37 struct Script_str { 38 char *s_fileName; /* Name of script file */ 39 int s_id; /* Identifier of the script invocation */ 40 int s_state; /* State of the script invocation */ 41 int s_numErrors; /* Number of reported errors */ 42 char **s_errors; /* List of error messages for this script */ 43 }; 44 45 int ScriptTable_insert(NHash *stab,int idx,const char *fileName); 46 void ScriptTable_delete(NHash *stab,int idx); 47 void ScriptTable_load(NHash *stab,int idx); 48 void ScriptTable_unload(NHash *stab,int idx); 49 void ScriptTable_loadAll(NHash *stab); 50 void ScriptTable_pause(NHash *stab,int idx); 51 void ScriptTable_stop(NHash *stab,int idx); 52 void ScriptTable_error(NHash *stab,int id,const char *message); 53 void ScriptTable_flush(NHash *stab); 54 55 void delete_Script(Script *bp); 56 Script *new_Script(int idx,int state, const char *fileName); 57 58 #endif 59