libacfutils
A general purpose library of utility functions designed to make it easier to develop addons for the X-Plane flight simulator.
Loading...
Searching...
No Matches
Functions
icao2cc.h File Reference
#include "core.h"
Include dependency graph for icao2cc.h:

Go to the source code of this file.

Functions

const char * icao2cc (const char *icao)
 
const char * icao2lang (const char *icao)
 

Detailed Description

Translation functionality to convert ICAO airport codes into country codes and language codes. This is useful for building flight information systems.

Definition in file icao2cc.h.

Function Documentation

◆ icao2cc()

const char * icao2cc ( const char *  icao)

Converts an ICAO code to a country code. This performs a simple prefix match using the icao2cc_table.

Returns
The 2-letter ISO 3166 country code using upper case. If the country code cannot be determined, or the passed argument isn't a valid ICAO code, returns NULL instead.

Definition at line 434 of file icao2cc.c.

◆ icao2lang()

const char * icao2lang ( const char *  icao)

Grabs an ICAO airport code and tries to map it to language code of the principal language spoken at that airport. This shouldn't be relied upon to be very accurate, since in reality the airport-to-language mapping is anything but clear cut.

Returns
A two- or three-letter language code (if no two-letter one exists) using lower case, or "XX" if no suitable mapping was found.

Definition at line 463 of file icao2cc.c.