Subversion Repositories svn1

Rev

Rev 176 | Rev 213 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
171 david 1
/*************************************************************************
2
*           Copyright (C) 1992 Embedded Solutions.
3
*                       All rights reserved
4
*
5
* file:         mara.c
6
*
7
* purpose:      Main entry point
8
*               Marathon program  program
9
*
10
* functions:
11
*       main                    - Main entry point
12
*       usage                   - Display general usage message
13
*       ms_system               - Temp escape to DOS
14
*       test_legal_version      - Test program version
15
*
16
*
17
* programmer: David Purdie (DDP)
18
*
19
* revision  date        by      reason
20
*           13-May-91   DDP     Added a nasty.
21
*                               This program will produce funny results if
22
*                               the system date is after 1-Jan-92.
23
*
24
*           25-Oct-91   DDP     Version 2.01 will not produce funny results
25
*
26
*   00.0    6-Nov-92    DDP     Ansified existing code
27
*   00.0    27/01/95    DDP     Tidies up the program and formatted the file
28
*
29
**************************************************************************/
30
#include    <QtGui/QApplication>
31
 
32
#include    <time.h>
33
#include    "consts.h"
34
#include    "structs.h"
35
#include    "proto.h"
36
 
37
#include    "qmconfteams.h"
38
#include    "mainwindow.h"
173 - 39
#include    "qmconfig.h"
177 - 40
#include    "qmteamdata.h"
171 david 41
 
42
#undef      DISPLAY_STRUCTURES
43
 
44
/*============================================================================
45
 *  Main entry point
46
 *
47
 *  Purpose:
48
 *      Main enrty point
49
 *      Load configuration file
50
 *      Locate data base
51
 *      Perform copyright stuff
52
 *      Process top level menu
53
 *
54
 *  Parameters:
55
 *      argc    - number of arguments
56
 *      argv    - pointer to first argument pointer
57
 *      
58
 *      
59
 *  Returns:
60
 *      program exit code
61
 *          0 - All is well
62
 *          1 -
63
 *          2 - 
64
 *
65
 *===========================================================================*/
66
 
67
int main( int argc, char *argv[] )
68
{
175 - 69
    QString       eventFile;
171 david 70
    QApplication a(argc, argv);
71
 
72
    /*
73
    **  Verify command arguments
74
    */
75
    if( argc < 2 )
76
        usage();
77
 
78
    /*
79
    **  Walk the user arguments and extract switches and file names
80
    */
81
    while( --argc )
82
    {
83
        argv++;
84
        if( argv[0][0] == '-' )
85
        {
86
            switch( argv[0][1] )
87
            {
88
                /*
89
                **  Unknown switch
90
                */
91
              default:
92
                usage();
93
            }
94
        }
95
        else
96
        {
97
            /*
98
            **  Parameter without a switch
99
            **  Must be the input file name
100
            */
175 - 101
            if( !eventFile.isEmpty() )                   /* Already defined */
171 david 102
            {
103
                qWarning("Mutiple input files found");
104
            }
175 - 105
            eventFile = argv[0];
171 david 106
        }
107
    }
108
 
176 - 109
    config.load(eventFile);
177 - 110
    QmTeamData  teamDataReader;
111
    teamDataReader.initTeamData(NULL);
173 - 112
 
171 david 113
    MainWindow w;
114
    w.show();
115
 
116
    MainWindow::showMessage ("Mara Started", 5000);
117
    return a.exec();
118
  }
119
 
120
/*============================================================================
121
 *
122
 *  Display general usage message
123
 *
124
 *  Purpose:
125
 *      Display general usage message
126
 *      Used on command line syntax error
127
 *      
128
 *  Parameters:
129
 *      None
130
 *      
131
 *  Returns:
132
 *      exit code 3
133
 *      
134
 *===========================================================================*/
135
 
136
void usage(void)
137
{
177 - 138
    qDebug( "Usage : mara [options] [configuration_file]\n" );
171 david 139
    qDebug( "\n" );
140
    qDebug( "Options are:\n" );
177 - 141
    qDebug( "   No Options\n" );
171 david 142
    exit( 3 );
143
}
144
 
145
 
146
 
147
/********************************* EOF ***********************************/
148