diff --git a/src/dc_location.rs b/src/dc_location.rs index 123f768bc..6c61eca6a 100644 --- a/src/dc_location.rs +++ b/src/dc_location.rs @@ -28,6 +28,23 @@ pub struct dc_location { pub independent: uint32_t, } +impl dc_location { + pub fn new() -> Self { + dc_location { + location_id: 0, + latitude: 0.0, + longitude: 0.0, + accuracy: 0.0, + timestamp: 0, + contact_id: 0, + msg_id: 0, + chat_id: 0, + marker: std::ptr::null_mut(), + independent: 0, + } + } +} + #[derive(Copy, Clone)] #[repr(C)] pub struct dc_kml_t { @@ -37,6 +54,17 @@ pub struct dc_kml_t { pub curr: dc_location, } +impl dc_kml_t { + pub fn new() -> Self { + dc_kml_t { + addr: std::ptr::null_mut(), + locations: std::ptr::null_mut(), + tag: 0, + curr: dc_location::new(), + } + } +} + // location streaming pub unsafe fn dc_send_locations_to_chat( context: &Context,