3 XCSoar Glide Computer - http://www.xcsoar.org/
4 Copyright (C) 2000-2013 The XCSoar Project
5 A detailed list of copyright holders can be found in the file "AUTHORS".
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2
10 of the License, or (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 /* This creates the VALI-XCS.exe program
24 * This is a DOS program that is used by the OLC or a scorer in a contest
25 * to validate the GRecord of an XCSoar-generated IGC file
28 #include "OS/ConvertPathName.hpp"
29 #include "Logger/GRecord.hpp"
30 #include "Version.hpp"
43 eValidationFileNotFound
,
47 static const char szPass
[] = "Validation check passed, data indicated as correct";
48 static const char szFail
[] = "Validation check failed. G Record is invalid";
49 static const char szNoFile
[] = "Validation check failed. File not found";
50 static const char szInfo
[] = "Vali XCS for the XCSoar Flight Computer Version 1.0.2";
53 ValidateXCS(const TCHAR
*FileName
, GRecord
&oGRecord
)
55 STATUS_t eStatus
= eValidationFileNotFound
;
58 inFile
= _tfopen(FileName
, _T("r"));
64 eStatus
= eValidationFailed
;
66 oGRecord
.Initialize();
67 if (oGRecord
.VerifyGRecordInFile(FileName
))
68 eStatus
= eValidationPassed
;
74 RunValidate(const TCHAR
*path
)
77 STATUS_t eStatus
= ValidateXCS(path
, oGRecord
);
79 case eValidationFailed
:
83 case eValidationPassed
:
87 case eValidationFileNotFound
:
97 int main(int argc
, char* argv
[])
99 printf("Vali XCS for the XCSoar Flight Computer Version "
107 if (argc
> 1 && strcmp(argv
[1], "-?") != 0) {
108 PathName
path(argv
[1]);
109 return RunValidate(path
);