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
// Copyright (C) 2020 - 2022, J2 Innovations
//!
//! C API for working with the [Coord](crate::val::Coord) type.
//!
use new_error;
use crateValue;
/// Get the latitude of a [Coord](crate::val::Coord) [Value](crate::val::Value)
/// # Arguments
/// val A [Coord](crate::val::Coord) [Value](crate::val::Value)
/// # Returns
/// - value
/// - NAN if there was an error
/// # Example
/// ```rust
/// # use crate::libhaystack::val::Value;
/// # use crate::libhaystack::c_api::value::*;
/// # use crate::libhaystack::c_api::coord::*;
/// # unsafe {
/// let val = haystack_value_make_coord(1.0, 2.0);
/// # let val = Box::<Value>::leak(val);
/// assert!(haystack_value_is_coord(val));
/// assert_eq!(haystack_value_get_coord_lat(val), 1.0);
/// # }
/// ```
/// # Safety
/// Panics on invalid input data
pub unsafe extern "C"
/// Get the longitude of a [Coord](crate::val::Coord) [Value](crate::val::Value)
/// # Arguments
/// val A [Coord](crate::val::Coord) [Value](crate::val::Value)
/// # Returns
/// - value
/// - NAN if there was an error
/// # Example
/// ```rust
/// # use crate::libhaystack::val::Value;
/// # use crate::libhaystack::c_api::value::*;
/// # use crate::libhaystack::c_api::coord::*;
/// # unsafe {
/// let val = haystack_value_make_coord(1.0, 2.0);
/// # let val = Box::<Value>::leak(val);
/// assert!(haystack_value_is_coord(val));
/// assert_eq!(haystack_value_get_coord_long(val), 2.0);
/// # }
/// ```
/// # Safety
/// Panics on invalid input data
pub unsafe extern "C"