Subversion Repositories svn1

Rev

Rev 208 | Rev 225 | Go to most recent revision | 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
**************************************************************************/
119 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;
91 - 22
//typedef unsigned char  bool;
1 root 23
typedef unsigned short ushort;
24
 
208 - 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
/*
75 - 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
    {
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;              /* Team is special : non-equestrian */
122
    } MPACKED
123
team_flags ;                                      /* Flag word */
124
 
125
/*
126
**  Team information
127
*/
128
typedef struct
129
    {
130
        short       numb;                        /* Team number */
131
        char        name[MAX_TM_NAME + 1];       /* Team name */
132
        FILL1
133
        leg_type    leg [MAX_LEGS + 1];          /* Timing structure for each leg */
134
        memb_type   members[MAX_MEMB];           /* Team members */
91 - 135
        short       teamclass;                   /* Team class index */
1 root 136
        short       country;                     /* Team country index */
137
        team_flags  flags;                       /* Flag word */
138
    } MPACKED
139
team_type ;
140
 
141
/*
142
**  Class information
143
*/
144
typedef struct
145
    {
146
        char        abr[3];                         /* Team class - short name */
147
        char        full_name[LEN_CLASS_NAME + 1];  /* Long class name */
148
        time_t      start;                          /* Start time for each class */
149
    }
150
ty_t_class;
151
 
152
/*
153
**  Country information
154
*/
155
typedef struct
156
    {
157
        char        abr[5];                          /* Country short name */
158
        char        full_name[LEN_CNTRY_NAME + 1] ;  /* Full country name */
210 - 159
#if defined(__MINGW32__) || defined(__GNUC__)
1 root 160
        char        dummy;
161
#endif
162
    }
163
ty_t_country ;
164
 
165
 
166
/*
167
**  Define a data structure that contains ALL the configuration
168
**  information. This allows the configuration process to be performed
169
**  on a local copy of the data structure before installing it
170
**
171
**  The order of this structure is somewhat erratic as it has grown
172
*/
177 - 173
//typedef struct
174
//    {
175
//        char        event_name[MAX_EVENT_NAME + 1]; /* Name of the event */
176
//        char        leg_name[MAX_LEGS][MAX_LEG_NAME + 1];   /* Names of each leg */
177
//        ty_t_def    t_def[MAX_TMS_SPLIT];        /* Team defintion data */
178
//        short       num_legs;                    /* Number of legs in use */
179
//        short       num_teams;                   /* Number of entries in team def array */
180
//        short       max_team;                    /* Max team number */
181
//        short       min_team;                    /* Min team number */
182
//        ty_t_class  team_class[MAX_CLASS];       /* Define team classes */
183
//        short       num_class;                   /* Number of classes */
184
//        ty_t_country country_name[MAX_COUNTRY];  /* Define country names */
185
//        short       num_countries;               /* Number of countries */
186
//        char        addendum[20];                /* Name of ledgend addendum file */
187
//        char        datafilename[8];             /* Name of the data file */
1 root 188
 
177 - 189
//        char        nonequestrian_class_abr[3];  /* The non-equestrian class abr */
190
//        short       nonequestrian_class;         /* Index of non-equestrian class */
191
//        short       equestrian_leg;              /* The Equestrian leg - only used if nonequestrian_class */
1 root 192
 
177 - 193
//        short       lines_per_page;              /* .txt file printing */
194
//        short       perf_skip;                   /* .txt file printing */
1 root 195
 
177 - 196
//        short       class_winners[MAX_CLASS];    /* Winners for each class */
197
//        char        hall_fame[MAX_FAME][MAX_PERSON_NAME + 1];   /* Names */
198
//        short       num_fame;                   /* Number of fame numbers */
199
//    }
200
//MARA_CFG;
1 root 201
 
202
 
203
/*
204
**  Menu entry
205
*/
177 - 206
//typedef struct
207
//    {
208
//        char        key;                         /* Key to accept entry */
209
//        const char *prompt;                      /* User prompt */
210
//        void        ( *doit ) ( void );          /* Pointer to a function */
211
//    }
212
//menu_table;
1 root 213
 
214
/*
215
**  The following structure is used to do the prelim leg sort
216
*/
217
typedef struct
218
    {
219
        short       team;                        /* Team number */
220
        time_t      start;                       /* Start time for team */
221
        time_t      leg[MAX_LEGS + 1];           /* Times at end of each leg */
222
        time_t      lege[MAX_LEGS + 1];          /* Times leg elapsed times */
223
        short       place;                       /* Place at end of each leg */
91 - 224
        short       teamclass;                   /* Team class */
1 root 225
        team_flags  flags;                       /* Team flags */
226
    }
227
ty_s_data;
228
 
229
/*
230
**  Auxillary sort data
231
*/
232
typedef struct
233
    {
234
        short       team;                        /* Team number */
235
        short       l_place[MAX_LEGS + 1];       /* Place within each leg */
236
        short       le_place[MAX_LEGS + 1];      /* Place at end of each leg */
237
        short       lc_place[MAX_LEGS + 1];      /* Place within leg - class */
238
        short       lec_place[MAX_LEGS + 1];     /* Place at end of each leg - class */
239
    }
240
ty_s_aux;
241
 
242
typedef struct
243
    {
244
        short       numb;                        /* Team number */
245
        time_t      start;                       /* Leg-N start time */
246
        team_flags  flags;                       /* Flag word */
247
    }
248
t_legs;
249
 
250
typedef struct
251
{
252
    int         total;                          /* Total */
253
    int         disqualified;                   /* Those disqualified */
254
    int         non_equestrian;                 /* Those on Non-E */
255
} t_class_sum_entry;
256
 
257
typedef struct
258
{
91 - 259
    t_class_sum_entry   teamclass[MAX_CLASS];   /* Per class data */
1 root 260
    t_class_sum_entry   total;                  /* Totals */
261
} t_class_summary;
262
 
18 david 263
typedef struct
264
{
265
    char        name[MAX_PERSON_NAME + 1];
266
    ushort      leg;
267
    ushort      team;
91 - 268
    short       teamclass;
18 david 269
    char        multi;
270
} ty_s_namedata;
1 root 271
 
188 - 272
/*
273
**  A structure to hold statistical information
274
*/
275
typedef struct
276
{
277
    int         team[MAX_LEGS + 1][MAX_CLASS + 1];
278
    struct
279
    {
280
        int     team[MAX_LEGS + 1][MAX_CLASS + 1];
281
        time_t  time[MAX_LEGS + 1][MAX_CLASS + 1];
282
    } fast;
283
    time_t      average[MAX_LEGS + 1][MAX_CLASS + 1];
284
} ty_stats;
75 - 285
 
286
 
1 root 287
/********************************* EOF ***********************************/
119 david 288
#endif