-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathairportManagerUtils.h
48 lines (37 loc) · 1.11 KB
/
airportManagerUtils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#pragma warning(disable:4996)
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "airPortUtils.h"
#include "generalFunctions.h"
#ifndef __AirportManager
#define __AirportManager
struct Airport;
typedef struct airportManagers {
Airport* allAirports; // array of airports, not pointers to airport
int arrPsclSize;
int allAirportsCount;
} AirportManager;
#endif
#ifndef __Airport
#define __Airport
typedef struct airports {
char* name;
char* country;
char* IATAcode;
float latitude;
float longitude;
} Airport;
#endif
#ifndef __airportManagerUtils
#define __airportManagerUtils
AirportManager* InitDataBase();
void addAirportToAirportManager(AirportManager* AirportDB, Airport insertMe);
int enlargeAirPortsArray(AirportManager* AirportDB);
void freeDB(AirportManager* AirportDB);
Airport* findAirportByIATA(const AirportManager* airportDB, const char* inIATA);
int writeManagerToFile(const AirportManager* airportDB);
int readManagerFromFile(FILE* f, AirportManager* airportDB);
void printAllAirports(const AirportManager* airportDB);
#endif // !__airportManagerUtils