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
//! `CSectorElement` FFI declarations.
use std::ffi::{c_char, c_int};
use crate::EsHandle;
unsafe extern "C" {
/// Whether the sector-element reference is valid (`IsValid`).
pub fn es_sectorelement_is_valid(h: EsHandle) -> bool;
/// The element type code (`GetElementType`).
pub fn es_sectorelement_element_type(h: EsHandle) -> c_int;
/// The element name (`GetName`). Borrowed, NUL-terminated, ANSI.
pub fn es_sectorelement_name(h: EsHandle) -> *const c_char;
/// The position at `index` (`GetPosition`). Writes lat/lon out-params and
/// returns whether the index is valid.
pub fn es_sectorelement_position(
h: EsHandle,
index: c_int,
lat: *mut f64,
lon: *mut f64,
) -> bool;
/// Name of the switchable component at `index` (`GetComponentName`).
/// Borrowed, NUL-terminated, ANSI.
pub fn es_sectorelement_component_name(h: EsHandle, index: c_int) -> *const c_char;
/// The frequency of VOR/NDB/AIRPORT elements, else 0.0 (`GetFrequency`).
pub fn es_sectorelement_frequency(h: EsHandle) -> f64;
/// Name of the runway at `index` (0 or 1) (`GetRunwayName`). Borrowed,
/// NUL-terminated, ANSI.
pub fn es_sectorelement_runway_name(h: EsHandle, index: c_int) -> *const c_char;
/// Heading of the runway at `index` (0 or 1), or -1 (`GetRunwayHeading`).
pub fn es_sectorelement_runway_heading(h: EsHandle, index: c_int) -> c_int;
/// Name of the airport this element belongs to (`GetAirportName`).
/// Borrowed, NUL-terminated, ANSI.
pub fn es_sectorelement_airport_name(h: EsHandle) -> *const c_char;
/// Whether the element is active for departure (true) or arrival (false)
/// at runway `index` (`IsElementActive`).
pub fn es_sectorelement_is_element_active(h: EsHandle, departure: bool, index: c_int) -> bool;
}