📄 structures.h
字号:
/*===========================================================================*//* DMC interim out | structures.h | header file *//*===========================================================================*//* Name: structures.h Purpose: define structures used in program Usage: Input: Output: Externals: Warnings: Errors: Fatals: Called by: Calls to: Algorithm: Notes: automatically included by "output.h" Problems: Debug: References: Language: Revisions: *//* If this header is already included, don't include it again */#ifndef STRUCTURES_INCLUDED /*=======================================*//*================| |================*/ /*=======================================*//* * from rdseed v1.0 */struct input_time /* time from input stream */{ unsigned short int year; unsigned short int day; char hour; char minute; char second; char unused; short int fracsec;};/* * the first part of a logical record is used in two contexts. * The first context is used only during fast scan of the data files * to determine membership in the output set being built. For this reason * it is included in the lvol list (below). The second context is less * common, and is used when the full SEED context of the data record * needs to be established. * * struct input_scan and struct_input_data_hdr *MUST* have the same * contents for sizeof(input_scan)! */struct input_scan /* this is a overlay subset */{ char station[5]; /* station name */ char location[2]; /* location id */ char channel[3]; /* channel name */ char network[2]; /* network added 1997, Aug */ struct input_time time; /* time */};struct input_data_hdr /* fixed data header */{ char station[5]; /* station name */ char location[2]; /* station location */ char channel[3]; /* channel name */ char network[2]; /* network */ struct input_time time; /* time */ unsigned short int nsamples; /* number samples */ short int sample_rate; /* sample rate factor */ short int sample_rate_multiplier; /* sample rate multiplier */ char activity_flags; /* activity flags */ char io_flags; /* i/o flags */ char data_quality_flags; /* data quality flags */ char number_blockettes; /* # blockettes which follow */ long int number_time_corrections; /* # .0001s time corrections */ unsigned short int bod; /* beginning of data */ unsigned short int bofb; /* beginning 1st blkt */};struct data_blk_hdr /* data blockette header */{ unsigned short int type; /* blockette type */ unsigned short int next_blk_byte;/* start of next blockette byte number */};struct data_blk_100 /* blockette 100 */{ struct data_blk_hdr hdr; /* blockette header */ float sample_rate; /* actual sample rate */ unsigned char flags; /* flags */ unsigned char reserved[3]; /* reserved bytes */};/* * This structure is what is actually read into memory. We purposefully * do not define how long "Lrecl" is at compile time. */struct input_data_logrec /* a DATA logical record */{ char seqno[6]; /* sequence number */ char type; /* always D */ char cont; /* reserved, always space */ union { struct input_data_hdr full; /* the fixed header */ struct input_scan scan; /* same, only different */ } hdr; /* run time Lrecl-8- * sizeof(hdr) * allocation */};/* * linked list used to make a logical volume * from a request file holdings list. There is one of each of these * for each time chunk in an output volume. */struct lvol{ int lrecl; struct input_scan scan; /* see above. This is a copy of a SEED data * header initial chunk. */ struct input_time endtime; /* time where this segment ends */ int start_offset; /* fseek pointers to start of segment */ int end_offset; /* ...within file "name" */ struct lvol *next; /* link to next, NULL if this is last */ struct acceler *gofast;/* list of accelerator structures or NULL */ int ngofast; /* number of such nodes */ char name[PATHLENGTH];/* explicit file where data file is */ };/* * linked list used to store blockette 71,72 information * from a B071 file. There is one of each of these * for each blockette 71. All blockette 72's are associated with a 71. */struct blk72_list{ int start_offset; /* fseek pointers to start of segment */ int blk_length; /* ...within file "name" */ struct blk72_list *next;/* link to next, NULL if this is last */};struct blk71_list{ struct input_time origin_time; /* origin time */ int start_offset; /* fseek pointers to start of segment */ int blk_length; /* ...within file "name" */ struct blk72_list *blk72_list; /* linked list of phase arrivals */ struct blk71_list *next; /* link to next, NULL if this is last */ };/* * used to keep track of all time spans detected in this logical volume * during the initial scan phase. The sequence number is unused until * make_control_headers. */struct tspan_list{ int count; /* number of chunks in tspan */ int seqno; /* logical rec sequence no. */ struct lvol *start; /* where in list it starts */ struct tspan_list *next;/* pointer to next */};/* * used for SEED version 2.1 or greater to hold accelerator data for * type 074 blockettes. A singly linked list is hooked into the lvol * node for by the data qualification routines, and used when the * 074 blockettes are built. The seqno is added to whatever the * final effective first record number has become to arrive at the absolute * index number. Sub-sequence numbers are left alone. */struct acceler{ struct input_time time; /* SEED time from the data record */ int seqno; /* relative recno of segment (0 origin) */ int subseqno; /* sub-sequence number of data record */ struct acceler *next; /* linked list; NULL at end */};struct hdr_logrec /* a HEADER logical record */{ char seqno[6]; /* sequence number */ char type; /* may be V A S T or space */ char cont; /* either '*' or space */ /* run time Lrecl-8 * allocation - blockettes live * in this space */};/* * used to track all control header logical records built * internally during a logical volume creation. */struct logrec_list{ char *record; /* points to a Lrecl sized record */ struct logrec_list *next;};/* used in Output_phase */struct io_buf{ /* used as many function returns */ int len; /* size of a buffer chunk */ char *addr; /* location of its start */};struct path_list /* used in scan phase */{ char *path; /* directory which may contain data */ struct path_list *next;};struct station_list /* used in Header_phase */{ int seqno; /* sequence number of logical record */ char name[5+1]; /* name of station */ char network[3]; struct station_list *next;/* next in link */}; /*=======================================*//*================| end of header file |================*/ /*=======================================*//* the following two lines should be the last lines of the header file */#define STRUCTURES_INCLUDED 1#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -