HOPS
HOPS class reference
fstruct.h
Go to the documentation of this file.
1 #ifndef FSTRUCT_DONE
2 #define FSTRUCT_DONE
3 
4 /* 180 dual-pol baselines breaks this */
5 #define MAXFILES 500000
6 /* an old restriction for filenum to be 1-9999 */
7 #define MAXFNDIGITS 4
8 #define LEGALPOLCHARS "HVLRXY"
9 
10 /* these flags are defined, but do not seem to ever be used */
11 #define BADSTRING 0x001
12 #define BADFORM 0x002
13 #define BADBASE 0x004
14 #define BADFNUM 0x008
15 #define BADFREQ 0x010
16 #define BADSRC 0x020
17 #define BADROOT 0x040
18 #define BADSTAT 0x080
19 #define BADMALLOC 0x100
20 
21 #ifndef FALSE
22 #define TRUE 1
23 #define FALSE 0
24 #endif
25 
26 /* defaults to indicate a cleared structure are in () below */
27 
28 /* type 0 is root file SOURCE.stamp (2 parts)
29  * type 1 is corel, AB.nn.abcdef (3 parts)
30  * type 2 is fringe, AB.X.nn.abcdef (4 parts)
31  * 2 is fringe, AB.X.nn-pp.abcdef (4 parts) new with 3.26
32  * type 3 is sdata, A.nn.abcdef (3 parts)
33  * type 4 is log.<sourcename>? (2 parts) */
34 
35 typedef struct
36  {
37  int order; /* For sorting operations, (-1) */
38  char *name; /* Full name of file (NULL) */
39  short type; /* File type according to name 0...4 (see above; -1) */
40  char source[32]; /* Source name (root files only; 0) */
41  char baseline[3]; /* Baseline id (fringe and corel files only; 0) */
42  char station; /* Type 3 (pcal) files only (' ') */
43  char freq_code; /* Frequency id code (fringe files only) (' ') */
44  int filenum; /* File number in fileset (-1)*/
45  char rootcode[7]; /* root id code 'abcdef' (0) */
46  short done; /* Has this file has been done (see below; FALSE) */
47  int intparm[4]; /* Auxiliary info if needed (see below; 0) */
48  float floatparm[4]; /* Auxiliary info if needed (see below; 0.0) */
49  /* new features */
50  int namealloc; /* strlen(name)+1 when name malloc'd */
51  char poln[3]; /* Polarization info (' ') */
52  } fstruct;
53 
54 /* The 'done' field is used in sort_names and alist.c
55  * fringex uses intparm for fdata.srch_cotime and fdata.noloss_cotime
56  * and uses floatparm for fdata.delay_rate and fdata.mbdelay
57  * poln is populated if the fringe number includes the polarization */
58 
59 /* namealloc was introduced to allow name to be freed when fset is used;
60  * however it is difficult to prevent an invalid free, thus any use of
61  * these functions must use prep_fstruct() when it is known that the
62  * fstruct may contain garbage--this happens if the variable is on the
63  * stack or malloc'd. It is not necessary if the struct was previously
64  * in previous calls as it will certainly not contain garbage.
65  *
66  * This applies to filesets as well, see fileset.h */
67 
68 /* sub/utils */
69 extern void prep_fstruct(fstruct *);
70 extern int check_name (char *, fstruct *);
71 extern int extract_filenames (char *, int, fstruct **, int *, int *, int *);
72 extern int get_filelist (int, char **, int, fstruct **);
73 
74 #endif
int baseline
Definition: fourfit3.c:62
short type
Definition: fstruct.h:39
char station
Definition: fstruct.h:42
void prep_fstruct(fstruct *)
Definition: check_name.c:27
char freq_code
Definition: fstruct.h:43
int get_filelist(int, char **, int, fstruct **)
Definition: get_filelist.c:34
char * name
Definition: fstruct.h:38
int namealloc
Definition: fstruct.h:50
int filenum
Definition: fstruct.h:44
int order
Definition: fstruct.h:37
int extract_filenames(char *, int, fstruct **, int *, int *, int *)
Definition: extract_filenames.c:42
int check_name(char *, fstruct *)
Definition: check_name.c:76
short done
Definition: fstruct.h:46
Definition: fstruct.h:36