ARPDAS_QNX6 1.0
|
00001 /* Definitions for TMCALGO V2.0 */ 00002 /* Do I need to include tmctime.h? */ 00003 #include <time.h> 00004 #include "tmctime.h" 00005 #ifndef _TMA_H_INCLUDED 00006 #define _TMA_H_INCLUDED 00007 00008 typedef struct { 00009 long int dt; 00010 const char *cmd; 00011 } tma_state; 00012 00013 typedef struct { 00014 int partno; 00015 const char *filename; 00016 const char *statename; 00017 tma_state *cmds; 00018 tma_state *def_cmds; 00019 time_t modtime; 00020 } tma_ifile; 00021 00022 typedef struct { 00023 const char *state; 00024 const char *cmdstr; 00025 } slurp_val; 00026 00027 extern slurp_val slurp_vals[]; 00028 00029 /* tma_prtn.nexttime has changed def. between R1 and R2 00030 In R1: Seconds until next event, LONG_MAX if no next. 00031 In R2: Seconds from basetime of next event, 0 if no next. 00032 */ 00033 typedef struct { 00034 long int basetime; /* Time current state began */ 00035 long int nexttime; /* see above */ 00036 long int lastcheck; /* Time of last check */ 00037 int console; 00038 int row; 00039 /* R2 additions: */ 00040 tma_state *cmds; 00041 int next_cmd; 00042 long int waiting; 00043 const char *next_str; 00044 } tma_prtn; 00045 extern tma_prtn *tma_partitions; 00046 extern long int tma_runbasetime; 00047 extern int tma_is_holding; 00048 extern const int tma_n_partitions; 00049 00050 #define HOLDING_COL 18 00051 #define STATE_COL 42 00052 #define RUN_COL 59 00053 #define SNAME_COL 0 00054 #define NEXTTIME_COL 34 00055 #define STATETIME_COL 51 00056 #define RUNTIME_COL 66 00057 #define RUNTIME_STRING " " 00058 #define HOLDING_ATTR 0x70 00059 #define TMA_ATTR 0x70 00060 #define CMD_ATTR 7 00061 00062 #ifdef __cplusplus 00063 extern "C" { 00064 #endif 00065 00066 /* tmcalgo (tma) support routines */ 00067 void tma_new_state(unsigned int partition, const char *name); 00068 void tma_init_options(int argc, char **argv); 00069 void tma_hold(int hold); 00070 void tma_time(tma_prtn *p, unsigned int col, long int t); 00071 void tma_next_cmd( unsigned int partition, const char *cmd ); 00072 00073 /* R2 routines */ 00074 void tma_init_state( int partno, tma_state *cmds, const char *name ); 00075 void tma_read_file( tma_ifile *ifilespec ); 00076 int tma_process( long int it ); 00077 void tma_succeed( int partno, int statecase ); 00078 00079 #ifdef __cplusplus 00080 }; 00081 #endif 00082 00083 #endif /* _TMA_H_INCLUDED */