Subversion Repositories svn1

Rev

Rev 75 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 75 Rev 380
Line 10... Line 10...
10
*
10
*
11
* revision  date        by      reason
11
* revision  date        by      reason
12
*   00.0    27/01/95    DDP     Tidies up the program and formatted the file
12
*   00.0    27/01/95    DDP     Tidies up the program and formatted the file
13
*
13
*
14
**************************************************************************/
14
**************************************************************************/
-
 
15
#ifndef __structs_h__
-
 
16
#define __structs_h__
15
#include    <time.h>
17
#include    <time.h>
16
 
18
 
17
typedef unsigned char  uchar;
19
typedef unsigned char  uchar;
18
typedef unsigned int   uint;
20
typedef unsigned int   uint;
19
typedef unsigned long  ulong;
21
typedef unsigned long  ulong;
20
typedef unsigned char  bool;
22
//typedef unsigned char  bool;
21
typedef unsigned short ushort;
23
typedef unsigned short ushort;
22
 
24
 
23
#ifdef __MINGW32__
25
#if defined(__MINGW32__) || defined(__GNUC__)
24
#define MPACKED  __attribute__ ((packed))
26
#define MPACKED  __attribute__ ((packed))
25
#define FILL1   char    dummy;
27
#define FILL1   char    dummy;
26
#define FILL1a  char    dummya;
28
#define FILL1a  char    dummya;
27
#define LONG_FILE_NAMES
29
#define LONG_FILE_NAMES
28
#else
30
#else
Line 111... Line 113...
111
/*
113
/*
112
**  Team based flags
114
**  Team based flags
113
*/
115
*/
114
typedef struct
116
typedef struct
115
    {
117
    {
116
        bool        valid;                       /* Data valid flag */
118
    bool        valid;                          /* Data valid flag */
117
        bool        bad_times;                   /* Legs times not fully defined */
119
    bool        bad_times;                      /* Legs times not fully defined */
118
        bool        disqualified;                /* Team has been disqualified */
120
    bool        disqualified;                   /* Team has been disqualified */
119
        bool        non_equestrian;              /* Team is special : non-equestrian */
121
    bool        non_equestrian:1;               /* Team is special : non-equestrian */
-
 
122
    bool        vet_check:1;                    /* Team Disqual - Failed vet check */
-
 
123
    bool        notInFastest:1;                 /* Exclude from fastest team calc */
-
 
124
    bool        notInLP:1;                      /* Not included in Leg Placing */
120
    } MPACKED
125
    } MPACKED
121
team_flags ;                                      /* Flag word */
126
team_flags ;                                    /* Flag word */
122
 
127
 
123
/*
128
/*
124
**  Team information
129
**  Team information
125
*/
130
*/
126
typedef struct
131
typedef struct
Line 128... Line 133...
128
        short       numb;                        /* Team number */
133
        short       numb;                        /* Team number */
129
        char        name[MAX_TM_NAME + 1];       /* Team name */
134
        char        name[MAX_TM_NAME + 1];       /* Team name */
130
        FILL1
135
        FILL1
131
        leg_type    leg [MAX_LEGS + 1];          /* Timing structure for each leg */
136
        leg_type    leg [MAX_LEGS + 1];          /* Timing structure for each leg */
132
        memb_type   members[MAX_MEMB];           /* Team members */
137
        memb_type   members[MAX_MEMB];           /* Team members */
133
        short       class;                       /* Team class index */
138
        short       teamclass;                   /* Team class index */
134
        short       country;                     /* Team country index */
139
        short       country;                     /* Team country index */
135
        team_flags  flags;                       /* Flag word */
140
        team_flags  flags;                       /* Flag word */
136
    } MPACKED
141
    } MPACKED
137
team_type ;
142
team_type ;
138
 
143
 
Line 152... Line 157...
152
*/
157
*/
153
typedef struct
158
typedef struct
154
    {
159
    {
155
        char        abr[5];                          /* Country short name */
160
        char        abr[5];                          /* Country short name */
156
        char        full_name[LEN_CNTRY_NAME + 1] ;  /* Full country name */
161
        char        full_name[LEN_CNTRY_NAME + 1] ;  /* Full country name */
157
#ifdef __MINGW32__
162
#if defined(__MINGW32__) || defined(__GNUC__)
158
        char        dummy;
163
        char        dummy;
159
#endif
164
#endif
160
    }
165
    }
161
ty_t_country ;
166
ty_t_country ;
162
 
167
 
Line 166... Line 171...
166
**  information. This allows the configuration process to be performed
171
**  information. This allows the configuration process to be performed
167
**  on a local copy of the data structure before installing it
172
**  on a local copy of the data structure before installing it
168
**
173
**
169
**  The order of this structure is somewhat erratic as it has grown
174
**  The order of this structure is somewhat erratic as it has grown
170
*/
175
*/
171
typedef struct
176
//typedef struct
172
    {
177
//    {
173
        char        event_name[MAX_EVENT_NAME + 1]; /* Name of the event */
178
//        char        event_name[MAX_EVENT_NAME + 1]; /* Name of the event */
174
        char        leg_name[MAX_LEGS][MAX_LEG_NAME + 1];   /* Names of each leg */
179
//        char        leg_name[MAX_LEGS][MAX_LEG_NAME + 1];   /* Names of each leg */
175
        ty_t_def    t_def[MAX_TMS_SPLIT];        /* Team defintion data */
180
//        ty_t_def    t_def[MAX_TMS_SPLIT];        /* Team defintion data */
176
        short       num_legs;                    /* Number of legs in use */
181
//        short       num_legs;                    /* Number of legs in use */
177
        short       num_teams;                   /* Number of entries in team def array */
182
//        short       num_teams;                   /* Number of entries in team def array */
178
        short       max_team;                    /* Max team number */
183
//        short       max_team;                    /* Max team number */
179
        short       min_team;                    /* Min team number */
184
//        short       min_team;                    /* Min team number */
180
        ty_t_class  team_class[MAX_CLASS];       /* Define team classes */
185
//        ty_t_class  team_class[MAX_CLASS];       /* Define team classes */
181
        short       num_class;                   /* Number of classes */
186
//        short       num_class;                   /* Number of classes */
182
        ty_t_country country_name[MAX_COUNTRY];  /* Define country names */
187
//        ty_t_country country_name[MAX_COUNTRY];  /* Define country names */
183
        short       num_countries;               /* Number of countries */
188
//        short       num_countries;               /* Number of countries */
184
        char        addendum[20];                /* Name of ledgend addendum file */
189
//        char        addendum[20];                /* Name of ledgend addendum file */
185
        char        datafilename[8];             /* Name of the data file */
190
//        char        datafilename[8];             /* Name of the data file */
186
 
191
 
187
        char        nonequestrian_class_abr[3];  /* The non-equestrian class abr */
192
//        char        nonequestrian_class_abr[3];  /* The non-equestrian class abr */
188
        short       nonequestrian_class;         /* Index of non-equestrian class */
193
//        short       nonequestrian_class;         /* Index of non-equestrian class */
189
        short       equestrian_leg;              /* The Equestrian leg - only used if nonequestrian_class */
194
//        short       equestrian_leg;              /* The Equestrian leg - only used if nonequestrian_class */
190
 
195
 
191
        short       lines_per_page;              /* .txt file printing */
196
//        short       lines_per_page;              /* .txt file printing */
192
        short       perf_skip;                   /* .txt file printing */
197
//        short       perf_skip;                   /* .txt file printing */
193
 
198
 
194
        short       class_winners[MAX_CLASS];    /* Winners for each class */
199
//        short       class_winners[MAX_CLASS];    /* Winners for each class */
195
        char        hall_fame[MAX_FAME][MAX_PERSON_NAME + 1];   /* Names */
200
//        char        hall_fame[MAX_FAME][MAX_PERSON_NAME + 1];   /* Names */
196
        short       num_fame;                   /* Number of fame numbers */
201
//        short       num_fame;                   /* Number of fame numbers */
197
    }
202
//    }
198
MARA_CFG;
203
//MARA_CFG;
199
 
204
 
200
 
205
 
201
/*
206
/*
202
**  Menu entry
207
**  Menu entry
203
*/
208
*/
204
typedef struct
209
//typedef struct
205
    {
210
//    {
206
        char        key;                         /* Key to accept entry */
211
//        char        key;                         /* Key to accept entry */
207
        char       *prompt;                      /* User prompt */
212
//        const char *prompt;                      /* User prompt */
208
        void        ( *doit ) ( void );          /* Pointer to a function */
213
//        void        ( *doit ) ( void );          /* Pointer to a function */
209
    }
214
//    }
210
menu_table;
215
//menu_table;
211
 
216
 
212
/*
217
/*
213
**  The following structure is used to do the prelim leg sort
218
**  The following structure is used to do the prelim leg sort
214
*/
219
*/
215
typedef struct
220
typedef struct
Line 217... Line 222...
217
        short       team;                        /* Team number */
222
        short       team;                        /* Team number */
218
        time_t      start;                       /* Start time for team */
223
        time_t      start;                       /* Start time for team */
219
        time_t      leg[MAX_LEGS + 1];           /* Times at end of each leg */
224
        time_t      leg[MAX_LEGS + 1];           /* Times at end of each leg */
220
        time_t      lege[MAX_LEGS + 1];          /* Times leg elapsed times */
225
        time_t      lege[MAX_LEGS + 1];          /* Times leg elapsed times */
221
        short       place;                       /* Place at end of each leg */
226
        short       place;                       /* Place at end of each leg */
222
        short       class;                       /* Team class */
227
        short       teamclass;                   /* Team class */
223
        team_flags  flags;                       /* Team flags */
228
        team_flags  flags;                       /* Team flags */
-
 
229
        bool        isNeData;
224
    }
230
    }
225
ty_s_data;
231
ty_s_data;
226
 
232
 
227
/*
233
/*
228
**  Auxillary sort data
234
**  Auxillary sort data
Line 232... Line 238...
232
        short       team;                        /* Team number */
238
        short       team;                        /* Team number */
233
        short       l_place[MAX_LEGS + 1];       /* Place within each leg */
239
        short       l_place[MAX_LEGS + 1];       /* Place within each leg */
234
        short       le_place[MAX_LEGS + 1];      /* Place at end of each leg */
240
        short       le_place[MAX_LEGS + 1];      /* Place at end of each leg */
235
        short       lc_place[MAX_LEGS + 1];      /* Place within leg - class */
241
        short       lc_place[MAX_LEGS + 1];      /* Place within leg - class */
236
        short       lec_place[MAX_LEGS + 1];     /* Place at end of each leg - class */
242
        short       lec_place[MAX_LEGS + 1];     /* Place at end of each leg - class */
-
 
243
 
-
 
244
        short       lq_place[MAX_LEGS + 1];      /* Place within leg - assuming NE class */
-
 
245
        short       leq_place[MAX_LEGS + 1];     /* Place at end of each leg - assuming NE class */
-
 
246
        short       lcq_place[MAX_LEGS + 1];     /* Place within leg - class, subclass NE */
-
 
247
        short       lecq_place[MAX_LEGS + 1];    /* Place at end of each leg - class, subclass NE  */
-
 
248
 
237
    }
249
    }
-
 
250
 
238
ty_s_aux;
251
ty_s_aux;
239
 
252
 
240
typedef struct
253
typedef struct
241
    {
254
    {
242
        short       numb;                        /* Team number */
255
        short       numb;                        /* Team number */
Line 246... Line 259...
246
t_legs;
259
t_legs;
247
 
260
 
248
typedef struct
261
typedef struct
249
{
262
{
250
    int         total;                          /* Total */
263
    int         total;                          /* Total */
-
 
264
    int         valid;                          /* Valid entries */
-
 
265
    int         valid_ne;                       /* Valid NE entries: Can be winners */
-
 
266
    int         valid_ev;                       /* Valid Full Event entries: Can be winners */
251
    int         disqualified;                   /* Those disqualified */
267
    int         disqualified;                   /* Those disqualified */
252
    int         non_equestrian;                 /* Those on Non-E */
268
    int         non_equestrian;                 /* Those on Non-E */
-
 
269
    int         vet_check;                      /* Those that failed the vet check */
253
} t_class_sum_entry;
270
} t_class_sum_entry;
254
 
271
 
255
typedef struct
272
typedef struct
256
{
273
{
257
    t_class_sum_entry   class[MAX_CLASS];       /* Per class data */
274
    t_class_sum_entry   teamclass[MAX_CLASS];       /* Per class data */
258
    t_class_sum_entry   total;                  /* Totals */
275
    t_class_sum_entry   total;                      /* Totals */
259
} t_class_summary;
276
} t_class_summary;
260
 
277
 
261
typedef struct
278
typedef struct
262
{
279
{
263
    char        name[MAX_PERSON_NAME + 1];
280
    char        name[MAX_PERSON_NAME + 1];
264
    ushort      leg;
281
    ushort      leg;
265
    ushort      team;
282
    ushort      team;
266
    short       class;
283
    short       teamclass;
267
    char        multi;
284
    char        multi;
268
} ty_s_namedata;
285
} ty_s_namedata;
269
 
286
 
-
 
287
/*
-
 
288
**  A structure to hold statistical information
-
 
289
*/
-
 
290
typedef struct
-
 
291
{
-
 
292
    int         team[MAX_LEGS + 1][MAX_CLASS + 1];
-
 
293
    struct
-
 
294
    {
-
 
295
        int     team[MAX_LEGS + 1][MAX_CLASS + 1];
-
 
296
        time_t  time[MAX_LEGS + 1][MAX_CLASS + 1];
-
 
297
    } fast;
-
 
298
    time_t      average[MAX_LEGS + 1][MAX_CLASS + 1];
-
 
299
} ty_stats;
270
 
300
 
271
 
301
 
272
/********************************* EOF ***********************************/
302
/********************************* EOF ***********************************/
-
 
303
#endif