Incomplete parser

This commit is contained in:
2025-11-07 17:14:01 +01:00
commit b65edb40cf
7 changed files with 3486 additions and 0 deletions

65
igc.h Normal file
View File

@@ -0,0 +1,65 @@
/*
* IGC parser
* @brief parse IGC file, get all data points, compute average horizontal/vertical speed, print to STDOUT
*
* @author xamidev <xamidev@riseup.net>
* @license GNU GPL v3
*/
#ifndef IGC_H
#define IGC_H
#define NAME_MAX 256
#define TMP_SIZE 8
void parse_igc_file(FILE* fp);
enum IGC_RecordType
{
MANUFACTURER = 'A',
METADATA = 'H',
EXTENSION = 'I',
J_EXTENSION = 'J',
DECLARATION = 'C',
SATELLITES = 'F',
DATAPOINT = 'B',
DIFFERENTIAL_GPS = 'D',
PILOT_EVENT = 'E',
GEN_PURPOSE_PLACEHOLDER = 'K',
COMMENT = 'L',
SEC_KEY = 'G'
};
enum Cardinals
{
NORTH = 'N',
SOUTH = 'S',
EAST = 'E',
WEST = 'W'
};
struct Coord
{
char cardinal;
int deg;
int min;
int sec;
};
struct IGC_DataPoint
{
// timestamp
int hour;
int minute;
int second;
// coordinates
struct Coord lat;
struct Coord lon;
// altitude
int baro_alt;
int gps_alt;
};
#endif