Skip to content

Commit ef1b2da

Browse files
authored
Add UTC time representation and conversions (#63)
1 parent 72d6b74 commit ef1b2da

File tree

3 files changed

+1008
-1
lines changed

3 files changed

+1008
-1
lines changed

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ readme = "README.md"
88
repository = "https://github.com/swift-nav/swiftnav-rs"
99
license = "LGPL-3.0"
1010

11+
[dependencies]
12+
chrono = { version = "0.4", optional = true }
13+
1114
[build-dependencies]
1215
bindgen = "0.59"
1316
cmake = "0.1"
1417

1518
[features]
1619
default = ["testcpp"]
1720
testcpp = []
21+
chrono-support = ["chrono"]

build.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,21 @@ fn main() {
6161
.blocklist_type("u16")
6262
.blocklist_type("u32")
6363
.allowlist_type("gps_time_t")
64+
.allowlist_type("utc_params_t")
65+
.allowlist_type("utc_tm")
6466
.allowlist_function("gpsdifftime")
6567
.allowlist_function("gps_time_valid")
6668
.allowlist_function("add_secs")
69+
.allowlist_function("decode_utc_parameters")
70+
.allowlist_function("gps2utc")
71+
.allowlist_function("date2mjd")
72+
.allowlist_function("mjd2utc")
73+
.allowlist_function("utc2mjd")
74+
.allowlist_function("date2utc")
75+
.allowlist_function("get_gps_utc_offset")
76+
.allowlist_function("is_leap_second_event")
77+
.allowlist_function("round_to_epoch")
78+
.allowlist_function("floor_to_epoch")
6779
.allowlist_var("FLOAT_EQUALITY_EPS")
6880
.allowlist_var("MINUTE_SECS")
6981
.allowlist_var("HOUR_SECS")

0 commit comments

Comments
 (0)