Subversion Repositories svn1-original

Rev

Rev 336 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 root 1
/*************************************************************************
2
*           Copyright (C) 1995 Embedded Solutions
3
*                       All rights reserved
4
*
5
* file:     hdrs/structs.h
6
*
7
* purpose:  Structures used throughout the marathon program suite
8
*
9
* programmer: David Purdie
10
*
11
* revision  date        by      reason
12
*   00.0    27/01/95    DDP     Tidies up the program and formatted the file
13
*
14
**************************************************************************/
123 david 15
#ifndef __structs_h__
16
#define __structs_h__
1 root 17
#include    <time.h>
18
 
19
typedef unsigned char  uchar;
20
typedef unsigned int   uint;
21
typedef unsigned long  ulong;
95 - 22
//typedef unsigned char  bool;
1 root 23
typedef unsigned short ushort;
24
 
212 - 25
#if defined(__MINGW32__) || defined(__GNUC__)
1 root 26
#define MPACKED  __attribute__ ((packed))
27
#define FILL1   char    dummy;
28
#define FILL1a  char    dummya;
29
#define LONG_FILE_NAMES
30
#else
31
#define MPACKED
32
#define FILL1
33
#define FILL1a
34
#endif
35
 
36
/*
79 - 37
**  Type of report
38
*/
39
typedef enum report_type_enum
40
{
41
    text        = 0,
42
    html        = 1,
43
    printed     = 2
44
} report_type;
45
 
46
/*
1 root 47
**  Create three types of SEX to handle for the unknown
48
*/
49
typedef ushort sex_type /* MPACKED */;
50
 
51
typedef enum sex_enum
52
    { unknown, male, female }
53
sex_type_old;
54
 
55
 
56
/*
57
**  Define types of data
58
*/
59
typedef enum class_enum
60
    { Digit, Alphanum, Alpha, AlphnumUpper }
61
class_type;
62
 
63
/*
64
**  Leg error information
65
*/
66
typedef struct
67
    {
68
        short       leg,                         /* Leg with error */
69
                    type;                        /* Type of error */
70
    }
71
ty_check_error;
72
 
73
/*
74
**  Describe team numbers by a range. Start .. End
75
*/
76
typedef struct
77
    {
78
        short       start;                       /* First team number in group */
79
        short       end;                         /* Last team number in group */
80
    }
81
ty_t_def;
82
 
83
/*
84
**  Describe the time of each leg
85
*/
86
typedef struct
87
    {
88
        time_t      start,                      /* Start time of leg */
89
                    end,                        /* End time of leg */
90
                    elapsed;                    /* Elapsed time */
91
        short       l_place,                    /* Place in leg */
92
                    le_place,                   /* Place at leg end */
93
                    lc_place,                   /* Place in leg for class */
94
                    lec_place;                  /* Place at leg end for class */
95
        char        manual;                     /* Flag for manual start time */
96
        FILL1
97
    } MPACKED
98
leg_type ;
99
 
100
 
101
/*
102
**  Details for each team member
103
*/
104
typedef struct
105
    {
106
        char        name[MAX_PERSON_NAME + 1];   /* Persons name */
107
        ushort      legs[MAX_LEGS + 1];          /* Runs in these legs */
108
        sex_type    sex;                         /* Type of sex */
45 - 109
        uchar       age;                         /* Age of person */
1 root 110
    } MPACKED
111
memb_type;
112
 
113
/*
114
**  Team based flags
115
*/
116
typedef struct
117
    {
250 - 118
    bool        valid;                          /* Data valid flag */
119
    bool        bad_times;                      /* Legs times not fully defined */
120
    bool        disqualified;                   /* Team has been disqualified */
121
    bool        non_equestrian:1;               /* Team is special : non-equestrian */
122
    bool        vet_check:1;                    /* Team Disqual - Failed vet check */
1 root 123
    } MPACKED
229 - 124
team_flags ;                                    /* Flag word */
1 root 125
 
126
/*
127
**  Team information
128
*/
129
typedef struct
130
    {
131
        short       numb;                        /* Team number */
132
        char        name[MAX_TM_NAME + 1];       /* Team name */
133
        FILL1
134
        leg_type    leg [MAX_LEGS + 1];          /* Timing structure for each leg */
135
        memb_type   members[MAX_MEMB];           /* Team members */
95 - 136
        short       teamclass;                   /* Team class index */
1 root 137
        short       country;                     /* Team country index */
138
        team_flags  flags;                       /* Flag word */
139
    } MPACKED
140
team_type ;
141
 
142
/*
143
**  Class information
144
*/
145
typedef struct
146
    {
147
        char        abr[3];                         /* Team class - short name */
148
        char        full_name[LEN_CLASS_NAME + 1];  /* Long class name */
149
        time_t      start;                          /* Start time for each class */
150
    }
151
ty_t_class;
152
 
153
/*
154
**  Country information
155
*/
156
typedef struct
157
    {
158
        char        abr[5];                          /* Country short name */
159
        char        full_name[LEN_CNTRY_NAME + 1] ;  /* Full country name */
214 - 160
#if defined(__MINGW32__) || defined(__GNUC__)
1 root 161
        char        dummy;
162
#endif
163
    }
164
ty_t_country ;
165
 
166
 
167
/*
168
**  Define a data structure that contains ALL the configuration
169
**  information. This allows the configuration process to be performed
170
**  on a local copy of the data structure before installing it
171
**
172
**  The order of this structure is somewhat erratic as it has grown
173
*/
181 - 174
//typedef struct
175
//    {
176
//        char        event_name[MAX_EVENT_NAME + 1]; /* Name of the event */
177
//        char        leg_name[MAX_LEGS][MAX_LEG_NAME + 1];   /* Names of each leg */
178
//        ty_t_def    t_def[MAX_TMS_SPLIT];        /* Team defintion data */
179
//        short       num_legs;                    /* Number of legs in use */
180
//        short       num_teams;                   /* Number of entries in team def array */
181
//        short       max_team;                    /* Max team number */
182
//        short       min_team;                    /* Min team number */
183
//        ty_t_class  team_class[MAX_CLASS];       /* Define team classes */
184
//        short       num_class;                   /* Number of classes */
185
//        ty_t_country country_name[MAX_COUNTRY];  /* Define country names */
186
//        short       num_countries;               /* Number of countries */
187
//        char        addendum[20];                /* Name of ledgend addendum file */
188
//        char        datafilename[8];             /* Name of the data file */
1 root 189
 
181 - 190
//        char        nonequestrian_class_abr[3];  /* The non-equestrian class abr */
191
//        short       nonequestrian_class;         /* Index of non-equestrian class */
192
//        short       equestrian_leg;              /* The Equestrian leg - only used if nonequestrian_class */
1 root 193
 
181 - 194
//        short       lines_per_page;              /* .txt file printing */
195
//        short       perf_skip;                   /* .txt file printing */
1 root 196
 
181 - 197
//        short       class_winners[MAX_CLASS];    /* Winners for each class */
198
//        char        hall_fame[MAX_FAME][MAX_PERSON_NAME + 1];   /* Names */
199
//        short       num_fame;                   /* Number of fame numbers */
200
//    }
201
//MARA_CFG;
1 root 202
 
203
 
204
/*
205
**  Menu entry
206
*/
181 - 207
//typedef struct
208
//    {
209
//        char        key;                         /* Key to accept entry */
210
//        const char *prompt;                      /* User prompt */
211
//        void        ( *doit ) ( void );          /* Pointer to a function */
212
//    }
213
//menu_table;
1 root 214
 
215
/*
216
**  The following structure is used to do the prelim leg sort
217
*/
218
typedef struct
219
    {
220
        short       team;                        /* Team number */
221
        time_t      start;                       /* Start time for team */
222
        time_t      leg[MAX_LEGS + 1];           /* Times at end of each leg */
223
        time_t      lege[MAX_LEGS + 1];          /* Times leg elapsed times */
224
        short       place;                       /* Place at end of each leg */
95 - 225
        short       teamclass;                   /* Team class */
231 - 226
        short       real_teamclass;              /* Team class */
1 root 227
        team_flags  flags;                       /* Team flags */
336 david 228
        bool        isNeData;
1 root 229
    }
230
ty_s_data;
231
 
232
/*
233
**  Auxillary sort data
234
*/
235
typedef struct
236
    {
237
        short       team;                        /* Team number */
238
        short       l_place[MAX_LEGS + 1];       /* Place within each leg */
239
        short       le_place[MAX_LEGS + 1];      /* Place at end of each leg */
240
        short       lc_place[MAX_LEGS + 1];      /* Place within leg - class */
241
        short       lec_place[MAX_LEGS + 1];     /* Place at end of each leg - class */
338 david 242
 
243
        //short       lcq_place[MAX_LEGS + 1];     /* Place within leg - class, subclass NE */
244
        //short       lceq_place[MAX_LEGS + 1];    /* Place at end of each leg - class, subclass NE  */
245
        short       lq_place[MAX_LEGS + 1];      /* Place within leg - assuming NE class */
246
        short       leq_place[MAX_LEGS + 1];     /* Place at end of each leg - assuming NE class */
1 root 247
    }
338 david 248
 
1 root 249
ty_s_aux;
250
 
251
typedef struct
252
    {
253
        short       numb;                        /* Team number */
254
        time_t      start;                       /* Leg-N start time */
255
        team_flags  flags;                       /* Flag word */
256
    }
257
t_legs;
258
 
259
typedef struct
260
{
261
    int         total;                          /* Total */
231 - 262
    int         valid;                          /* Valid entries */
288 david 263
    int         valid_ne;                       /* Valid NE entries: Can be winners */
264
    int         valid_ev;                       /* Valid Full Event entries: Can be winners */
1 root 265
    int         disqualified;                   /* Those disqualified */
266
    int         non_equestrian;                 /* Those on Non-E */
229 - 267
    int         vet_check;                      /* Those that failed the vet check */
1 root 268
} t_class_sum_entry;
269
 
270
typedef struct
271
{
288 david 272
    t_class_sum_entry   teamclass[MAX_CLASS];       /* Per class data */
273
    t_class_sum_entry   total;                      /* Totals */
1 root 274
} t_class_summary;
275
 
18 david 276
typedef struct
277
{
278
    char        name[MAX_PERSON_NAME + 1];
279
    ushort      leg;
280
    ushort      team;
95 - 281
    short       teamclass;
18 david 282
    char        multi;
283
} ty_s_namedata;
1 root 284
 
192 - 285
/*
286
**  A structure to hold statistical information
287
*/
288
typedef struct
289
{
290
    int         team[MAX_LEGS + 1][MAX_CLASS + 1];
291
    struct
292
    {
293
        int     team[MAX_LEGS + 1][MAX_CLASS + 1];
294
        time_t  time[MAX_LEGS + 1][MAX_CLASS + 1];
295
    } fast;
296
    time_t      average[MAX_LEGS + 1][MAX_CLASS + 1];
297
} ty_stats;
79 - 298
 
299
 
1 root 300
/********************************* EOF ***********************************/
123 david 301
#endif