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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
//! `CFlightPlanData` FFI declarations.
//!
//! `CFlightPlanData` is reached through its owning `CFlightPlan`, so every
//! wrapper takes a [`FlightPlanPtr`] and the shim re-derives the data object.
use std::ffi::{c_char, c_int};
use crate::FlightPlanPtr;
unsafe extern "C" {
/// `CFlightPlanData::IsReceived` — whether any FP was received from servers.
pub fn es_flightplandata_is_received(h: FlightPlanPtr) -> bool;
/// `CFlightPlanData::IsAmended` — whether the FP was amended by a controller.
pub fn es_flightplandata_is_amended(h: FlightPlanPtr) -> bool;
/// `CFlightPlanData::AmendFlightPlan` — amend the FP. Mutates ES state.
pub fn es_flightplandata_amend_flight_plan(h: FlightPlanPtr) -> bool;
/// `CFlightPlanData::GetPlanType` — the FP type (`V` or `I`). Borrowed ANSI.
pub fn es_flightplandata_plan_type(h: FlightPlanPtr) -> *const c_char;
/// `CFlightPlanData::SetPlanType` — change the FP type. Mutates ES state.
pub fn es_flightplandata_set_plan_type(h: FlightPlanPtr, s: *const c_char) -> bool;
/// `CFlightPlanData::GetAircraftInfo` — unextracted aircraft info. Borrowed.
pub fn es_flightplandata_aircraft_info(h: FlightPlanPtr) -> *const c_char;
/// `CFlightPlanData::SetAircraftInfo` — change the AC info. Mutates ES state.
pub fn es_flightplandata_set_aircraft_info(h: FlightPlanPtr, s: *const c_char) -> bool;
/// `CFlightPlanData::GetAircraftWtc` — weight category code (`?LMHJ`).
pub fn es_flightplandata_aircraft_wtc(h: FlightPlanPtr) -> c_char;
/// `CFlightPlanData::GetAircraftType` — aircraft type code (`?LSAHGT`).
pub fn es_flightplandata_aircraft_type(h: FlightPlanPtr) -> c_char;
/// `CFlightPlanData::GetEngineNumber` — number of engines.
pub fn es_flightplandata_engine_number(h: FlightPlanPtr) -> c_int;
/// `CFlightPlanData::GetEngineType` — engine type code (`?PTJE`).
pub fn es_flightplandata_engine_type(h: FlightPlanPtr) -> c_char;
/// `CFlightPlanData::GetCapibilities` — navigation capabilities code.
pub fn es_flightplandata_capibilities(h: FlightPlanPtr) -> c_char;
/// `CFlightPlanData::IsRvsm` — whether the aircraft is RVSM capable.
pub fn es_flightplandata_is_rvsm(h: FlightPlanPtr) -> bool;
/// `CFlightPlanData::GetManufacturerType` — manufacturer type description.
pub fn es_flightplandata_manufacturer_type(h: FlightPlanPtr) -> *const c_char;
/// `CFlightPlanData::GetAircraftFPType` — unencoded AC type as filed.
pub fn es_flightplandata_aircraft_fp_type(h: FlightPlanPtr) -> *const c_char;
/// `CFlightPlanData::GetTrueAirspeed` — filed true airspeed.
pub fn es_flightplandata_true_airspeed(h: FlightPlanPtr) -> c_int;
/// `CFlightPlanData::SetTrueAirspeed` — set the true airspeed. Mutates ES.
pub fn es_flightplandata_set_true_airspeed(h: FlightPlanPtr, v: c_int) -> bool;
/// `CFlightPlanData::GetOrigin` — origin airport. Borrowed ANSI.
pub fn es_flightplandata_origin(h: FlightPlanPtr) -> *const c_char;
/// `CFlightPlanData::SetOrigin` — change the origin airport. Mutates ES.
pub fn es_flightplandata_set_origin(h: FlightPlanPtr, s: *const c_char) -> bool;
/// `CFlightPlanData::GetFinalAltitude` — final requested altitude.
pub fn es_flightplandata_final_altitude(h: FlightPlanPtr) -> c_int;
/// `CFlightPlanData::SetFinalAltitude` — set the final altitude. Mutates ES.
pub fn es_flightplandata_set_final_altitude(h: FlightPlanPtr, v: c_int) -> bool;
/// `CFlightPlanData::GetDestination` — destination airport. Borrowed ANSI.
pub fn es_flightplandata_destination(h: FlightPlanPtr) -> *const c_char;
/// `CFlightPlanData::SetDestination` — set the destination. Mutates ES.
pub fn es_flightplandata_set_destination(h: FlightPlanPtr, s: *const c_char) -> bool;
/// `CFlightPlanData::GetAlternate` — alternate airport. Borrowed ANSI.
pub fn es_flightplandata_alternate(h: FlightPlanPtr) -> *const c_char;
/// `CFlightPlanData::SetAlternate` — set the alternate airport. Mutates ES.
pub fn es_flightplandata_set_alternate(h: FlightPlanPtr, s: *const c_char) -> bool;
/// `CFlightPlanData::GetRemarks` — remarks field. Borrowed ANSI.
pub fn es_flightplandata_remarks(h: FlightPlanPtr) -> *const c_char;
/// `CFlightPlanData::SetRemarks` — set the remarks field. Mutates ES.
pub fn es_flightplandata_set_remarks(h: FlightPlanPtr, s: *const c_char) -> bool;
/// `CFlightPlanData::GetCommunicationType` — comms type code (`?VRT`).
pub fn es_flightplandata_communication_type(h: FlightPlanPtr) -> c_char;
/// `CFlightPlanData::GetRoute` — route field. Borrowed ANSI.
pub fn es_flightplandata_route(h: FlightPlanPtr) -> *const c_char;
/// `CFlightPlanData::SetRoute` — set the route field. Mutates ES.
pub fn es_flightplandata_set_route(h: FlightPlanPtr, s: *const c_char) -> bool;
/// `CFlightPlanData::GetSidName` — extracted or assigned SID name.
pub fn es_flightplandata_sid_name(h: FlightPlanPtr) -> *const c_char;
/// `CFlightPlanData::GetStarName` — extracted or assigned STAR name.
pub fn es_flightplandata_star_name(h: FlightPlanPtr) -> *const c_char;
/// `CFlightPlanData::GetDepartureRwy` — extracted or assigned departure RWY.
pub fn es_flightplandata_departure_rwy(h: FlightPlanPtr) -> *const c_char;
/// `CFlightPlanData::GetArrivalRwy` — extracted or assigned arrival RWY.
pub fn es_flightplandata_arrival_rwy(h: FlightPlanPtr) -> *const c_char;
/// `CFlightPlanData::GetEstimatedDepartureTime` — filed EOBT (raw string).
pub fn es_flightplandata_estimated_departure_time(h: FlightPlanPtr) -> *const c_char;
/// `CFlightPlanData::SetEstimatedDepartureTime` — set the EOBT. Mutates ES.
pub fn es_flightplandata_set_estimated_departure_time(
h: FlightPlanPtr,
s: *const c_char,
) -> bool;
/// `CFlightPlanData::GetActualDepartureTime` — actual departure (raw string).
pub fn es_flightplandata_actual_departure_time(h: FlightPlanPtr) -> *const c_char;
/// `CFlightPlanData::SetActualDepartureTime` — set actual departure. Mutates ES.
pub fn es_flightplandata_set_actual_departure_time(h: FlightPlanPtr, s: *const c_char) -> bool;
/// `CFlightPlanData::GetEnrouteHours` — enroute hours (raw string).
pub fn es_flightplandata_enroute_hours(h: FlightPlanPtr) -> *const c_char;
/// `CFlightPlanData::SetEnrouteHours` — set enroute hours. Mutates ES.
pub fn es_flightplandata_set_enroute_hours(h: FlightPlanPtr, s: *const c_char) -> bool;
/// `CFlightPlanData::GetEnrouteMinutes` — enroute minutes (raw string).
pub fn es_flightplandata_enroute_minutes(h: FlightPlanPtr) -> *const c_char;
/// `CFlightPlanData::SetEnrouteMinutes` — set enroute minutes. Mutates ES.
pub fn es_flightplandata_set_enroute_minutes(h: FlightPlanPtr, s: *const c_char) -> bool;
/// `CFlightPlanData::GetFuelHours` — available fuel hours (raw string).
pub fn es_flightplandata_fuel_hours(h: FlightPlanPtr) -> *const c_char;
/// `CFlightPlanData::SetFuelHours` — set available fuel hours. Mutates ES.
pub fn es_flightplandata_set_fuel_hours(h: FlightPlanPtr, s: *const c_char) -> bool;
/// `CFlightPlanData::GetFuelMinutes` — available fuel minutes (raw string).
pub fn es_flightplandata_fuel_minutes(h: FlightPlanPtr) -> *const c_char;
/// `CFlightPlanData::SetFuelMinutes` — set available fuel minutes. Mutates ES.
pub fn es_flightplandata_set_fuel_minutes(h: FlightPlanPtr, s: *const c_char) -> bool;
/// `CFlightPlanData::PerformanceGetIas` — IAS at the given altitude/VS.
pub fn es_flightplandata_performance_get_ias(
h: FlightPlanPtr,
altitude: c_int,
vertical_speed: c_int,
) -> c_int;
/// `CFlightPlanData::PerformanceGetMach` — Mach (x100) at altitude/VS.
pub fn es_flightplandata_performance_get_mach(
h: FlightPlanPtr,
altitude: c_int,
vertical_speed: c_int,
) -> c_int;
/// `CFlightPlanData::PerformanceGetClimbRate` — climb rate at altitude.
pub fn es_flightplandata_performance_get_climb_rate(h: FlightPlanPtr, altitude: c_int)
-> c_int;
/// `CFlightPlanData::PerformanceGetDescentRate` — descent rate at altitude.
pub fn es_flightplandata_performance_get_descent_rate(
h: FlightPlanPtr,
altitude: c_int,
) -> c_int;
}