[go: up one dir, main page]

Menu

[8a2cb6]: / main.h  Maximize  Restore  History

Download this file

200 lines (158 with data), 7.1 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
/* Contest Arbitrator v0.3.2 by Dmitry Gorokh, UR4MCK
This program is freeware!
*/
#ifndef MAIN_H
#define MAIN_H
#include <time.h>
#include "cabrillo.h"
/* Various flags in 'ham' structure record */
#define HAM_FLAG_SCORE_TAB 0x01
#define HAM_FLAG_VALID_SIGNATURE 0x80
/* QSO verification status definition */
#define QSO_STATUS_CONTEST_ERROR -2
#define QSO_STATUS_ERROR -1
#define QSO_STATUS_NOT_CHECKED 0
#define QSO_STATUS_GENERAL_XCHECK_OK 1
#define QSO_STATUS_CONTEST_XCHECK_FAIL 2
#define QSO_STATUS_CONTEST_XCHECK_ONE_SIDE_FAIL_RECV 3
#define QSO_STATUS_CONTEST_XCHECK_ONE_SIDE_FAIL_SENT 4
#define QSO_STATUS_CONTEST_XCHECK_ONE_SIDE_VALID 5
#define QSO_STATUS_CONTEST_XCHECK_OK 6
/* Errors & warnings types */
#define WARN_TYPE_ERROR -1
#define WARN_TYPE_NONE 0
#define WARN_TYPE_WARNING 1
/* QSO mark IDs definition */
#define MARK_ID_NONE 0
#define MARK_ID_QSO_VALID 1
#define MARK_ID_QSO_INVALID 2
#define MARK_ID_MULT_VALID 4
#define MARK_ID_MULT_INVALID 8
/* QSO mark chars definition */
#define MARK_QSO_VALID '+'
#define MARK_QSO_INVALID '-'
#define MARK_MULT_VALID '*'
#define MARK_MULT_INVALID '%'
/* Log file description structure */
typedef struct {
char *name; /* Name of log file */
/* TODO */
void *next; /* Pointer to the next element in the list */
} LOG_FILE_S;
/* Configuration structure */
typedef struct {
char *log_dir; /* Directory with log files */
char *out_file; /* Output file with results */
char report_dir[MAX_STR]; /* Log analyzis reports directory */
char ubn_dir[MAX_STR]; /* UBN files directory */
FILE *out_fd; /* Output file descriptor pointer */
LOG_FILE_S *file_list; /* Pointer to the List of log files to work with */
/* Contest specific configuration */
struct {
int valid; /* Contest configuration is valid (when not 0) */
char name[MAX_STR]; /* Contest name */
int id; /* Contest identifier */
time_t start; /* Starting date */
time_t end; /* End date */
unsigned int rounds; /* Number of rounds (0 if not applicable) */
unsigned int max_dt; /* Maximum allowable difference in time (in sec) */
char band_list[MAX_STR]; /* Bands list */
char mode_list[MAX_STR]; /* Modes list */
char signature[MAX_STR]; /* Judge's signature */
char email[MAX_STR]; /* Log submissions e-mail(s) */
char www[MAX_STR]; /* Contest results URL */
int skip_rst_snt; /* Sent RST checking (0 - check, 1 - do not check) */
int skip_rst_rcv; /* Received RST checking (0 - check, 1 - do not check) */
int skip_num_snt; /* Sent incremental number checking (0 - check, 1 - do not check) */
int skip_num_rcv; /* Received incremental number checking (0 - check, 1 - do not check) */
int skip_chk_snt; /* Sent check number checking (0 - check, 1 - do not check) */
int skip_chk_rcv; /* Received check number checking (0 - check, 1 - do not check) */
int cfm_unresolved; /* Minimum count of unresolved QSOs to confirm them as valid QSO and multiplyer */
int uniq_mult; /* Flag to count multiplier only once */
int strict_eval; /* Flag to perform strict evaluation */
int allow_dupes; /* Flag to allow duplicate QSOs */
int search_tags; /* Flag to search similar tags upon log format error */
int ignore_tags; /* Flags to ignore any unknown tag in the log */
} contest;
/* TODO */
} CONFIG_S;
typedef struct {
int num;
time_t start;
time_t end;
} ROUND_S;
typedef struct {
int id;
time_t start;
time_t end;
unsigned int mode_cnt;
int mode[MAX_MODES];
unsigned int band_cnt;
int band[MAX_BANDS];
unsigned int round_cnt;
ROUND_S **round;
} CONTEST_CONFIG_S;
/* Warning message list structure definition */
typedef struct {
int type; /* Type of a warning or error */
unsigned int line; /* Line number in log file */
char *text; /* Description text */
void *next; /* Pointer to the next warning or error */
} WARNING_S;
/* General QSO structure */
typedef struct {
int ham_id; /* Remote station ID (if resolved) */
int checked; /* Contest cross-check status */
int marked; /* Judge's mark is present */
int dupe; /* Flag for duplicate QSO */
char callsign[CALLSIGN_SIZE]; /* Remote station callsign */
unsigned int freq; /* Frequency, kHz */
int mode_op; /* Operation mode ID */
time_t timestamp; /* Contains date & time (UTC) */
char check_sent[CHK_CNT][CHK_SIZE]; /* Sent check numbers */
char check_recv[CHK_CNT][CHK_SIZE]; /* Received check numbers */
int tx_num; /* Transmitter number */
int round_num; /* A round number this QSO belongs to */
int score; /* Score for this QSO */
unsigned int mult; /* Multiplier for this QSO (if applicable) */
int mark; /* Judge's mark value (if QSO have been marked) */
unsigned int error_cnt; /* QSO errors & warnings counter */
WARNING_S *warnings; /* QSO errors & warnings list */
void *his_qso; /* Pointer to remote operator's QSO with us */
void *next; /* Next QSO record pointer */
} QSO_S;
/* General description of ham radio operator */
typedef struct {
char callsign[CALLSIGN_SIZE]; /* Operator's callsign */
int optype_id; /* Type of operation ID */
int band_id; /* Band ID */
int mode_id; /* Mode ID */
int power_id; /* Power type ID */
int assisted_id; /* Assistment type ID */
int tx_id; /* Transmitter type ID */
int station_id; /* Station type ID */
int time_id; /* Time type ID */
int overlay_id; /* Overlay type ID */
char name[MAX_STR]; /* Ham's name */
char location[MAX_STR]; /* Ham's location */
char club_name[MAX_STR]; /* Ham's club name */
time_t off_time_start; /* Off time range: start (date & time in UTC) */
time_t off_time_end; /* Off time range: end (date & time in UTC) */
unsigned int claimed_score; /* Claimed score */
unsigned int sum_score; /* Summary score (calculated by this program) */
unsigned int actual_score; /* Actual score (calculated by this program) */
unsigned int total_mult; /* Total multiplier */
unsigned int rating_place; /* Place in the rating table */
int no_loc; /* Marks an absence of QTH locator in 'location' field */
int systematic_dt; /* Systematic difference in time */
unsigned int flags; /* Auxulary bit flags */
char ubn_file[MAX_STR]; /* Path to UBN file */
QSO_S *qso; /* Pointer to QSO records */
WARNING_S *warnings; /* General errors & warnings list */
} HAM_S;
typedef struct {
unsigned int ham_num; /* Total number of participant's logs */
HAM_S **ham; /* Array of pointers to the ham's structure */
} BASE_S;
int out(FILE *report_fd, const char *fmt, ...);
#endif