| 1 |
root |
1 |
/*************************************************************************
|
|
|
2 |
* Copyright (C) 1995 Embedded Solutions
|
|
|
3 |
* All rights reserved
|
|
|
4 |
*
|
|
|
5 |
* file: hdrs/proto.h
|
|
|
6 |
*
|
|
|
7 |
* purpose: System wide prototypes and external declarations
|
|
|
8 |
*
|
|
|
9 |
* programmer: David Purdie
|
|
|
10 |
*
|
|
|
11 |
* 00.0 27/01/95 DDP Tidies up the program and formatted the file
|
|
|
12 |
* 00.1 27/01/95 DDP initial release
|
|
|
13 |
*
|
|
|
14 |
**************************************************************************/
|
|
|
15 |
|
|
|
16 |
|
|
|
17 |
#include <ctype.h>
|
|
|
18 |
|
|
|
19 |
#ifdef __MINGW32__
|
|
|
20 |
#include <strings.h>
|
|
|
21 |
#include <memory.h>
|
|
|
22 |
#include <stdlib.h>
|
|
|
23 |
#include <stdio.h>
|
|
|
24 |
#endif
|
|
|
25 |
|
| 380 |
david |
26 |
#include "QDebug"
|
|
|
27 |
#define printf qDebug
|
|
|
28 |
|
|
|
29 |
#include "qmconfig.h"
|
|
|
30 |
|
| 389 |
david |
31 |
extern class QmConfig config; /* Working configuration */
|
|
|
32 |
extern int parallel_legs; /* Legs run in Parallel */
|
| 1 |
root |
33 |
extern ty_check_error check_error;
|
| 389 |
david |
34 |
extern QString DatFile; /* Name of the data file */
|
|
|
35 |
extern QString FileBase; /* Event file name base */
|
|
|
36 |
extern QString FilePath; /* Base dir for input and output */
|
| 380 |
david |
37 |
//extern int team; /* Current team number */
|
|
|
38 |
//extern team_type team_buf; /* Holds team data currently under display */
|
|
|
39 |
//extern int n_lines; /* Number of lines on the screen */
|
|
|
40 |
//extern int n_cols;
|
|
|
41 |
//extern int rubout; /* users rubout character */
|
|
|
42 |
//extern int abort_flag; /* Abort character detected */
|
|
|
43 |
//extern int fnc_opr; /* Function key pushed */
|
|
|
44 |
//extern int leg; /* Leg under investigation */
|
|
|
45 |
//extern int last_loaded_leg; /* Last Leg loaded */
|
|
|
46 |
extern ty_stats stats; /* Holds statistics */
|
| 1 |
root |
47 |
|
|
|
48 |
|
|
|
49 |
int main( int argc, char *argv[] );
|
|
|
50 |
void usage( void );
|
|
|
51 |
void ms_system( void );
|
|
|
52 |
void test_legal_version( void );
|
|
|
53 |
void display_structures(void);
|
|
|
54 |
|
|
|
55 |
bool test_times( team_type * data, int upto_leg );
|
|
|
56 |
void set_times( team_type * data );
|
|
|
57 |
|
|
|
58 |
/*
|
| 45 |
- |
59 |
** ages.c
|
|
|
60 |
*/
|
|
|
61 |
char *age_a( int age );
|
|
|
62 |
|
|
|
63 |
|
|
|
64 |
/*
|
| 1 |
root |
65 |
** config.c
|
|
|
66 |
*/
|
|
|
67 |
void compact( char *str );
|
|
|
68 |
void conf_menu( void );
|
|
|
69 |
bool configure( char *c_name, int mode );
|
| 380 |
david |
70 |
//void d_class( MARA_CFG * config, int operation );
|
|
|
71 |
//void d_cntry( MARA_CFG * config, int operation );
|
|
|
72 |
//void d_config( MARA_CFG * config, int operation );
|
|
|
73 |
//void d_winners( MARA_CFG * config, int operation );
|
| 1 |
root |
74 |
bool define_class( void );
|
|
|
75 |
bool define_config( void );
|
|
|
76 |
void define_country( void );
|
|
|
77 |
bool define_winners( void );
|
|
|
78 |
void display_class( void );
|
|
|
79 |
void display_config( void );
|
|
|
80 |
void display_country( void );
|
|
|
81 |
void display_winners( void );
|
|
|
82 |
int f_comp_int( const void * a, const void * b );
|
|
|
83 |
bool r_config( FILE *fcon );
|
|
|
84 |
bool rd_config( void );
|
|
|
85 |
bool valid_field( int x );
|
|
|
86 |
bool wt_config( void );
|
|
|
87 |
|
|
|
88 |
void data_check( void );
|
|
|
89 |
bool correct_times( int tm, int list );
|
|
|
90 |
|
|
|
91 |
void f_disqualify( void );
|
|
|
92 |
void ds_team( void );
|
|
|
93 |
void ds_non_equestrian(void);
|
|
|
94 |
void ds_requal( void );
|
|
|
95 |
void ds_displ( void );
|
|
|
96 |
void del_team( void );
|
|
|
97 |
|
|
|
98 |
/*
|
|
|
99 |
** legtime.c
|
|
|
100 |
*/
|
|
|
101 |
void set_legs( void );
|
| 384 |
david |
102 |
void tm_lgs(int leg, maraTime_t delta, bool report_it, bool clear_it);
|
|
|
103 |
void tm_lgs1( int leg, maraTime_t starttime, maraTime_t delta, bool report_it, bool clear_it );
|
| 1 |
root |
104 |
void leg_start( void );
|
| 384 |
david |
105 |
void tm_fixedstart( int leg, maraTime_t starttime, bool report_it, bool clear_it );
|
|
|
106 |
void tm_staggered( int leg, maraTime_t starttime, maraTime_t delta, bool report_it, bool clear_it );
|
| 380 |
david |
107 |
void tm_clearleg_specified(int cleg, bool manual);
|
|
|
108 |
void tm_recalcElapsed (int leg);
|
| 1 |
root |
109 |
|
|
|
110 |
void leg_ini( void );
|
|
|
111 |
void tm_init( void );
|
|
|
112 |
void tm_gen( void );
|
| 380 |
david |
113 |
void legs_start_report( int leg );
|
|
|
114 |
void ls_timer( t_legs * ptr, int num , bool suppress);
|
| 1 |
root |
115 |
void ls_team( int *last, t_legs * data );
|
|
|
116 |
int sort_legs( const void * a, const void * b );
|
|
|
117 |
|
| 380 |
david |
118 |
//void do_menu( const char *header, const char *prompt, menu_table * table );
|
| 1 |
root |
119 |
|
| 389 |
david |
120 |
bool open_printer( const QString name, const char *ext, int width, report_type html, const char * title );
|
|
|
121 |
bool open_printer_name( const QString pname, int width, report_type html, const char * title );
|
| 1 |
root |
122 |
bool close_printer( void );
|
| 390 |
david |
123 |
size_t print( const char *format, ... );
|
| 380 |
david |
124 |
void printbanner( const char *title );
|
| 1 |
root |
125 |
void print_underline( bool on );
|
|
|
126 |
void print_bold( bool on );
|
|
|
127 |
|
|
|
128 |
void report( void );
|
|
|
129 |
void pri_team( void );
|
|
|
130 |
void pri_leg( void );
|
|
|
131 |
void p_place( ty_s_data * ptr, int leg, unsigned k );
|
|
|
132 |
void p_team( int i, int leg );
|
|
|
133 |
void pri_eleg( void );
|
|
|
134 |
void pe_place( ty_s_data * ptr, int leg, unsigned k );
|
|
|
135 |
void pe_team( int i, int leg );
|
|
|
136 |
void pri_final_html( void );
|
|
|
137 |
void pri_final( void );
|
| 380 |
david |
138 |
void pri_final_teamOrder( void );
|
| 1 |
root |
139 |
void pri_interim( void );
|
| 380 |
david |
140 |
void print_class_header( int teamclass, int final );
|
| 1 |
root |
141 |
void print_class_stats( int c, int final );
|
| 380 |
david |
142 |
void print_legend( int teamclass, int full );
|
| 384 |
david |
143 |
const char *pi_place( int num, int disq, maraTime_t time );
|
| 380 |
david |
144 |
const char *px_place( int leg, int num, bool epMode, bool neMode, team_flags flags );
|
|
|
145 |
void ck_data( int leg, int mode );
|
| 1 |
root |
146 |
void srt_place( void );
|
|
|
147 |
void do_big_sort( void );
|
| 380 |
david |
148 |
void sort_team_data( int leg, int mode, bool withEq );
|
| 1 |
root |
149 |
int sort_comp( const void * a, const void * b );
|
| 18 |
david |
150 |
int sort_comp_cname( const void * aa, const void * bb );
|
| 1 |
root |
151 |
bool load_report_data( void );
|
|
|
152 |
void gen_stats( void );
|
|
|
153 |
void display_summary (void);
|
| 13 |
david |
154 |
void pri_summary (void);
|
| 380 |
david |
155 |
void pri_all_reports ( void );
|
| 1 |
root |
156 |
|
| 18 |
david |
157 |
|
| 1 |
root |
158 |
void team_update( void );
|
|
|
159 |
void team_display( void );
|
|
|
160 |
void leg_mods( void );
|
|
|
161 |
void d_display( int operation );
|
|
|
162 |
void d_leg( int y, int leg, leg_type * data, int valid,
|
|
|
163 |
int operation );
|
| 384 |
david |
164 |
void d_time( int x, int y, const char *prompt, maraTime_t *data, int valid );
|
| 380 |
david |
165 |
bool d_field( int x, int y, const char *prompt, int type, int length,
|
|
|
166 |
const void *data, int valid, int operation );
|
|
|
167 |
bool g_tnum( int x, int y, const char *prompt );
|
| 1 |
root |
168 |
bool g_record( int _team, team_type * data );
|
|
|
169 |
void clr_team( int tm, team_type * data );
|
|
|
170 |
bool put_team_record( int _team, team_type * data );
|
|
|
171 |
bool init_team_data( void );
|
|
|
172 |
void fix_team_data( void );
|
|
|
173 |
|
| 384 |
david |
174 |
char *time_a( maraTime_t tim );
|
|
|
175 |
char *time_fa( maraTime_t tim, char flag );
|
|
|
176 |
maraTime_t conv_time( int hh, int mm, int ss );
|
|
|
177 |
maraTime_t get_time( maraTime_t tim );
|
| 1 |
root |
178 |
|
|
|
179 |
void upload( void );
|
|
|
180 |
int ins_data( int tm, int hh, int mm, int ss );
|
|
|
181 |
void supload( void );
|
|
|
182 |
void tupload( void );
|
|
|
183 |
char p_del( char *c );
|
|
|
184 |
void tdnload( void );
|
|
|
185 |
void dnload( void );
|
| 380 |
david |
186 |
char getfname( const char *prompt, const char *ext );
|
| 1 |
root |
187 |
|
|
|
188 |
void init_screen( void );
|
|
|
189 |
void fix_screen( void );
|
|
|
190 |
void cur( int x, int y );
|
|
|
191 |
void save_cur(void);
|
|
|
192 |
void restore_cur(void);
|
|
|
193 |
void clearscreen( void );
|
|
|
194 |
void beep( void );
|
|
|
195 |
void flush_out( void );
|
|
|
196 |
int getinp( void );
|
|
|
197 |
bool getnum( int max_len, int *final_buf );
|
| 380 |
david |
198 |
int getstring( int len, const char *str, enum class_enum limit );
|
| 1 |
root |
199 |
sex_type getsex( void );
|
|
|
200 |
int getclass( void );
|
|
|
201 |
int getcountry( void );
|
| 380 |
david |
202 |
char getfnc( const char *list );
|
|
|
203 |
bool getyes( const char *prompt );
|
| 1 |
root |
204 |
char to_upper( char ch );
|
|
|
205 |
char to_lower( char ch );
|
|
|
206 |
void sleep( int t );
|
| 380 |
david |
207 |
//int lookup_class( const char *text, MARA_CFG *config );
|
| 1 |
root |
208 |
|
|
|
209 |
bool t_parse_number( char **linep, int *number );
|
|
|
210 |
bool t_parse_text( char **linep, char *text );
|
| 380 |
david |
211 |
char p_eol( const char *c );
|
| 389 |
david |
212 |
QString p_filename( const QString filename, const QString suffix, const QString ext );
|
| 1 |
root |
213 |
void print_colour( long colour );
|
| 380 |
david |
214 |
char *tprintf( const char *format, ... );
|
|
|
215 |
int raw_print( const char *format, ... );
|
| 1 |
root |
216 |
void console_prompt( char prompt );
|
|
|
217 |
void console_clreol( void );
|
|
|
218 |
void calc_class_summary( t_class_summary * ptr );
|
| 380 |
david |
219 |
int csv_print( const char *format, ... );
|
| 61 |
- |
220 |
void set_commands ( char * cptr);
|
|
|
221 |
void tdnload_store(void);
|
| 389 |
david |
222 |
char * url_encode(const QString str);
|
| 380 |
david |
223 |
const QString &getPrinterFile(void);
|
|
|
224 |
char *setHref( const char *format, ... );
|
| 1 |
root |
225 |
|
|
|
226 |
/********************************* EOF ***********************************/
|