ballistics_reduce_qnh_pressure

Function ballistics_reduce_qnh_pressure 

Source
#[unsafe(no_mangle)]
pub extern "C" fn ballistics_reduce_qnh_pressure( qnh_hpa: c_double, altitude_m: c_double, ) -> c_double
Expand description

Reduce a sea-level-corrected altimeter setting (QNH, in hPa) to the station pressure at altitude_m (MBA-1397; see crate::atmosphere::reduce_qnh_to_station_pressure for the formula). FFIAtmosphericConditions.pressure has always meant absolute station pressure, and remains a frozen repr(C) struct enforced by an ABI regression test with no room to add a pressure-reference-mode field, so this is a standalone pure conversion instead of a struct setter — exactly the same pattern as ballistics_bc_for_reference_standard: call it once on a caller-declared QNH reading before writing the result into FFIAtmosphericConditions.pressure, then use every existing ballistics_calculate_trajectory*/ballistics_calculate_zero_angle*/ballistics_monte_carlo* export completely unchanged — every one of them reads pressure as absolute station pressure already, so feeding it an already-reduced value is a pure addition to the ABI, not a modification. No existing caller that never calls this function is affected, and no recompile is required for callers that don’t opt into QNH support.

A non-finite qnh_hpa or altitude_m is returned unchanged (this function performs no validation; the existing per-export input checks still apply to whatever ends up in FFIAtmosphericConditions.pressure).