| Crates.io | libdivecomputer-sys |
| lib.rs | libdivecomputer-sys |
| version | 0.1.0 |
| created_at | 2025-04-17 19:22:53.327987+00 |
| updated_at | 2025-04-17 19:22:53.327987+00 |
| description | Unsafe bindings for libdivecomputer |
| homepage | |
| repository | https://github.com/theCarlG/libdivecomputer-rs |
| max_upload_size | |
| id | 1638347 |
| size | 2,368,129 |
Please also see the repository containing a work-in-progress safe wrapper.
unsafe {
let mut iterator: *mut dc_iterator_t = ptr::null_mut();
let mut descriptor: *mut dc_descriptor_t = ptr::null_mut();
dc_descriptor_iterator(&mut iterator);
while dc_iterator_next(iterator, &mut descriptor as *mut _ as *mut c_void)
== dc_status_t_DC_STATUS_SUCCESS
{
let vendor = CStr::from_ptr(dc_descriptor_get_vendor(descriptor));
let product = CStr::from_ptr(dc_descriptor_get_product(descriptor));
println!("{} {}", vendor.to_string_lossy(), product.to_string_lossy());
dc_descriptor_free(descriptor);
}
dc_iterator_free(iterator);
}
Licensed under either of
at your option.
Note that libdivecomputer has its own LGPL-2.1 license.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.