HOPS
HOPS class reference
vex.h
Go to the documentation of this file.
1 #ifndef VEX_H
2 #define VEX_H
3 
4 #define MAXCOMMENTS 8192
5 #define MAXQUOTES 2048
6 #define MAXBLOCKS 256
7 #define MAXDEFS 512
8 #define MAXREFS 256
9 #define MAXSCANS 8192
10 #define STATEMENT_SIZE 8192
11 #define MAX_NAMESIZE 32
12 #define MAX_PVALSIZE 128
13 #define MAXNVAL 256
14 #define MAXBLKSTMT 100
15 #define MAXSTMT 50
16  /* Binary structs for various flavors */
17  /* of vex files/sections */
18 #include "mk4_typedefs.h"
19 #include "ovex.h"
20 #include "cvex.h"
21 #include "evex.h"
22 #include "ivex.h"
23 #include "svex.h"
24 #include "lvex.h"
25 /* #include "lvex.h" */
26  /* Struct to hold them all */
27 struct vex
28  {
29  int vextypes; /* Which sects are filled in (bitmap) */
30  char filename[256]; /* Disk-based vex file of origin */
31  struct scan_struct *ovex; /* Observe vex written by sched progs */
32  struct Cvex_Config *cvex; /* Correlator setup vex */
33  struct evex_struct *evex; /* Task-specific experiment vex */
34  struct ivex_struct *ivex; /* Correlator system initialization vex */
35  struct svex_struct *svex; /* Station unit setup vex */
36  struct lvex_struct *lvex; /* Log vex */
37  char *ovex_src; /* Filtered ascii vex source, based */
38  char *cvex_src; /* on the subset of the file that */
39  char *evex_src; /* was parsed. If these pointers are */
40  char *svex_src; /* null, such filtered source was not */
41  char *ivex_src; /* requested */
42  char *lvex_src;
43  };
44 
45 #define OVEX 1<<0
46 #define CVEX 1<<1
47 #define SVEX 1<<2
48 #define IVEX 1<<3
49 #define EVEX 1<<4
50 #define LVEX 1<<5
51 #define WANT_OUTPUT 1<<8
52  /* Vex versions, to be OR'ed with OVEX */
53  /* EVEX and others as needed */
54 #define V_1_0 100 << 10
55 #define V_1_5 150 << 10
56 #define V_ALL 998 << 10
57 #define V_BAD 999 << 10
58 
59 
60 /**************************************************************/
61 /* */
62 /* The rest of this file consists of definitions and structs */
63 /* to support the low-level operation of the parser library */
64 /* */
65 /**************************************************************/
66 
67 
68 struct comment
69  {
70  /* Addresses define extrema of comment */
71  char *start;
72  char *end;
73  };
74 
75 struct quote
76  {
77  /* Addresses define extrema of quote */
78  char *start;
79  char *end;
80  };
81 
82 struct ref
83  {
84  /* Strings define contents of ref statement */
85  int stno;
86  char filename[256];
89  int nargs;
90  char *args[MAXNVAL];
91  };
92 
93 struct def
94  {
95  /* Store name and location, and */
96  /* parse contents only when needed */
97  int start;
98  int end;
100  };
101 
102 struct scan
103  {
104  /* A def by any other name */
105  int start;
106  int end;
108  };
109 
110 struct block
111  {
113  int stno; /* statement number of $BLOCK */
114  int end; /* Last statement in block */
115  int ndef; /* For primitive $BLOCKS */
116  struct def deflist[MAXDEFS];
117  };
118 
119 struct statement
120  {
121  char *start;
122  char *end;
123  char *str;
124  };
125 
126 struct insert
127  {
128  int after;
129  char *str;
130  };
131  /* List of valid statement names */
132  /* by block name (block_params.c) */
133 struct blk_stmt
134  {
135  char name[32];
136  int nstmt;
137  char stmt[MAXSTMT][32];
138  };
139  /* Used for scan_info() */
140 struct def_list
141  {
142  int blockno;
143  int defno;
144  };
145 
146 #define FALSE 0
147 #define TRUE 1
148 
149 #define MAN TRUE
150 #define OPT FALSE
151  /* Value type */
152 #define VAL_REAL 1
153 #define VAL_CHAR 2
154 #define VAL_INT 3
155 #define VAL_EPOCH 4
156 #define VAL_RA 5
157 #define VAL_DEC 6
158 #define VAL_LINK 7
159 #define VAL_NONE 8
160  /* Value units */
161 
162 #define UNIT_TIME 1
163 #define UNIT_FREQ 2
164 #define UNIT_SAMPLERATE 3
165 #define UNIT_LENGTH 4
166 #define UNIT_ANGLE 5
167 #define UNIT_FLUX 6
168 #define UNIT_BITDENSITY 7
169 #define UNIT_ANGLE_TIME 51
170 #define UNIT_LENGTH_TIME 41
171 #define UNIT_NONE 80
172 #define UNIT_OPTIONAL 100
173 
174 struct value
175  {
176  char mandatory;
177  char type;
178  char units;
179  char range[50];
180  };
181 
183  {
184  char param_name[128];
185  int typever;
187  int nval;
188  int ngroup;
189  struct value *values;
190  };
191 
192 struct ra
193  {
194  short ra_hrs;
195  short ra_mins;
196  float ra_secs;
197  };
198 
199 struct dec
200  {
201  short dec_degs;
202  short dec_mins;
203  float dec_secs;
204  };
205 
207  {
208  int type;
209  int units;
210  union
211  {
212  char strval[MAX_PVALSIZE];
213  double realval;
214  int intval;
215  struct date epochval;
216  struct sky_coord raval;
217  struct sky_coord decval;
218  char linkval[MAX_NAMESIZE];
219  } data;
220  };
221 
222 struct param_val
223  {
225  int nval;
226  char *val[MAXNVAL];
227  struct data_value dval[MAXNVAL];
228  };
229 
230 extern int get_vex (char *filename, int vextype, char *key, struct vex *vex);
231 
232 #endif
Definition: cvex.h:41
Definition: evex.h:28
Definition: ivex.h:131
Definition: lvex.h:47
Definition: mk4_typedefs.h:15
Definition: mk4_typedefs.h:5
Definition: ovex.h:156
Definition: svex.h:35
char * str
Definition: vex.h:129
struct evex_struct * evex
Definition: vex.h:33
char keyword[MAX_NAMESIZE]
Definition: vex.h:88
#define MAXSTMT
Definition: vex.h:15
struct def deflist[MAXDEFS]
Definition: vex.h:116
char stmt[MAXSTMT][32]
Definition: vex.h:137
char * lvex_src
Definition: vex.h:42
short ra_hrs
Definition: vex.h:194
#define MAX_NAMESIZE
Definition: vex.h:11
int end
Definition: vex.h:98
short dec_mins
Definition: vex.h:202
char name[32]
Definition: vex.h:135
int after
Definition: vex.h:128
struct data_value dval[MAXNVAL]
Definition: vex.h:227
int blockno
Definition: vex.h:142
int nargs
Definition: vex.h:89
char range[50]
Definition: vex.h:179
char * start
Definition: vex.h:78
char * start
Definition: vex.h:121
int units
Definition: vex.h:209
char * end
Definition: vex.h:122
char * start
Definition: vex.h:71
short ra_mins
Definition: vex.h:195
char type
Definition: vex.h:177
char name[MAX_NAMESIZE]
Definition: vex.h:112
struct value * values
Definition: vex.h:189
char * val[MAXNVAL]
Definition: vex.h:226
int end
Definition: vex.h:106
union data_value::@22 data
int start
Definition: vex.h:97
int get_vex(char *filename, int vextype, char *key, struct vex *vex)
Definition: get_vex.c:38
char name[MAX_NAMESIZE]
Definition: vex.h:99
char blockname[MAX_NAMESIZE]
Definition: vex.h:87
int stno
Definition: vex.h:113
char * end
Definition: vex.h:79
char mandatory
Definition: vex.h:176
short dec_degs
Definition: vex.h:201
struct lvex_struct * lvex
Definition: vex.h:36
struct ivex_struct * ivex
Definition: vex.h:34
struct scan_struct * ovex
Definition: vex.h:31
char * cvex_src
Definition: vex.h:38
int ngroup
Definition: vex.h:188
int end
Definition: vex.h:114
char * svex_src
Definition: vex.h:40
#define MAXNVAL
Definition: vex.h:13
int vextypes
Definition: vex.h:29
int nstmt
Definition: vex.h:136
char param_name[128]
Definition: vex.h:184
int ndef
Definition: vex.h:115
char * ovex_src
Definition: vex.h:37
char filename[256]
Definition: vex.h:30
char * args[MAXNVAL]
Definition: vex.h:90
char name[MAX_NAMESIZE]
Definition: vex.h:107
int nval
Definition: vex.h:187
char * str
Definition: vex.h:123
int nval
Definition: vex.h:225
char filename[256]
Definition: vex.h:86
int typever
Definition: vex.h:185
int start
Definition: vex.h:105
char * evex_src
Definition: vex.h:39
char name[MAX_NAMESIZE]
Definition: vex.h:224
struct svex_struct * svex
Definition: vex.h:35
int defno
Definition: vex.h:143
int stno
Definition: vex.h:85
#define MAX_PVALSIZE
Definition: vex.h:12
char units
Definition: vex.h:178
#define MAXDEFS
Definition: vex.h:7
struct Cvex_Config * cvex
Definition: vex.h:32
float dec_secs
Definition: vex.h:203
char * end
Definition: vex.h:72
float ra_secs
Definition: vex.h:196
char * ivex_src
Definition: vex.h:41
int type
Definition: vex.h:208
Definition: vex.h:134
Definition: vex.h:111
Definition: vex.h:69
Definition: vex.h:207
Definition: vex.h:200
Definition: vex.h:94
Definition: vex.h:141
Definition: vex.h:127
Definition: vex.h:223
Definition: vex.h:183
Definition: vex.h:76
Definition: vex.h:193
Definition: vex.h:83
Definition: vex.h:103
Definition: vex.h:120
Definition: vex.h:175
Definition: vex.h:28