Subversion Repositories svn1-original

Rev

Go to most recent revision | Details | 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:     src\teamupd.c
6
*
7
* purpose:  Team data edit and display
8
*           This module contains all the functions required to define and
9
*           alter the team definitions
10
*
11
* functions
12
*       team_update             - Update team data on the screen
13
*       team_display            - Display team data on the screen
14
*       leg_mods                - Modify team leg times
15
*       d_display               - Display all team information
16
*       d_leg                   - Display / Update leg time information
17
*       d_field                 - Display / Update field on the screen
18
*       g_tnum                  - Get a team number from the operator
19
*       g_record                - Read a team record from disk
20
*       clr_team                - Clear team data from file
21
*       put_team_record         - Save team record to disk
22
*       init_team_data          - Initialize the team data file
23
*       fix_team_data           - Close team data file
24
*
25
* programmer: David Purdie
26
*
27
* revision  date        by      reason
28
*   00.0    27/01/95    DDP     Tidies up the program and formatted the file
29
*
30
**************************************************************************/
31
 
32
#ifndef HI_TECH_C
33
#include    <fcntl.h>
34
/*#include  <memory.h> */
35
#endif
36
 
37
#include    "consts.h"
38
#include    "structs.h"
39
#include    "proto.h"
40
int         team;                                /* Current team number */
41
team_type   team_buf;                            /* Holds team data currently under display */
42
int         team_fd;                             /* Team data file descriptor */
43
int         leg = 0;                             /* Leg under investigation */
44
 
45
/*========================================================================
46
 *
47
 *  Update team data on the screen
48
 *
49
 *  Purpose:
50
 *      This function is called to update team data on the screen
51
 *      This function will prompt the operator to select a team number
52
 *      If the team is defined then the data will be displayed on the screen
53
 *
54
 *  Parameters:
55
 *      None
56
 *
57
 *  Returns:
58
 *      TRUE - Change made
59
 *
60
 *========================================================================*/
61
 
62
void team_update(void)
63
{
64
    if( !g_tnum( 0, n_lines - 2, "Enter team number" ) )
65
        return;                        /* Exit operation */
66
 
67
    /*
68
     **  Fetch the team record into memory
69
     **  If the record does not exist a record with an invalid flag
70
     **  will be returned
71
     */
72
 
73
    do
74
    {
75
        clearscreen();
76
        g_record( team, &team_buf );
77
        d_display( M_TEAM );
78
        put_team_record( team, &team_buf );
79
 
80
    } while( g_tnum( 0, n_lines - 2, "Enter next team or RETURN to exit" ) );
81
}
82
 
83
/*=======================================================================
84
 *
85
 *  Display team data on the screen
86
 *
87
 *  Purpose:
88
 *      This function is called to Display team data on the screen
89
 *      This function will prompt the operator to select a team number
90
 *      If the team is defined then the data will be displayed on the screen
91
 *
92
 *  Parameters:
93
 *      None
94
 *
95
 *  Returns:
96
 *      TRUE - Change made
97
 *
98
 *========================================================================*/
99
 
100
void team_display(void)
101
{
102
    if( !g_tnum( 0, n_lines - 2, "Enter team number" ) )
103
        return;                        /* Exit operation */
104
 
105
    /*
106
     * Fetch the team record into memory
107
     * If the record does not exist a record with an invalid flag
108
     * will be returned
109
     */
110
 
111
    do
112
    {
113
        clearscreen();
114
        if( g_record( team, &team_buf ) )
115
            d_display( M_DISPLAY );
116
        else
117
        {
118
            cur( 0, n_lines - 1 );
119
            printf( "Team %-1d has not yet been entered", team );
120
            beep();
121
        }
122
    } while( g_tnum( 0, n_lines - 2, "Enter next team or RETURN to exit" ) );
123
}
124
 
125
/*========================================================================
126
 *
127
 *  Modify team leg times
128
 *
129
 *  Purpose:
130
 *      This function is called to modify team leg times
131
 *      This function will prompt the operator to select a team number
132
 *      If the team is defined then the data will be displayed on the screen
133
 *
134
 *  Parameters:
135
 *      None
136
 *
137
 *  Returns:
138
 *      TRUE - Change made
139
 *
140
 *========================================================================*/
141
void leg_mods(void)
142
{
143
    if( !g_tnum( 0, n_lines - 2, "Enter team number" ) )
144
        return;                        /* Exit operation */
145
 
146
    /*
147
     **  Fetch the team record into memory
148
     ** If the record does not exist a record with an invalid flag
149
     ** will be returned
150
     */
151
 
152
    do
153
    {
154
        clearscreen();
155
        if( g_record( team, &team_buf ) )
156
        {
157
            set_times( &team_buf );
158
            d_display( M_LEGS );
159
            put_team_record( team, &team_buf );
160
        }
161
        else
162
        {
163
            cur( 0, n_lines - 1 );
164
            printf( "Team %-1d has not yet been entered", team );
165
            beep();
166
        }
167
    } while( g_tnum( 0, n_lines - 2, "Enter next team or RETURN to exit" ) );
168
 
169
}
170
 
171
/*========================================================================
172
 *
173
 *  Display all team information
174
 *
175
 *  Purpose:
176
 *      This function is called to display all the team information
177
 *
178
 *  Parameters:
179
 *      operation       Operation to perform
180
 *
181
 *  Returns:
182
 *      Nothing
183
 *
184
 *========================================================================*/
185
void d_display( int operation )
186
{
187
    int         valid = team_buf.flags.valid;
188
    int         opr;
189
    int         i, j;
190
 
191
    /*
192
     **  Refresh the entire display (using a recursive call)
193
     */
194
    if( operation != M_DISPLAY )
195
        d_display( M_DISPLAY );
196
 
197
 
198
    /*
199
     **  Display the team number
200
     **      This cannot be edited.
201
     */
202
    d_field( 0, 0, "Team number : ", D_NUMBER, 6, &team_buf.numb, TRUE,
203
             M_DISPLAY );
204
 
205
    /*
206
     **  Determine the type of operation required
207
     **      Update or Display
208
     */
209
    opr = ( operation & M_TEAM ) ? M_UPDATE : M_DISPLAY;
210
 
211
    /*
212
     **  Display / Update the team name
213
     */
214
    do
215
    {
216
        d_field( 20, 0, "Team name : ", D_STRING, MAX_TM_NAME, team_buf.name,
217
                 valid, opr );
218
        if( abort_flag )
219
            return;
220
    } while( ( opr == M_UPDATE ) && ( !strlen( team_buf.name ) ) );
221
 
222
    /*
223
     **  Display / Update the class
224
     */
225
    do
226
    {
227
        d_field( 0, 1, "Class : ", D_CLASS, 1, &team_buf.class, valid, opr );
228
        if( abort_flag )
229
            return;
230
    } while( ( opr == M_UPDATE ) && !team_buf.class );
231
 
232
    /*
233
     **  The record is now active
234
     **  It may not be usefull, but it has the start of a valid recird
235
     */
236
    if( opr == M_UPDATE )
237
        team_buf.flags.valid = TRUE;
238
 
239
    /*
240
     **  Display / Update the country name
241
     */
242
    d_field( 30, 1, "Country :", D_COUNTRY, 4, &team_buf.country, valid,
243
             opr );
244
    if( abort_flag )
245
        return;
246
 
247
    /*
248
     **  Display / Update the name and sex of each team member
249
     */
250
    opr = ( operation & M_TEAM ) ? M_UPDATE : M_DISPLAY;
251
    for( i = 0; i < MAX_MEMB; i++ )
252
    {
253
        d_field( 0, 3 + i, "Name : ", D_STRING, MAX_PERSON_NAME,
254
                 team_buf.members[i].name, valid, opr );
255
        if( abort_flag )
256
            return;
257
 
258
        d_field( MAX_PERSON_NAME + 10, 3 + i, "Sex : ", D_SEX, 0,
259
                 &team_buf.members[i].sex, valid, opr );
260
        if( abort_flag )
261
            return;
262
    }
263
 
264
    /*
265
     **  Display / Update the leg informarion for each configured leg
266
     */
267
    for( j = 1; j <= config.num_legs; j++, i++ )
268
    {
269
        d_leg( 4 + i, j, &team_buf.leg[j], valid, operation );
270
        if( abort_flag )
271
        {
272
            i += config.num_legs - j + 1;
273
            break;
274
        }
275
    }
276
 
277
    /*
278
     **  Display the summary information
279
     **      For the team
280
     **      Event and class placing information
281
     */
282
    d_leg( 4 + i, 0, &team_buf.leg[0], valid, M_DISPLAY );
283
 
284
    d_field( 0, 6 + i, "Event placing : ", D_NUMBER, 1,
285
             &team_buf.leg[0].le_place, valid, M_DISPLAY );
286
    d_field( 20, 6 + i, "Class placing : ", D_NUMBER, 1,
287
             &team_buf.leg[0].lec_place, valid, M_DISPLAY );
288
 
289
    if( team_buf.flags.non_equestrian )
290
        d_field( 0, 7 + i, "Non-Equestrian", D_NULL, 1, 0, valid, M_DISPLAY );
291
    else if( team_buf.flags.disqualified )
292
        d_field( 0, 7 + i, "Disqualified", D_NULL, 1, 0, valid, M_DISPLAY );
293
 
294
}
295
 
296
/*========================================================================
297
 *
298
 *  Display / Update leg time information
299
 *
300
 *  Purpose:
301
 *      This function is called to display and update the leg
302
 *      time information.
303
 *
304
 *  Parameters:
305
 *      y           Screen position
306
 *      leg         Leg to process
307
 *      data        Leg data
308
 *      valid       Data valid flag
309
 *      operation   Operation to perform
310
 *
311
 *  Returns:
312
 *      Nothing
313
 *
314
 *========================================================================*/
315
void d_leg( int y, int leg, leg_type * data, int valid, int operation )
316
{
317
    int         i;
318
    int         oprs, oprf;
319
 
320
    /*
321
     **  Display the field header
322
     */
323
    if( operation == M_DISPLAY )
324
    {
325
        if( leg != 0 )
326
        {
327
            d_field( 0, y, "Leg ", D_NUMBER, 1, &leg, TRUE, M_DISPLAY );
328
            d_field( 7, y, "", D_STRING, MAX_LEG_NAME,
329
                     config.leg_name[leg - 1], TRUE, M_DISPLAY );
330
        }
331
        else
332
            d_field( 0, y, "Overall team times", D_STRING, 0, "", TRUE,
333
                     M_DISPLAY );
334
    }
335
 
336
    /*
337
     **  If we are doing an update,. then ensure that all the team times
338
     **  have been tested
339
     */
340
 
341
    if( operation & M_ALL )
342
        test_times( &team_buf, 0 );              /* Set up all team times */
343
 
344
    oprs = ( ( parallel_legs )
345
             || ( operation & M_ALEGS )
346
             || ( operation & M_LEGS ) ) ? M_UPDATE : M_DISPLAY;
347
 
348
    oprf = ( operation & M_LEGS ) ? M_UPDATE : M_DISPLAY;
349
 
350
    /*
351
     **  if start time edited then flag as manual entry
352
     **  redo calculations and refresh screen with new information
353
     */
354
 
355
    if( d_field
356
        ( 25, y, data->manual ? "MS " : " S ", D_TIME, 8, &data->start, valid,
357
          oprs ) )
358
    {
359
        data->manual = TRUE;
360
        test_times( &team_buf, 0 );
361
        for( i = leg; i <= config.num_legs; i++ )
362
            d_leg( y + i - leg, i, &team_buf.leg[i], valid, M_DISPLAY );
363
        d_leg( y + i - leg, 0, &team_buf.leg[0], valid, M_DISPLAY );
364
    }
365
 
366
    /*
367
     **  If time changed then redo calcs and refresh screen
368
     */
369
    if( d_field( 37, y, "F ", D_TIME, 8, &data->end, valid, oprf ) )
370
    {
371
        set_times( &team_buf );
372
        test_times( &team_buf, 0 );
373
        for( i = leg; i <= config.num_legs; i++ )
374
            d_leg( y + i - leg, i, &team_buf.leg[i], valid, M_DISPLAY );
375
        d_leg( y + i - leg, 0, &team_buf.leg[0], valid, M_DISPLAY );
376
    }
377
 
378
    d_field( 48, y, "E ", D_TIME, 8, &data->elapsed, valid, M_DISPLAY );
379
    if( leg == 0 )
380
    {
381
        d_field( 60, y, "", D_STRING, 10,
382
                 ( team_buf.flags.bad_times ==
383
                   TRUE ) ? "Incomplete" : "          ", valid, M_DISPLAY );
384
    }
385
    else
386
    {
387
        d_field( 60, y, "", D_NUMBER, 4, &data->le_place, valid, M_DISPLAY );
388
        d_field( 65, y, "", D_NUMBER, 4, &data->l_place, valid, M_DISPLAY );
389
        d_field( 70, y, "", D_NUMBER, 4, &data->lec_place, valid, M_DISPLAY );
390
        d_field( 75, y, "", D_NUMBER, 4, &data->lc_place, valid, M_DISPLAY );
391
    }
392
}
393
 
394
/*========================================================================
395
 *
396
 *  Display / Update simple time information
397
 *
398
 *  Purpose:
399
 *      This function is called to display and update the leg
400
 *      time information.
401
 *
402
 *  Parameters:
403
 *      x, y        Screen position
404
 *      prompt      Prompt to display
405
 *      data        Address of time data
406
 *      valid       Data valid flag
407
 *
408
 *  Returns:
409
 *      Nothing
410
 *
411
 *========================================================================*/
412
void d_time( int x, int y, char *prompt, time_t *data, int valid )
413
{
414
        d_field( x, y, prompt, D_TIME, 8, ( char * ) data, valid, M_DISPLAY );
415
        d_field( x, y, prompt, D_TIME, 8, ( char * ) data, valid, M_UPDATE );
416
}
417
 
418
/*========================================================================
419
 *
420
 *  Display / Update field on the screen
421
 *
422
 *  Purpose:
423
 *      
424
 *      This function is called to display and update a field on the screen
425
 *      This routine will display a record from the team structure
426
 *      The type of data and other parameters is passed in
427
 *      This function is fundimental to the entire display subsystem
428
 *
429
 *
430
 *
431
 *  Parameters:
432
 *      x           The screen col
433
 *      y           The line number
434
 *      prompt      The field lable
435
 *      type        type of field
436
 *      length      Length of the numeric field
437
 *      data        Pointer to the data
438
 *      valid       data field is valid
439
 *      operation   Operation type
440
 *
441
 *  Returns:
442
 *      TRUE - Change has been made
443
 *
444
 *========================================================================*/
445
bool d_field( int x,
446
              int y,
447
              char *prompt,
448
              int type, int length, void *data, int valid, int operation )
449
{
450
    time_t      t;
451
    int         i;
452
    sex_type    s;
453
    int         change = 0;
454
    int         idata;
455
 
456
    /*
457
     **  Position the cursor and display the field title
458
     */
459
    cur( x, y );
460
    printf( "%s", prompt );
461
 
462
    /*
463
     **  If the ABORT flag is set then DISPLAY the field
464
     */
465
    if( abort_flag )
466
        operation = M_DISPLAY;
467
 
468
    /*
469
     **  Display the current field value
470
     **      Only if the data field is valid
471
     **      Only if the M_DISPLAY operation is requested
472
     */
473
    if( valid && ( operation == M_DISPLAY ) )
474
    {
475
        switch ( type )
476
        {
477
        case D_STRING:
478
        case D_USTRING:
479
            printf( "%-*.*s", length, length, (char *)data );
480
            break;
481
 
482
        case D_NUMBER:
483
            printf( "%-*d", length, *( short * ) data );
484
            break;
485
 
486
        case D_SEX:
487
            if( *( sex_type * ) data != unknown )
488
                printf( "%s",
489
                        ( *( sex_type * ) data ==
490
                          male ) ? "Male" : "Female" );
491
            break;
492
 
493
        case D_TIME:
494
            printf( "%s", time_a( *( time_t * ) data ) );
495
            break;
496
 
497
        case D_CLASS:
498
            if( *( short * ) data > 0 )
499
            {
500
                printf( "%2.2s", config.team_class[( *( int * ) data ) - 1].abr );
501
                printf( "  %-*.*s", LEN_CLASS_NAME, LEN_CLASS_NAME,
502
                        config.team_class[( *( int * ) data ) - 1].full_name );
503
            }
504
            break;
505
 
506
        case D_COUNTRY:
507
            if( *( short * ) data > 0 )
508
            {
509
                printf( "%4.4s",
510
                        config.country_name[( *( int * ) data ) - 1].abr );
511
                printf( "  %-*.*s", LEN_CNTRY_NAME, LEN_CNTRY_NAME,
512
                        config.country_name[( *( int * ) data ) -
513
                                            1].full_name );
514
            }
515
            break;
516
 
517
        case D_NULL:
518
            break;
519
 
520
        default:
521
            printf( "Unknown data type" );
522
            break;
523
        }
524
    }
525
 
526
    /*
527
     **  If updating the field then extract the required information
528
     */
529
    if( operation == M_UPDATE )
530
    {
531
        switch ( type )
532
        {
533
        case D_STRING:
534
            change = ( getstring( length, data, Alphanum ) );
535
            break;
536
 
537
        case D_USTRING:
538
            change = ( getstring( length, data, AlphnumUpper ) );
539
            break;
540
 
541
        case D_NUMBER:
542
            idata = *(short *)data;
543
            change = getnum( length, &idata );
544
            if ( change )
545
                *( short *)data = idata;
546
            break;
547
 
548
        case D_SEX:
549
            if( ( s = getsex() ) != unknown )
550
            {
551
                change = ( *( sex_type * ) data != s );
552
                *( sex_type * ) data = s;
553
            }
554
            break;
555
 
556
        case D_TIME:
557
            if( ( t = get_time(*( time_t * ) data) ) >= 0 )
558
            {
559
                change = ( *( time_t * ) data != t );
560
                *( time_t * ) data = t;
561
            }
562
            break;
563
 
564
        case D_CLASS:
565
            if( ( i = getclass() ) != 0 )
566
            {
567
                change = *( short * ) data != i;
568
                *( short * ) data = i;
569
            }
570
            break;
571
 
572
        case D_COUNTRY:
573
            if( ( i = getcountry() ) != 0 )
574
            {
575
                change = *( short * ) data != i;
576
                *( short * ) data = i;
577
            }
578
            break;
579
 
580
        case D_NULL:
581
            break;
582
 
583
        default:
584
            printf( "Unknown data type" );
585
            break;
586
        }
587
 
588
        /*
589
         **  Having accepted the input now DISPLAY the data (once again)
590
         **      Done to allow aborted field to re-display original values
591
         */
592
        d_field( x, y, prompt, type, length, data, TRUE, M_DISPLAY );
593
    }
594
    return ( change );
595
}
596
 
597
/*========================================================================
598
 *
599
 *  Get a team number from the operator
600
 *
601
 *  Purpose:
602
 *      This function is called to Get a team number from the operator
603
 *          Prompt the operator for a team number
604
 *          Verify that the team number is valid
605
 *          Allow escape characters in the process
606
 *
607
 *          This routine will return TRUE if the team number is valid
608
 *          The team number is returned in the global variable "team"
609
 *
610
 *  Parameters:
611
 *      x,y         Screen coords
612
 *      prompt      Operator prompt
613
 *
614
 *  Returns:
615
 *      TRUE    : Number OK
616
 *
617
 *========================================================================*/
618
bool g_tnum( int x, int y, char *prompt )
619
{
620
    int         new_team = 0;                   /* team number that will be input */
621
 
622
    while( TRUE )
623
    {
624
        team = 0;
625
        abort_flag = FALSE;
626
        cur( x, y );
627
        printf( "%s : ", prompt );
628
        console_clreol();
629
        if( !getnum( 6, &new_team ) )
630
            return ( FALSE );                    /* No input */
631
 
632
        /*
633
         * verify that the team number is within the allowed numbers 
634
         */
635
 
636
        if( !valid_field( new_team ) )
637
        {
638
            beep();
639
            printf( "\nTeam %-1d is not valid", new_team );
640
            continue;
641
        }
642
        team = new_team;
643
        return ( TRUE );
644
    }
645
}
646
 
647
/*========================================================================
648
 *
649
 *  Read a team record from disk
650
 *
651
 *  Purpose:
652
 *      This function is called to Read a team record from disk
653
 *      Locate the team record in the team data file
654
 *      if the record does not exist create a blank record
655
 *
656
 *      The function will return FALSE if the record was not on disk
657
 *      otherwise TRUE
658
 *
659
 *  Parameters:
660
 *      int_team        Team record required
661
 *      data            Area to return record
662
 *
663
 *  Returns:
664
 *      FALSE : No data available
665
 *
666
 *========================================================================*/
667
bool g_record( int _team, team_type * data )
668
{
669
    int         len;                             /* length of record read in */
670
    long        pos;                             /* File pointer */
671
 
672
    pos = _team;
673
    pos *= sizeof( team_type );
674
    len = lseek( team_fd, pos, 0 );
675
    len = read( team_fd, ( char * ) data, sizeof( team_type ) );
676
    if( ( len == sizeof( team_type ) ) && ( _team == data->numb ) )
677
        return ( data->flags.valid );
678
    else
679
    {
680
        clr_team( _team, data );
681
        return ( FALSE );
682
    }
683
}
684
 
685
/*========================================================================
686
 *
687
 *  Clear team data from file
688
 *
689
 *  Purpose:
690
 *      This function is called to Clear team data from file
691
 *      This routine will set the team data to INVALID
692
 *
693
 *  Parameters:
694
 *      tm          Team number
695
 *      data        Pointer to the data
696
 *
697
 *  Returns:
698
 *      Nothing
699
 *
700
 *========================================================================*/
701
void clr_team( int tm, team_type * data )
702
{
703
    int         len;
704
 
705
    memset( ( char * ) data, 0, ( int ) sizeof( team_type ) );
706
    data->flags.valid = FALSE;
707
    data->flags.bad_times = TRUE;
708
    data->numb = tm;
709
    for( len = 0; len < MAX_LEGS + 1; len++ )
710
    {
711
        data->leg[len].start = -1;
712
        data->leg[len].end = -1;
713
        data->leg[len].elapsed = -1;
714
        data->leg[len].l_place = 0;
715
        data->leg[len].le_place = 0;
716
        data->leg[len].lec_place = 0;
717
        data->leg[len].lc_place = 0;
718
        data->leg[len].manual = 0;
719
    }
720
}
721
 
722
/*========================================================================
723
 *
724
 *  Save team record to disk
725
 *
726
 *  Purpose:
727
 *      This function is called to save team record to disk
728
 *
729
 *  Parameters:
730
 *      _team       Team number
731
 *      data        Pointer to the data
732
 *
733
 *  Returns:
734
 *      FALSE : Error in save
735
 *
736
 *========================================================================*/
737
bool put_team_record( int _team, team_type * data )
738
{
739
    int         len;                             /* length of record read in */
740
    long        pos;                             /* file pointer */
741
 
742
    pos = _team;
743
    pos *= sizeof( team_type );
744
    lseek( team_fd, pos, 0 );
745
    len = write( team_fd, ( char * ) data, sizeof( team_type ) );
746
    if( len != sizeof( team_type ) )
747
    {
748
        perror( "Team record write" );
749
        sleep( 5 );
750
    }
751
    return ( len == sizeof( team_type ) );
752
}
753
 
754
/*========================================================================
755
 *
756
 *  Initialize the team data file
757
 *
758
 *  Purpose:
759
 *      This function is called to Initialize the team data file and
760
 *      prepare it for processing
761
 *
762
 *  Parameters:
763
 *      None
764
 *
765
 *  Returns:
766
 *      FALSE : Error encountered
767
 *
768
 *========================================================================*/
769
bool init_team_data(void)
770
{
771
 
772
    team_fd = open( datfile, OPEN_RW, 0 );
773
    if( team_fd < 0 )
774
    {
775
        /*
776
         * file does not exist - create it 
777
         */
778
        printf( "The team data file does not exist.\n" );
779
        if( getyes( "Create the data file" ) )
780
        {
781
            team_fd = creat( datfile, 0664 );
782
            if( team_fd > 0 )
783
            {
784
                close( team_fd );                /* Close th file */
785
                team_fd = open( datfile, OPEN_RW, 644 );
786
                if( team_fd < 0 )
787
                    perror( "Team datafile" );
788
            }
789
        }
790
    }
791
    return ( team_fd >= 0 );
792
}
793
 
794
/*========================================================================
795
 *
796
 *  Close team data file
797
 *
798
 *  Purpose:
799
 *      This function is called to close the team data file
800
 *
801
 *  Parameters:
802
 *      None
803
 *
804
 *  Returns:
805
 *      Nothing
806
 *
807
 *========================================================================*/
808
void fix_team_data(void)
809
{
810
    if( team_fd > 0 )
811
        close( team_fd );
812
}
813
 
814
/********************************* EOF ***********************************/