Subversion Repositories svn1

Rev

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

Rev 33 Rev 61
Line 56... Line 56...
56
#endif
56
#endif
57
#include    "consts.h"
57
#include    "consts.h"
58
#include    "structs.h"
58
#include    "structs.h"
59
#include    "proto.h"
59
#include    "proto.h"
60
 
60
 
-
 
61
void pri_awards_html(void);
61
void pri_awards(void);
62
void pri_awards(void);
62
void pri_master_index(void);
63
void pri_master_index(void);
63
char *placing ( int place );
64
char *placing ( int place );
64
void pri_name_index(void);
65
void pri_name_index(void);
65
void pri_name_index_body( void );
66
void pri_name_index_body( void );
66
void pri_all_reports (void );
67
void pri_all_reports (void );
67
void pri_leg_body(int leg);
68
void pri_leg_body(int leg);
68
void pri_eleg_body(int leg);
69
void pri_eleg_body(int leg);
-
 
70
void pri_csv_data ( void );
69
 
71
 
70
 
72
 
71
menu_table  rpt_menu[] = {
73
menu_table  rpt_menu[] = {
72
    { '1', "Print team order", pri_team },
74
    { '1', "Print team order", pri_team },
73
    { '2', "Print end leg times", pri_leg },
75
    { '2', "Print end leg times", pri_leg },
Line 76... Line 78...
76
    { '5', "Print final results(All-HTML)", pri_final_html },
78
    { '5', "Print final results(All-HTML)", pri_final_html },
77
    { '6', "Print Interim results", pri_interim },
79
    { '6', "Print Interim results", pri_interim },
78
    { '7', "Update event and class placings", srt_place },
80
    { '7', "Update event and class placings", srt_place },
79
    { '8', "Display summary information", display_summary },
81
    { '8', "Display summary information", display_summary },
80
    { '9', "Print summary information", pri_summary },
82
    { '9', "Print summary information", pri_summary },
81
    { 'a', "Print Awards only", pri_awards },
83
    { 'a', "Print Awards only", pri_awards_html },
82
    { 'b', "Print Master Index only", pri_master_index },
84
    { 'b', "Print Master Index only", pri_master_index },
83
    { 'c', "Print Name Index only", pri_name_index },
85
    { 'c', "Print Name Index only", pri_name_index },
-
 
86
    { 'e', "Export CSV Report Data", pri_csv_data },
84
    { 'z', "Print all reports", pri_all_reports },
87
    { 'z', "Print all reports", pri_all_reports },
85
    
88
    
86
#if defined(HI_TECH_C) || defined(__TURBOC__)
89
#if defined(HI_TECH_C) || defined(__TURBOC__)
87
    { 'S', "MS-DOS system", ms_system },
90
    { 'S', "MS-DOS system", ms_system },
88
#endif
91
#endif
Line 983... Line 986...
983
        {
986
        {
984
            print( "<A NAME=\"Team_%04d\"></A>",team_buf.numb );
987
            print( "<A NAME=\"Team_%04d\"></A>",team_buf.numb );
985
        }
988
        }
986
 
989
 
987
        /*
990
        /*
988
        **  Print the basics
991
        **  Print the basics (Finishing order)
989
        **      - Place within complete field
992
        **      - Place within complete field
990
        **      - Team number - with HTML reference to team file
993
        **      - Team number - with HTML reference to team file
991
        **      - Class
994
        **      - Class
992
        */
995
        */
993
        print( "%4.4s ", pr_place( team_buf.leg[0].l_place, ptr->flags.bad_times ) );
996
        print( "%4.4s ", pr_place( team_buf.leg[0].l_place, ptr->flags.bad_times ) );
Line 1008... Line 1011...
1008
            /*
1011
            /*
1009
            **  Ensure that non-equestrian leg data is not displayed
1012
            **  Ensure that non-equestrian leg data is not displayed
1010
            */
1013
            */
1011
            if ( j == config.equestrian_leg && team_buf.flags.non_equestrian )
1014
            if ( j == config.equestrian_leg && team_buf.flags.non_equestrian )
1012
            {
1015
            {
1013
                print( "  %-8s %4.4s %4.4s", "-- NE --", "-","-");
1016
                print( "  %-8s %4.4s %4.4s", "-- NE --", "NE","NE");
1014
            }
1017
            }
1015
            else
1018
            else
1016
            {
1019
            {
1017
                print( "  %-8s %4.4s %4.4s",
1020
                print( "  %-8s %4.4s %4.4s",
1018
                    time_a( team_buf.leg[j].elapsed ),
1021
                    time_a( team_buf.leg[j].elapsed ),
Line 1021... Line 1024...
1021
                  );
1024
                  );
1022
            }
1025
            }
1023
        }
1026
        }
1024
 
1027
 
1025
       /*
1028
       /*
1026
        **  Print the trailer
1029
        **  Print the trailer (Finishing order)
1027
        **      - Total time
1030
        **      - Total time
1028
        **      - Category place - with reference to category file
1031
        **      - Category place - with reference to category file
1029
        */
1032
        */
1030
        print( "  %-8s ",  time_a( team_buf.leg[0].elapsed ) );
1033
//        print( "  %-8s ",  time_a( team_buf.leg[0].elapsed ) );
-
 
1034
        print( "  %-8s ", time_a( ptr->lege[0] ) );
-
 
1035
        
1031
        if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">",p_filename(filebase, config.team_class[team_buf.class - 1].abr ,"html"), team_buf.numb );
1036
        if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">",p_filename(filebase, config.team_class[team_buf.class - 1].abr ,"html"), team_buf.numb );
1032
        print( "%-4.4s", pr_place( team_buf.leg[0].lc_place, ptr->flags.bad_times ) );
1037
        print( "%-4.4s", pr_place_ne( team_buf.leg[0].lc_place, ptr->flags.bad_times, ptr->flags.non_equestrian ) );
1033
        if ( report_html ) print( "</A>" );
1038
        if ( report_html ) print( "</A>" );
1034
 
1039
 
1035
        print( "\n" );
1040
        print( "\n" );
1036
    }
1041
    }
1037
 
1042
 
Line 1112... Line 1117...
1112
        for( j = 1; j <= config.num_legs; j++ )
1117
        for( j = 1; j <= config.num_legs; j++ )
1113
        {
1118
        {
1114
            /*
1119
            /*
1115
            **  Ensure that non-equestrian leg data is not displayed
1120
            **  Ensure that non-equestrian leg data is not displayed
1116
            */
1121
            */
1117
            if ( j == config.equestrian_leg && ptr->class == config.nonequestrian_class)
1122
            if ( j == config.equestrian_leg && (ptr->class == config.nonequestrian_class || ptr->flags.non_equestrian) )
1118
            {
1123
            {
1119
                print( "  %-8s %4.4s %4.4s", "-- NE --", "-","-");
1124
                print( "  %-8s %4.4s %4.4s", "-- NE --", "NE","NE");
1120
            }
1125
            }
1121
            else
1126
            else
1122
            {
1127
            {
1123
                print( "  %-8s %4.4s %4.4s", time_a( team_buf.leg[j].elapsed ),
1128
                print( "  %-8s %4.4s %4.4s", time_a( team_buf.leg[j].elapsed ),
1124
                       pr_place( team_buf.leg[j].lc_place, ptr->flags.bad_times ),
1129
                       pr_place( team_buf.leg[j].lc_place,  ptr->flags.bad_times ),
1125
                       pr_place( team_buf.leg[j].lec_place, ptr->flags.bad_times ) );
1130
                       pr_place( team_buf.leg[j].lec_place, ptr->flags.bad_times ) );
1126
            }
1131
            }
1127
        }
1132
        }
1128
 
1133
 
1129
        /*
1134
        /*
Line 1133... Line 1138...
1133
        */
1138
        */
1134
        /* print( "  %-8s ", time_a( team_buf.leg[0].elapsed ) ); */
1139
        /* print( "  %-8s ", time_a( team_buf.leg[0].elapsed ) ); */
1135
        print( "  %-8s ", time_a( ptr->lege[0] ) );
1140
        print( "  %-8s ", time_a( ptr->lege[0] ) );
1136
 
1141
 
1137
        if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">", p_filename(filebase, "finish" ,"html"), team_buf.numb );
1142
        if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">", p_filename(filebase, "finish" ,"html"), team_buf.numb );
1138
        print( "%4.4s", pr_place( team_buf.leg[0].l_place, ptr->flags.bad_times | (ptr->class == config.nonequestrian_class) ) );
1143
        print( "%4.4s", pr_place( team_buf.leg[0].l_place, ptr->flags.bad_times || (ptr->class == config.nonequestrian_class)));
1139
        if ( report_html ) print( "</A>" );
1144
        if ( report_html ) print( "</A>" );
1140
 
1145
 
1141
        print( "\n" );
1146
        print( "\n" );
1142
    }
1147
    }
1143
 
1148
 
Line 1180... Line 1185...
1180
    **  Generate the awards report.
1185
    **  Generate the awards report.
1181
    **  This is only available as an HTML report
1186
    **  This is only available as an HTML report
1182
    */
1187
    */
1183
    if ( report_html )
1188
    if ( report_html )
1184
    {
1189
    {
1185
        pri_awards();
1190
        pri_awards_html();
1186
    }
1191
    }
1187
 
1192
 
1188
    /*
1193
    /*
1189
    **  Generate the master index page
1194
    **  Generate the master index page
1190
    */
1195
    */
Line 1234... Line 1239...
1234
 *
1239
 *
1235
 *  Returns:
1240
 *  Returns:
1236
 *      Nothing
1241
 *      Nothing
1237
 *
1242
 *
1238
 *========================================================================*/
1243
 *========================================================================*/
-
 
1244
void pri_awards_html(void)
-
 
1245
{
-
 
1246
    /*
-
 
1247
    **  Generate ALL results with HTML tags
-
 
1248
    */
-
 
1249
    report_html = TRUE;
-
 
1250
    pri_awards();
-
 
1251
    report_html = FALSE;
-
 
1252
}
-
 
1253
 
-
 
1254
/*========================================================================
-
 
1255
 *
-
 
1256
 *  Print award results
-
 
1257
 *
-
 
1258
 *  Purpose:
-
 
1259
 *      This function is called to Print award results
-
 
1260
 *      Keep the page to 80 cols, so that it can be pronted on A4
-
 
1261
 *
-
 
1262
 *  Parameters:
-
 
1263
 *      None
-
 
1264
 *
-
 
1265
 *  Returns:
-
 
1266
 *      Nothing
-
 
1267
 *
-
 
1268
 *========================================================================*/
1239
void pri_awards(void)
1269
void pri_awards(void)
1240
{
1270
{
1241
    int j;
1271
    int j;
1242
    int i;
1272
    int i;
1243
    int k;
1273
    int k;
1244
    int windex;
1274
    int windex;
1245
    ty_s_data  *ptr;
1275
    ty_s_data  *ptr;
1246
    int         last_class;
1276
    int         last_class;
1247
 
1277
 
1248
    report_html = 1;
-
 
1249
    if( !open_printer( "", "awards", 80, report_html, "Prizes and Awards" ) )
1278
    if( !open_printer( "", "awards", 80, report_html, "Prizes and Awards" ) )
1250
        return;
1279
        return;
1251
 
1280
 
1252
    /*
1281
    /*
1253
    **  Generate an index for this page
1282
    **  Generate an index for this page
1254
    */
1283
    */
1255
    print( "\n");
1284
    print( "\n");
-
 
1285
    if ( report_html )
-
 
1286
    {
1256
    print( "<hr>" );
1287
        print( "<hr>" );
1257
    print( "<A NAME=\"%s\"></A>","INDEX");
1288
        print( "<A NAME=\"%s\"></A>","INDEX");
-
 
1289
    }
1258
    print( "Award Categories");
1290
    print( "Award Categories");
1259
 
1291
 
1260
    for( j = 1; j <= config.num_class; j++ )
1292
    for( j = 1; j <= config.num_class; j++ )
1261
    {
1293
    {
1262
        /*
1294
        /*
Line 1264... Line 1296...
1264
        */
1296
        */
1265
        if ( config.class_winners[j-1] <= 0 )
1297
        if ( config.class_winners[j-1] <= 0 )
1266
            continue;
1298
            continue;
1267
 
1299
 
1268
        print( "\n");
1300
        print( "\n");
-
 
1301
        print( "    ");
1269
        print( "    <A HREF=\"#%s\">",config.team_class[j-1].full_name);
1302
        if ( report_html ) print( "<A HREF=\"#%s\">",config.team_class[j-1].full_name);
1270
        print( "%s",  config.team_class[j-1].full_name );
1303
        print( "%s",  config.team_class[j-1].full_name );
1271
        print( "</A>" );
1304
        if ( report_html ) print( "</A>" );
1272
    }
1305
    }
1273
 
1306
 
1274
    /*
1307
    /*
1275
    **  Manual entries
1308
    **  Manual entries
1276
    */
1309
    */
1277
    print( "\n");
1310
    print( "\n");
-
 
1311
    print( "    ");
1278
    print( "    <A HREF=\"#%s\">","Hall Of Fame");
1312
    if ( report_html ) print( "<A HREF=\"#%s\">","Hall Of Fame");
1279
    print( "%s",  "Hall Of Fame" );
1313
    print( "%s",  "Hall Of Fame" );
1280
    print( "</A>" );
1314
    if ( report_html ) print( "</A>" );
1281
 
1315
 
1282
    print( "\n");
1316
    print( "\n");
-
 
1317
    print( "    ");
1283
    print( "    <A HREF=\"#%s\">","FASTEST");
1318
    if ( report_html ) print( "<A HREF=\"#%s\">","FASTEST");
1284
    print( "%s",  "FASTEST" );
1319
    print( "%s",  "FASTEST" );
1285
    print( "</A>" );
1320
    if ( report_html ) print( "</A>" );
1286
 
1321
 
1287
    /*
1322
    /*
1288
    **  Sort the data by class
1323
    **  Sort the data by class
1289
    */
1324
    */
1290
    sort_team_data( 0, S_LC );      /* Generate class placement data */
1325
    sort_team_data( 0, S_LC );      /* Generate class placement data */
Line 1297... Line 1332...
1297
    {
1332
    {
1298
        /*
1333
        /*
1299
        **  Tail for previous entry
1334
        **  Tail for previous entry
1300
        */
1335
        */
1301
        if ( j != 1 )
1336
        if ( j != 1 )
1302
            print( "<A HREF=\"#%s\">Awards Index</A>","INDEX");
1337
            if ( report_html ) print( "<A HREF=\"#%s\">Awards Index</A>","INDEX");
1303
 
1338
 
1304
        if ( j > config.num_class  )
1339
        if ( j > config.num_class  )
1305
            break;
1340
            break;
1306
 
1341
 
1307
        /*
1342
        /*
1308
        **  Header for the class
1343
        **  Header for the class
1309
        */
1344
        */
1310
        print( "\n");
1345
        print( "\n");
-
 
1346
        if ( report_html )
-
 
1347
        {
1311
        print( "<hr>" );
1348
            print( "<hr>" );
1312
        print( "<A name=\"%s\"></A>",config.team_class[j-1].full_name);
1349
            print( "<A name=\"%s\"></A>",config.team_class[j-1].full_name);
-
 
1350
        }
-
 
1351
        else
-
 
1352
        {
-
 
1353
            print( "\n");
-
 
1354
        }
-
 
1355
        print( "Category: ");
1313
        print( "<A HREF=\"%s\">",p_filename(filebase, config.team_class[j - 1].abr ,"html"));
1356
        if ( report_html ) print( "<A HREF=\"%s\">",p_filename(filebase, config.team_class[j - 1].abr ,"html"));
1314
        print( "%s",  config.team_class[j-1].full_name );
1357
        print( "%s",  config.team_class[j-1].full_name );
1315
        print( "</A>" );
1358
        if ( report_html ) print( "</A>" );
1316
 
1359
 
1317
                if ( config.class_winners[j-1] <= 0 )
1360
        if ( config.class_winners[j-1] <= 0 )
1318
        {
1361
        {
1319
            print( "\n");
1362
            print( "\n");
1320
            print( "No winners awarded" );
1363
            print( "No winners awarded" );
1321
            continue;
1364
            continue;
1322
        }
1365
        }
Line 1342... Line 1385...
1342
                /*
1385
                /*
1343
                **  If printing an HTML report then we need to mark
1386
                **  If printing an HTML report then we need to mark
1344
                **  the entry with a reference so that we can link to it
1387
                **  the entry with a reference so that we can link to it
1345
                */
1388
                */
1346
                print( "\n");
1389
                print( "\n");
-
 
1390
                if ( report_html )
-
 
1391
                {
1347
                print( "<A NAME=\"Team_%04d\">",team_buf.numb );
1392
                    print( "<A NAME=\"Team_%04d\">",team_buf.numb );
1348
                print( "</A>" );
1393
                    print( "</A>" );
-
 
1394
                }
1349
 
1395
 
1350
                /*
1396
                /*
1351
                **  Basic information
1397
                **  Basic information
1352
                **      - Team number - with Xref back to full result
1398
                **      - Team number - with Xref back to full result
1353
                **      - Full team name
1399
                **      - Full team name
1354
                **      - Full categoray name
1400
                **      - Full categoray name
1355
                */
1401
                */
1356
                print( "%s", placing(windex) );
1402
                print( "%s", placing(windex) );
1357
 
1403
 
-
 
1404
                print( "  Team Name: ");
1358
                print( "  Team Name: <A HREF=\"%s#Team_%04d\">", p_filename(filebase, "name" ,"html"), team_buf.numb );
1405
                if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">", p_filename(filebase, "name" ,"html"), team_buf.numb );
1359
                print( "%-*s ",     MAX_TM_NAME, team_buf.name );
1406
                print( "%-*s ",     MAX_TM_NAME, team_buf.name );
1360
                print( "</A>" );
1407
                    if ( report_html ) print( "</A>" );
1361
 
1408
 
-
 
1409
                print( "  Number: ");
1362
                print( "  Number: <A HREF=\"%s#Team_%04d\">", p_filename(filebase, "finish" ,"html"), team_buf.numb );
1410
                if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">", p_filename(filebase, "finish" ,"html"), team_buf.numb );
1363
                print( "%4d",       team_buf.numb );
1411
                print( "%4d",       team_buf.numb );
1364
                print( "</A>" );
1412
                if ( report_html ) print( "</A>" );
1365
 
1413
 
1366
 
1414
 
1367
                for( k = 0; k < MAX_MEMB; k++ )
1415
                for( k = 0; k < MAX_MEMB; k++ )
1368
                {
1416
                {
1369
 
1417
 
Line 1402... Line 1450...
1402
 
1450
 
1403
    /*
1451
    /*
1404
    **  Generate the Hall of Fame information
1452
    **  Generate the Hall of Fame information
1405
    */
1453
    */
1406
    print( "\n");
1454
    print( "\n");
-
 
1455
    if ( report_html )
-
 
1456
    {
1407
    print( "<hr>" );
1457
        print( "<hr>" );
1408
    print( "<A name=\"%s\"></A>","Hall Of Fame");
1458
        print( "<A name=\"%s\"></A>","Hall Of Fame");
-
 
1459
    }
1409
    print( "%s",  "Hall of Fame" );
1460
    print( "%s",  "Hall of Fame" );
1410
 
1461
 
1411
    if ( config.num_fame  )
1462
    if ( config.num_fame  )
1412
    {
1463
    {
1413
        for( i = 1; i <= config.num_fame; i++ )
1464
        for( i = 1; i <= config.num_fame; i++ )
1414
        {
1465
        {
-
 
1466
            print( "\n");
1415
            print( "\n    %-*s", MAX_PERSON_NAME, config.hall_fame[i-1] );
1467
            print( "    %-*s", MAX_PERSON_NAME, config.hall_fame[i-1] );
1416
        }
1468
        }
1417
    }
1469
    }
1418
    else
1470
    else
1419
    {
1471
    {
1420
        printf( "\n    There are no new stars for the Hall of Fame");
1472
        printf( "\n    There are no new stars for the Hall of Fame");
1421
    }
1473
    }
1422
    print( "<p><A HREF=\"#%s\">Awards Index</A>","INDEX");
1474
    if ( report_html ) print( "<p><A HREF=\"#%s\">Awards Index</A>","INDEX");
1423
 
1475
 
1424
    /*
1476
    /*
1425
    **  Generate the FASTEST information
1477
    **  Generate the FASTEST information
1426
    */
1478
    */
-
 
1479
    print( "\n" );
-
 
1480
    if ( report_html )
-
 
1481
    {
1427
    print( "<hr>" );
1482
        print( "<hr>" );
1428
    print( "<A name=\"%s\"></A>","FASTEST");
1483
        print( "<A name=\"%s\"></A>","FASTEST");
-
 
1484
    }
-
 
1485
    else
-
 
1486
    {
-
 
1487
        print( "\n" );
-
 
1488
    }
1429
    print( "%s",  "FASTEST" );
1489
    print( "%s",  "FASTEST" );
1430
 
1490
 
1431
    /*
1491
    /*
1432
    **  Sort the data and then generate the stats - again
1492
    **  Sort the data and then generate the stats - again
1433
    */
1493
    */
Line 1438... Line 1498...
1438
    {
1498
    {
1439
        g_record( stats.fast.team[i][0], &team_buf );
1499
        g_record( stats.fast.team[i][0], &team_buf );
1440
 
1500
 
1441
        print( "\n");
1501
        print( "\n");
1442
        print( "    %-13s ", config.leg_name[i - 1] );
1502
        print( "    %-13s ", config.leg_name[i - 1] );
-
 
1503
        print( "  Name: ");
1443
        print( "  Name: <A HREF=\"%s#Team_%04d\">", p_filename(filebase, "name" ,"html"), team_buf.numb );
1504
        if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">", p_filename(filebase, "name" ,"html"), team_buf.numb );
1444
        print( "%-*s", MAX_PERSON_NAME, team_buf.members[i-1].name );
1505
        print( "%-*s", MAX_PERSON_NAME, team_buf.members[i-1].name );
-
 
1506
        if ( report_html ) print( "</A>" );
1445
        print( "</A>" );
1507
        print( "  Team :");
1446
        print( "  Team :<A HREF=\"%s#Team_%04d\">", p_filename(filebase, "finish" ,"html"), team_buf.numb );
1508
        if ( report_html ) print( "<A HREF=\"%s#Team_%04d\">", p_filename(filebase, "finish" ,"html"), team_buf.numb );
1447
        print( "%4d" , stats.fast.team[i][0] );
1509
        print( "%4d" , stats.fast.team[i][0] );
1448
        print( "</A> " );
1510
        if ( report_html ) print( "</A> " );
1449
        print( "Time:%s ", time_a( stats.fast.time[i][0] ) );
1511
        print( "Time:%s ", time_a( stats.fast.time[i][0] ) );
1450
 
1512
 
1451
    }
1513
    }
1452
 
1514
 
1453
 
-
 
1454
 
-
 
1455
 
-
 
1456
    print( "<p><A HREF=\"#%s\">Awards Index</A>","INDEX");
1515
    if ( report_html ) print( "<p><A HREF=\"#%s\">Awards Index</A>","INDEX");
-
 
1516
    print( "\n");
1457
    close_printer();
1517
    close_printer();
1458
}
1518
}
1459
 
1519
 
1460
/*========================================================================
1520
/*========================================================================
1461
 *
1521
 *
Line 1714... Line 1774...
1714
    print_legend(last_class, 1);
1774
    print_legend(last_class, 1);
1715
    close_printer();
1775
    close_printer();
1716
 
1776
 
1717
}
1777
}
1718
 
1778
 
-
 
1779
/*----------------------------------------------------------------------------
-
 
1780
** FUNCTION           : pri_csv_data
-
 
1781
**
-
 
1782
** DESCRIPTION        : Generate a CSV file of all the report data
-
 
1783
**                      It can then be used to play with the data externally
-
 
1784
**
-
 
1785
**
-
 
1786
** INPUTS             : None
-
 
1787
**
-
 
1788
** RETURNS            : Yes it does
-
 
1789
**
-
 
1790
----------------------------------------------------------------------------*/
-
 
1791
 
-
 
1792
 
-
 
1793
void pri_csv_data ( void )
-
 
1794
{
-
 
1795
    int i;
-
 
1796
    int j;
-
 
1797
    int age_sum;
-
 
1798
 
-
 
1799
    /*
-
 
1800
    **  Sort on every thing
-
 
1801
    **  Then generate all the stats too
-
 
1802
    */
-
 
1803
    printf( "\nSorting the data\n" );
-
 
1804
    do_big_sort();
-
 
1805
    gen_stats();
-
 
1806
 
-
 
1807
    /*
-
 
1808
     * Now print the data on the printer 
-
 
1809
     */
-
 
1810
 
-
 
1811
    if( !open_printer( "full_data", "csv", 2000, FALSE, NULL ) )
-
 
1812
        return;
-
 
1813
 
-
 
1814
    printf( "\nGenerating the printed output\n" );
-
 
1815
 
-
 
1816
    /*
-
 
1817
    **  Print headings
-
 
1818
    */
-
 
1819
    csv_print( "%s",   "Team Number" );
-
 
1820
    csv_print( "%s",   "Team Name" );
-
 
1821
 
-
 
1822
    csv_print( "%s",    "Class Full");
-
 
1823
    csv_print( "%s",    "Class Abr");
-
 
1824
    csv_print( "%s",    "Class Start Time");
-
 
1825
    csv_print( "%s",    "Class Start Time Number");
-
 
1826
 
-
 
1827
    csv_print( "%s",    "Team Country");
-
 
1828
 
-
 
1829
    for( j = 1; j <= config.num_legs; j++ )
-
 
1830
    {
-
 
1831
        csv_print( "%s", "Leg Number" );
-
 
1832
        csv_print( "%s", "Leg Name");
-
 
1833
        csv_print( "%s", "Competitor Name");
-
 
1834
        csv_print( "%s", "Sex" );
-
 
1835
        csv_print( "%s", "Age");
-
 
1836
        csv_print( "%s", "Start Time");
-
 
1837
        csv_print( "%s", "Start Time Number");
-
 
1838
        csv_print( "%s", "End Time" );
-
 
1839
        csv_print( "%s", "End Time Number" );
-
 
1840
        csv_print( "%s", "Elapsed Time");
-
 
1841
        csv_print( "%s", "Elapsed Time Number");
-
 
1842
        csv_print( "%s", "Leg Place");
-
 
1843
        csv_print( "%s", "Leg End Place");
-
 
1844
        csv_print( "%s", "Leg Class Place");
-
 
1845
        csv_print( "%s", "Leg End Class Place");
-
 
1846
        csv_print( "%s", "Manual");
-
 
1847
    }
-
 
1848
 
-
 
1849
    j = 0;
-
 
1850
    csv_print( "%s", "Team Start Time");
-
 
1851
    csv_print( "%s", "Team Start Time Number");
-
 
1852
    csv_print( "%s", "Team End Time");
-
 
1853
    csv_print( "%s", "Team End Time Number");
-
 
1854
    csv_print( "%s", "Team Elapsed Time");
-
 
1855
    csv_print( "%s", "Team Elapsed Time Number");
-
 
1856
//            csv_print( "%s", team_buf.leg[j].l_place );
-
 
1857
    csv_print( "%s", "Team Leg End Place");
-
 
1858
//            csv_print( "%s", team_buf.leg[j].lc_place );
-
 
1859
    csv_print( "%s", "Team Leg Class Place");
-
 
1860
//            csv_print( "%s", team_buf.leg[j].manual );
-
 
1861
            
-
 
1862
    csv_print( "%s", "Total Team Age");
-
 
1863
    csv_print( "%s", "Flag:valid Team");
-
 
1864
    csv_print( "%s", "Flag:bad_times" );
-
 
1865
    csv_print( "%s", "Flag:disqualified" );
-
 
1866
    csv_print( "%s", "Flag:non_equestrian" );
-
 
1867
    csv_print("\n");
-
 
1868
 
-
 
1869
 
-
 
1870
    for( i = config.min_team; i <= config.max_team; i++ )
-
 
1871
    {
-
 
1872
        if( valid_field( i ) && g_record( i, &team_buf ) )
-
 
1873
        {
-
 
1874
            /*
-
 
1875
            **  Basic information
-
 
1876
            **      - Team number - with Xref back to full result
-
 
1877
            **      - Full team name
-
 
1878
            **      - Full categoray name - with Xref to category results
-
 
1879
            **      - Country name
-
 
1880
            */
-
 
1881
            csv_print( "%d",   team_buf.numb );
-
 
1882
            csv_print( "%s",   team_buf.name );
-
 
1883
 
-
 
1884
            csv_print( "%s",    team_buf.class == 0 ? "" : config.team_class[team_buf.class - 1].full_name );
-
 
1885
            csv_print( "%s",    team_buf.class == 0 ? "" : config.team_class[team_buf.class - 1].abr );
-
 
1886
            csv_print( "%s",    time_a (team_buf.class == 0 ? 0 : config.team_class[team_buf.class - 1].start ));
-
 
1887
            csv_print( "%d",    team_buf.class == 0 ? 0 : config.team_class[team_buf.class - 1].start );
-
 
1888
 
-
 
1889
            csv_print( "%s",    config.num_countries == 0
-
 
1890
                                || team_buf.country ==
-
 
1891
                                0 ? "" : config.country_name[team_buf.country - 1].full_name );
-
 
1892
 
-
 
1893
            age_sum = 0;
-
 
1894
            for( j = 1; j <= config.num_legs; j++ )
-
 
1895
            {
-
 
1896
                csv_print( "%d", j );
-
 
1897
                csv_print( "%s", config.leg_name[j - 1] );
-
 
1898
                csv_print( "%s", team_buf.members[j-1].name );
-
 
1899
                csv_print( "%s", ( team_buf.members[j-1].sex == male ) ? "Male" : "Female" );
-
 
1900
                csv_print( "%d", team_buf.members[j-1].age );
-
 
1901
                if ( age_sum >= 0 )
-
 
1902
                {
-
 
1903
                    ushort age = team_buf.members[j-1].age;
-
 
1904
                    if ( age > 0 && age < 255 )
-
 
1905
                    {
-
 
1906
                        age_sum += age;
-
 
1907
                    }
-
 
1908
                    else
-
 
1909
                    {
-
 
1910
                        age_sum = -1;
-
 
1911
                    }
-
 
1912
                }
-
 
1913
 
-
 
1914
 
-
 
1915
                csv_print( "%s", time_a(team_buf.leg[j].start ));
-
 
1916
                csv_print( "%d", team_buf.leg[j].start );
-
 
1917
                csv_print( "%s", time_a(team_buf.leg[j].end ));
-
 
1918
                csv_print( "%d", team_buf.leg[j].end );
-
 
1919
                csv_print( "%s", time_a(team_buf.leg[j].elapsed ));
-
 
1920
                csv_print( "%d", team_buf.leg[j].elapsed );
-
 
1921
                csv_print( "%d", team_buf.leg[j].l_place );
-
 
1922
                csv_print( "%d", team_buf.leg[j].le_place );
-
 
1923
                csv_print( "%d", team_buf.leg[j].lc_place );
-
 
1924
                csv_print( "%d", team_buf.leg[j].lec_place );
-
 
1925
                csv_print( "%d", team_buf.leg[j].manual );
-
 
1926
            }
-
 
1927
 
-
 
1928
            j = 0;
-
 
1929
            csv_print( "%s", time_a(team_buf.leg[j].start ));
-
 
1930
            csv_print( "%d", team_buf.leg[j].start );
-
 
1931
            csv_print( "%s", time_a(team_buf.leg[j].end ));
-
 
1932
            csv_print( "%d", team_buf.leg[j].end );
-
 
1933
            csv_print( "%s", time_a(team_buf.leg[j].elapsed ));
-
 
1934
            csv_print( "%d", team_buf.leg[j].elapsed );
-
 
1935
//            csv_print( "%d", team_buf.leg[j].l_place );
-
 
1936
            csv_print( "%d", team_buf.leg[j].le_place );
-
 
1937
//            csv_print( "%d", team_buf.leg[j].lc_place );
-
 
1938
            csv_print( "%d", team_buf.leg[j].lec_place );
-
 
1939
//            csv_print( "%d", team_buf.leg[j].manual );
-
 
1940
            
-
 
1941
            csv_print( "%d", age_sum );
-
 
1942
            csv_print( "%d", team_buf.flags.valid );
-
 
1943
            csv_print( "%d", team_buf.flags.bad_times );
-
 
1944
            csv_print( "%d", team_buf.flags.disqualified );
-
 
1945
            csv_print( "%d", team_buf.flags.non_equestrian );
-
 
1946
 
-
 
1947
//How about class placings
-
 
1948
 
-
 
1949
 
-
 
1950
            csv_print( "\n" );
-
 
1951
        }
-
 
1952
    }
-
 
1953
 
-
 
1954
    close_printer();
-
 
1955
}
-
 
1956
 
-
 
1957
 
1719
/*========================================================================
1958
/*========================================================================
1720
 *
1959
 *
1721
 *  Print all reports at once
1960
 *  Print all reports at once
1722
 ^  Its all so fast, these days ...
1961
 *  Its all so fast, these days ...
1723
 *
1962
 *
1724
 *  Purpose:
1963
 *  Purpose:
1725
 *      This function is called to print all reports at once
1964
 *      This function is called to print all reports at once
1726
 *
1965
 *
1727
 *  Parameters:
1966
 *  Parameters:
Line 1752... Line 1991...
1752
        report_html = FALSE;
1991
        report_html = FALSE;
1753
    }
1992
    }
1754
 
1993
 
1755
    pri_final();
1994
    pri_final();
1756
    pri_final_html();
1995
    pri_final_html();
-
 
1996
    pri_csv_data();
1757
    pri_summary();
1997
    pri_summary();
-
 
1998
    pri_awards_html();
1758
    pri_awards();
1999
    pri_awards();
1759
    pri_master_index();
2000
    pri_master_index();
1760
   
2001
   
1761
    report_all = FALSE;
2002
    report_all = FALSE;
1762
}
2003
}
Line 2007... Line 2248...
2007
    if ( full )
2248
    if ( full )
2008
    {
2249
    {
2009
        print( "\nPlace numbers (LP and EP)\n" );
2250
        print( "\nPlace numbers (LP and EP)\n" );
2010
        print( "LP - Placing based on elapsed time within the leg.                Cat Plce - Placing within the category.\n" );
2251
        print( "LP - Placing based on elapsed time within the leg.                Cat Plce - Placing within the category.\n" );
2011
        print( "EP - Placing based on accumulated times to the end of that leg.   Fin Plce - Overall placing within the event.\n" );
2252
        print( "EP - Placing based on accumulated times to the end of that leg.   Fin Plce - Overall placing within the event.\n" );
-
 
2253
        print( "U  - Placing not available.\n" );
2012
    }
2254
    }
2013
 
2255
 
2014
    /*
2256
    /*
2015
     *  Insert the contents of the config.addendum file
2257
     *  Insert the contents of the config.addendum file
2016
     *  or a defualt message
2258
     *  or a defualt message
Line 2110... Line 2352...
2110
 
2352
 
2111
}
2353
}
2112
 
2354
 
2113
/*========================================================================
2355
/*========================================================================
2114
 *
2356
 *
-
 
2357
 *  Return place data
-
 
2358
 *
-
 
2359
 *  Purpose:
-
 
2360
 *      This function is called to Return place data
-
 
2361
 *
-
 
2362
 *      This routine is called to fill a print team_buffer - to allow for
-
 
2363
 *      multiple calls to this function ( before the data is used ) a number
-
 
2364
 *      of static team_buffers are maintained
-
 
2365
 *
-
 
2366
 *  Parameters:
-
 
2367
 *      num         place - if not bad_times
-
 
2368
 *      disq        Disqualified flag
-
 
2369
 *      ne          Non Equestrian Flag
-
 
2370
 *
-
 
2371
 *  Returns:
-
 
2372
 *      This function returns a pointer to the character string for the
-
 
2373
 *      number or a pointer to a bad_times string.
-
 
2374
 *
-
 
2375
 *========================================================================*/
-
 
2376
 
-
 
2377
char *pr_place_ne( int num, int disq, int ne )
-
 
2378
{
-
 
2379
    static char store[2][5];                     /* 2 stores for 4 digit numbers */
-
 
2380
    static int  i = 0;                           /* Current index into store */
-
 
2381
    static char *dis = "U";
-
 
2382
 
-
 
2383
    if( disq && ! ne )
-
 
2384
         return ( dis );
-
 
2385
 
-
 
2386
    if( ++i >= 2 )
-
 
2387
        i = 0;                                   /* Select next entry */
-
 
2388
    sprintf( store[i], "%4d", num );
-
 
2389
    return ( store[i] );
-
 
2390
 
-
 
2391
}
-
 
2392
 
-
 
2393
/*========================================================================
-
 
2394
 *
2115
 *  Check data for bad times
2395
 *  Check data for bad times
2116
 *
2396
 *
2117
 *  Purpose:
2397
 *  Purpose:
2118
 *      This function is called to Check data for bad times
2398
 *      This function is called to Check data for bad times
2119
 *      Scan the sort data structure and locate entries that have incorrect
2399
 *      Scan the sort data structure and locate entries that have incorrect
Line 2155... Line 2435...
2155
        if( mode == C_ELAPSED )
2435
        if( mode == C_ELAPSED )
2156
            t = ptr->lege;
2436
            t = ptr->lege;
2157
        else
2437
        else
2158
            t = ptr->leg;
2438
            t = ptr->leg;
2159
 
2439
 
-
 
2440
 
-
 
2441
        if ( leg >= 0 )
-
 
2442
        {
-
 
2443
            ptr->flags.bad_times = (ptr->flags.disqualified && ! ptr->flags.non_equestrian);
-
 
2444
        }
-
 
2445
        else
-
 
2446
        {
2160
        if( ( ptr->flags.bad_times = ptr->flags.disqualified ) == FALSE )
2447
            ptr->flags.bad_times = ptr->flags.disqualified;
-
 
2448
        }
-
 
2449
 
-
 
2450
        if( ! ptr->flags.bad_times )
2161
        {
2451
        {
2162
            if( leg <= 0 )
2452
            if( leg <= 0 )
2163
            {
2453
            {
2164
                for( k = 0; k <= config.num_legs; k++ )
2454
                for( k = 0; k <= config.num_legs; k++ )
2165
                {
2455
                {
Line 2495... Line 2785...
2495
 
2785
 
2496
    for( i = 0; i <= config.num_legs; i++ )
2786
    for( i = 0; i <= config.num_legs; i++ )
2497
    {
2787
    {
2498
        /*
2788
        /*
2499
        **  Sort on leg elapsed time
2789
        **  Sort on leg elapsed time
2500
        **  The save the teams elapsed place in each leg
2790
        **  Then save the teams elapsed place in each leg
2501
        */
2791
        */
2502
        sort_team_data( i, S_L );
2792
        sort_team_data( i, S_L );
2503
        for( j = 1, ptr = sort_data; j <= sort_num; j++, ptr++ )
2793
        for( j = 1, k = 1, ptr = sort_data; j <= sort_num; ptr++, j++ )
2504
        {
2794
        {
-
 
2795
            if ( ptr->class == config.nonequestrian_class )
-
 
2796
                continue;
-
 
2797
            
2505
            sort_aux[ptr->team].l_place[i] = j;
2798
            sort_aux[ptr->team].l_place[i] = k++;
2506
            sort_aux[ptr->team].team = ptr->team;
2799
            sort_aux[ptr->team].team = ptr->team;
2507
        }
2800
        }
2508
 
2801
 
2509
        /*
2802
        /*
2510
        **  Sort on leg end time
2803
        **  Sort on leg end time
2511
        **  Then save the teams place at the end of each leg
2804
        **  Then save the teams place at the end of each leg
2512
        */
2805
        */
2513
        sort_team_data( i, S_LE );
2806
        sort_team_data( i, S_LE );
2514
        for( j = 1, ptr = sort_data; j <= sort_num; j++, ptr++ )
2807
        for( j = 1, k = 1, ptr = sort_data; j <= sort_num; ptr++, j++ )
-
 
2808
        {
-
 
2809
            if ( ptr->class == config.nonequestrian_class )
-
 
2810
                continue;
-
 
2811
            
2515
            sort_aux[ptr->team].le_place[i] = j;
2812
            sort_aux[ptr->team].le_place[i] = k++;
-
 
2813
        }
2516
 
2814
 
2517
        /*
2815
        /*
2518
        **  Sort on elapsed time per class
2816
        **  Sort on elapsed time per class
2519
        **  The save the teams elapsed place in each leg per class
2817
        **  The save the teams elapsed place in each leg per class
2520
        */
2818
        */
Line 2657... Line 2955...
2657
    */
2955
    */
2658
    if( sort_mode == S_LEC || sort_mode == S_LC )   /* Sort within a class */
2956
    if( sort_mode == S_LEC || sort_mode == S_LC )   /* Sort within a class */
2659
        if( a->class != b->class )
2957
        if( a->class != b->class )
2660
            return ( a->class - b->class );
2958
            return ( a->class - b->class );
2661
 
2959
 
-
 
2960
#if 1
-
 
2961
    /*
-
 
2962
    **  Always put the nonequestrian_class at the end
-
 
2963
    **  Simplifies the creation of ordered lists as these
-
 
2964
    **  Entries are not present in the main body
-
 
2965
    */
-
 
2966
    if ( a->class == config.nonequestrian_class ||  b->class == config.nonequestrian_class )
-
 
2967
    {
-
 
2968
        if ( a->class == config.nonequestrian_class &&  b->class == config.nonequestrian_class )
-
 
2969
        {
-
 
2970
        }
-
 
2971
        else
-
 
2972
        {
-
 
2973
            return ( a->class == config.nonequestrian_class ? 1 : -1 );
-
 
2974
        }
-
 
2975
 
-
 
2976
    }
-
 
2977
#endif
-
 
2978
 
2662
    /*
2979
    /*
2663
    **  Now we need to examine the times as we have sorted
2980
    **  Now we need to examine the times as we have sorted
2664
    **  on every thing else.
2981
    **  on every thing else.
2665
    **
2982
    **
2666
    **  If one of the teams has bad_times, then that team is placed
2983
    **  If one of the teams has bad_times, then that team is placed
2667
    **  lower in the sorting order. If both teams have bad times
2984
    **  lower in the sorting order. If both teams have bad times
2668
    **  then sort on team number. ie: Unplaced teams are sorted on
2985
    **  then sort on team number. ie: Unplaced teams are sorted on
2669
    **  team number
2986
    **  team number
-
 
2987
    **
-
 
2988
    **  If not sorting within a class (ie Overall), then Non_Equestrian
-
 
2989
    **  is better than a bad time. Places NE before disqualified
-
 
2990
    **
-
 
2991
    **
-
 
2992
    **  Note: NE also have bad_times set
2670
    */
2993
    */
-
 
2994
#if 1
-
 
2995
    if( a->flags.bad_times || b->flags.bad_times )  /* Valid data has precedence */
-
 
2996
    {
-
 
2997
        if( a->flags.bad_times && b->flags.bad_times )
-
 
2998
        {
-
 
2999
            if( a->flags.non_equestrian || b->flags.non_equestrian )
-
 
3000
            {
-
 
3001
                if( a->flags.non_equestrian && b->flags.non_equestrian )
-
 
3002
                {
-
 
3003
                    /*
-
 
3004
                    **  Both are non equestrian
-
 
3005
                    **  Let the time sort operate ...
-
 
3006
                    */
-
 
3007
                    //return ( a->team - b->team );
-
 
3008
                }
-
 
3009
                else
-
 
3010
                {
-
 
3011
                    /* One is equestrian */
-
 
3012
                    /* Good times better than NE */
-
 
3013
                    return ( a->flags.non_equestrian ? -1 : 1 );
-
 
3014
                }
-
 
3015
            }
-
 
3016
            else
-
 
3017
            {
-
 
3018
                /* Neither is equestrian */
-
 
3019
                return ( a->team - b->team );
-
 
3020
            }
-
 
3021
        }
-
 
3022
        else
-
 
3023
            return ( a->flags.bad_times ? 1 : -1 );
-
 
3024
    }
-
 
3025
#else
2671
    if( a->flags.bad_times || b->flags.bad_times )  /* Valid data has precedence */
3026
    if( a->flags.bad_times || b->flags.bad_times )  /* Valid data has precedence */
2672
    {
3027
    {
2673
        if( a->flags.bad_times && b->flags.bad_times )
3028
        if( a->flags.bad_times && b->flags.bad_times )
2674
            return ( a->team - b->team );
3029
            return ( a->team - b->team );
2675
        else
3030
        else
Line 2689... Line 3044...
2689
                return ( a->team - b->team );
3044
                return ( a->team - b->team );
2690
            else
3045
            else
2691
                return ( a->flags.non_equestrian ? 1 : -1 );
3046
                return ( a->flags.non_equestrian ? 1 : -1 );
2692
        }
3047
        }
2693
    }
3048
    }
2694
 
3049
#endif
2695
 
3050
 
2696
    /*
3051
    /*
2697
    **  Before we sort on times we must determine which time to
3052
    **  Before we sort on times we must determine which time to
2698
    **  use. Finish time, Leg end times, Leg Elapsed times.
3053
    **  use. Finish time, Leg end times, Leg Elapsed times.
2699
    */
3054
    */
Line 2841... Line 3196...
2841
 
3196
 
2842
bool load_report_data(void)
3197
bool load_report_data(void)
2843
{
3198
{
2844
 
3199
 
2845
    ty_s_data  *ptr;                             /* pointer to sort data type */
3200
    ty_s_data  *ptr;                             /* pointer to sort data type */
-
 
3201
    ty_s_data  *last;
2846
    int         j;
3202
    int         j;
2847
    unsigned    num;
3203
    unsigned    num;
2848
 
3204
 
2849
    printf( "Loading team information - This will not hurt" );
3205
    printf( "Loading team information - This will not hurt" );
2850
    flush_out();
3206
    flush_out();
Line 2897... Line 3253...
2897
        if( valid_field( team ) )
3253
        if( valid_field( team ) )
2898
        {
3254
        {
2899
            g_record( team, &team_buf );
3255
            g_record( team, &team_buf );
2900
            if( team_buf.flags.valid )
3256
            if( team_buf.flags.valid )
2901
            {
3257
            {
-
 
3258
                last = ptr;
2902
                ptr->team = team;
3259
                ptr->team = team;
2903
                for( j = 0; j < MAX_LEGS + 1; j++ )
3260
                for( j = 0; j < MAX_LEGS + 1; j++ )
2904
                {
3261
                {
2905
                    ptr->lege[j] = team_buf.leg[j].elapsed;
3262
                    ptr->lege[j] = team_buf.leg[j].elapsed;
2906
                    ptr->leg[j] = team_buf.leg[j].end;
3263
                    ptr->leg[j] = team_buf.leg[j].end;
Line 2916... Line 3273...
2916
                **  If non-equestrian support is enabled then
3273
                **  If non-equestrian support is enabled then
2917
                **  duplicate and modify data for the non-equestrian teams
3274
                **  duplicate and modify data for the non-equestrian teams
2918
                **      - Change the class
3275
                **      - Change the class
2919
                **      - Modify the leg time
3276
                **      - Modify the leg time
2920
                */
3277
                */
-
 
3278
#if 1
2921
                if ( config.nonequestrian_class && team_buf.flags.non_equestrian )
3279
                if ( config.nonequestrian_class && team_buf.flags.non_equestrian )
2922
                {
3280
                {
2923
                    ptr->team = team;
3281
                    ptr->team = team;
2924
                    ptr->lege[0] = 0;
3282
                    ptr->lege[0] = 0;
2925
 
3283
 
2926
                    for( j = 0; j < MAX_LEGS + 1; j++ )
3284
                    for( j = 0; j < MAX_LEGS + 1; j++ )
2927
                    {
3285
                    {
2928
                        if ( j == config.equestrian_leg )
3286
                        if ( j == config.equestrian_leg )
2929
                        {
3287
                        {
2930
                            ptr->lege[j] = 0;
3288
                            last->lege[j] = ptr->lege[j] = 0;
2931
                            if ( config.equestrian_leg > 1 )
3289
                            if ( config.equestrian_leg > 1 )
2932
                                ptr->leg[j] = ptr->leg[j-1];
3290
                                last->leg[j] = ptr->leg[j] = ptr->leg[j-1];
2933
                        }
3291
                        }
2934
                        else
3292
                        else
2935
                        {
3293
                        {
2936
                            if ( j )
3294
                            if ( j )
2937
                                ptr->lege[j] = team_buf.leg[j].elapsed;
3295
                                last-> lege[j] = ptr->lege[j] = team_buf.leg[j].elapsed;
2938
                            ptr->leg[j] = team_buf.leg[j].end;
3296
                            last->leg[j] = ptr->leg[j] = team_buf.leg[j].end;
2939
                            ptr->lege[0] += ptr->lege[j] ;
3297
                            ptr->lege[0] += ptr->lege[j] ;
-
 
3298
                            last->lege[0] = ptr->lege[0] ;
2940
                        }
3299
                        }
2941
                    }
3300
                    }
2942
 
3301
 
2943
                    ptr->start = team_buf.leg[0].start;
3302
                    last->start = ptr->start = team_buf.leg[0].start;
2944
                    ptr->class = config.nonequestrian_class;
3303
                    ptr->class = config.nonequestrian_class;
2945
                    ptr->flags = team_buf.flags;
3304
                    ptr->flags = team_buf.flags;
2946
                    ptr->flags.disqualified = 0;
3305
                    ptr->flags.disqualified = 0;
-
 
3306
 
-
 
3307
 
2947
                    ptr++;
3308
                    ptr++;
2948
                    sort_num++;
3309
                    sort_num++;
2949
                }
3310
                }
-
 
3311
#endif
2950
            }
3312
            }
2951
        }
3313
        }
2952
    }
3314
    }
2953
    return ( TRUE );
3315
    return ( TRUE );
2954
}
3316
}