-
Notifications
You must be signed in to change notification settings - Fork 0
/
Airport.h
29 lines (25 loc) · 904 Bytes
/
Airport.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
#ifndef __AIRPORT__
#define __AIRPORT__
#include <crtdbg.h> // TODO: remove before release
#include "fileHelper.h"
#define IATA_LENGTH 3
typedef struct
{
char* name;
char* country;
char code[IATA_LENGTH + 1];
}Airport;
int isSameAirport(const Airport* pPort1, const Airport* pPort2);
int isAirportCode(const Airport* pPort1, const char* code);
int AirportCompareCode(const void* pPort1, const void* pPort2);
int initAirportNoCode(Airport* pPort);
int getAirportName(Airport* pPort);
char* allocateRightLength(char** wordsArray, int count, int totalLength);
void changeNameOneWord(char* name, const char* word);
void changeName(char* name, int count, char** wordsArray);
void getAirportCode(char* code);
void printAirport(const void* pPort);
void freeAirport(void* pPort);
void writeAirportToFile(FILE* file, const Airport* pPort);
int readAirportFromFile(FILE* file, Airport* pPort);
#endif