Subversion Repositories svn1

Rev

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