mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 21:06:31 +03:00
Rename _dc_location into dc_location
This commit is contained in:
committed by
Floris Bruynooghe
parent
2cf227571a
commit
a791f76e4b
@@ -1,4 +1,4 @@
|
|||||||
use crate::dc_location::_dc_location;
|
use crate::dc_location::dc_location;
|
||||||
use crate::dc_tools::*;
|
use crate::dc_tools::*;
|
||||||
use crate::types::*;
|
use crate::types::*;
|
||||||
use crate::x::*;
|
use crate::x::*;
|
||||||
@@ -44,7 +44,7 @@ pub unsafe fn dc_array_free_ptr(array: *mut dc_array_t) {
|
|||||||
while i < (*array).count {
|
while i < (*array).count {
|
||||||
if (*array).type_0 == 1i32 {
|
if (*array).type_0 == 1i32 {
|
||||||
free(
|
free(
|
||||||
(*(*(*array).array.offset(i as isize) as *mut _dc_location)).marker
|
(*(*(*array).array.offset(i as isize) as *mut dc_location)).marker
|
||||||
as *mut libc::c_void,
|
as *mut libc::c_void,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -98,7 +98,7 @@ pub unsafe fn dc_array_get_id(array: *const dc_array_t, index: size_t) -> uint32
|
|||||||
return 0i32 as uint32_t;
|
return 0i32 as uint32_t;
|
||||||
}
|
}
|
||||||
if (*array).type_0 == 1i32 {
|
if (*array).type_0 == 1i32 {
|
||||||
return (*(*(*array).array.offset(index as isize) as *mut _dc_location)).location_id;
|
return (*(*(*array).array.offset(index as isize) as *mut dc_location)).location_id;
|
||||||
}
|
}
|
||||||
*(*array).array.offset(index as isize) as uint32_t
|
*(*array).array.offset(index as isize) as uint32_t
|
||||||
}
|
}
|
||||||
@@ -119,7 +119,7 @@ pub unsafe fn dc_array_get_latitude(array: *const dc_array_t, index: size_t) ->
|
|||||||
{
|
{
|
||||||
return 0i32 as libc::c_double;
|
return 0i32 as libc::c_double;
|
||||||
}
|
}
|
||||||
(*(*(*array).array.offset(index as isize) as *mut _dc_location)).latitude
|
(*(*(*array).array.offset(index as isize) as *mut dc_location)).latitude
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn dc_array_get_longitude(array: *const dc_array_t, index: size_t) -> libc::c_double {
|
pub unsafe fn dc_array_get_longitude(array: *const dc_array_t, index: size_t) -> libc::c_double {
|
||||||
@@ -131,7 +131,7 @@ pub unsafe fn dc_array_get_longitude(array: *const dc_array_t, index: size_t) ->
|
|||||||
{
|
{
|
||||||
return 0i32 as libc::c_double;
|
return 0i32 as libc::c_double;
|
||||||
}
|
}
|
||||||
(*(*(*array).array.offset(index as isize) as *mut _dc_location)).longitude
|
(*(*(*array).array.offset(index as isize) as *mut dc_location)).longitude
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn dc_array_get_accuracy(array: *const dc_array_t, index: size_t) -> libc::c_double {
|
pub unsafe fn dc_array_get_accuracy(array: *const dc_array_t, index: size_t) -> libc::c_double {
|
||||||
@@ -143,7 +143,7 @@ pub unsafe fn dc_array_get_accuracy(array: *const dc_array_t, index: size_t) ->
|
|||||||
{
|
{
|
||||||
return 0i32 as libc::c_double;
|
return 0i32 as libc::c_double;
|
||||||
}
|
}
|
||||||
(*(*(*array).array.offset(index as isize) as *mut _dc_location)).accuracy
|
(*(*(*array).array.offset(index as isize) as *mut dc_location)).accuracy
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn dc_array_get_timestamp(array: *const dc_array_t, index: size_t) -> i64 {
|
pub unsafe fn dc_array_get_timestamp(array: *const dc_array_t, index: size_t) -> i64 {
|
||||||
@@ -155,7 +155,7 @@ pub unsafe fn dc_array_get_timestamp(array: *const dc_array_t, index: size_t) ->
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
(*(*(*array).array.offset(index as isize) as *mut _dc_location)).timestamp
|
(*(*(*array).array.offset(index as isize) as *mut dc_location)).timestamp
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn dc_array_get_chat_id(array: *const dc_array_t, index: size_t) -> uint32_t {
|
pub unsafe fn dc_array_get_chat_id(array: *const dc_array_t, index: size_t) -> uint32_t {
|
||||||
@@ -167,7 +167,7 @@ pub unsafe fn dc_array_get_chat_id(array: *const dc_array_t, index: size_t) -> u
|
|||||||
{
|
{
|
||||||
return 0i32 as uint32_t;
|
return 0i32 as uint32_t;
|
||||||
}
|
}
|
||||||
(*(*(*array).array.offset(index as isize) as *mut _dc_location)).chat_id
|
(*(*(*array).array.offset(index as isize) as *mut dc_location)).chat_id
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn dc_array_get_contact_id(array: *const dc_array_t, index: size_t) -> uint32_t {
|
pub unsafe fn dc_array_get_contact_id(array: *const dc_array_t, index: size_t) -> uint32_t {
|
||||||
@@ -179,7 +179,7 @@ pub unsafe fn dc_array_get_contact_id(array: *const dc_array_t, index: size_t) -
|
|||||||
{
|
{
|
||||||
return 0i32 as uint32_t;
|
return 0i32 as uint32_t;
|
||||||
}
|
}
|
||||||
(*(*(*array).array.offset(index as isize) as *mut _dc_location)).contact_id
|
(*(*(*array).array.offset(index as isize) as *mut dc_location)).contact_id
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn dc_array_get_msg_id(array: *const dc_array_t, index: size_t) -> uint32_t {
|
pub unsafe fn dc_array_get_msg_id(array: *const dc_array_t, index: size_t) -> uint32_t {
|
||||||
@@ -191,7 +191,7 @@ pub unsafe fn dc_array_get_msg_id(array: *const dc_array_t, index: size_t) -> ui
|
|||||||
{
|
{
|
||||||
return 0i32 as uint32_t;
|
return 0i32 as uint32_t;
|
||||||
}
|
}
|
||||||
(*(*(*array).array.offset(index as isize) as *mut _dc_location)).msg_id
|
(*(*(*array).array.offset(index as isize) as *mut dc_location)).msg_id
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn dc_array_get_marker(array: *const dc_array_t, index: size_t) -> *mut libc::c_char {
|
pub unsafe fn dc_array_get_marker(array: *const dc_array_t, index: size_t) -> *mut libc::c_char {
|
||||||
@@ -203,7 +203,7 @@ pub unsafe fn dc_array_get_marker(array: *const dc_array_t, index: size_t) -> *m
|
|||||||
{
|
{
|
||||||
return 0 as *mut libc::c_char;
|
return 0 as *mut libc::c_char;
|
||||||
}
|
}
|
||||||
dc_strdup_keep_null((*(*(*array).array.offset(index as isize) as *mut _dc_location)).marker)
|
dc_strdup_keep_null((*(*(*array).array.offset(index as isize) as *mut dc_location)).marker)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -226,7 +226,7 @@ pub unsafe fn dc_array_is_independent(array: *const dc_array_t, index: size_t) -
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
(*(*(*array).array.offset(index as isize) as *mut _dc_location)).independent as libc::c_int
|
(*(*(*array).array.offset(index as isize) as *mut dc_location)).independent as libc::c_int
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn dc_array_search_id(
|
pub unsafe fn dc_array_search_id(
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ use crate::x::*;
|
|||||||
// location handling
|
// location handling
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct _dc_location {
|
pub struct dc_location {
|
||||||
pub location_id: uint32_t,
|
pub location_id: uint32_t,
|
||||||
pub latitude: libc::c_double,
|
pub latitude: libc::c_double,
|
||||||
pub longitude: libc::c_double,
|
pub longitude: libc::c_double,
|
||||||
@@ -34,7 +34,7 @@ pub struct dc_kml_t {
|
|||||||
pub addr: *mut libc::c_char,
|
pub addr: *mut libc::c_char,
|
||||||
pub locations: *mut dc_array_t,
|
pub locations: *mut dc_array_t,
|
||||||
pub tag: libc::c_int,
|
pub tag: libc::c_int,
|
||||||
pub curr: _dc_location,
|
pub curr: dc_location,
|
||||||
}
|
}
|
||||||
|
|
||||||
// location streaming
|
// location streaming
|
||||||
@@ -199,8 +199,8 @@ pub fn dc_get_locations(
|
|||||||
timestamp_to,
|
timestamp_to,
|
||||||
],
|
],
|
||||||
|row| unsafe {
|
|row| unsafe {
|
||||||
let mut loc: *mut _dc_location =
|
let mut loc: *mut dc_location =
|
||||||
calloc(1, ::std::mem::size_of::<_dc_location>()) as *mut _dc_location;
|
calloc(1, ::std::mem::size_of::<dc_location>()) as *mut dc_location;
|
||||||
assert!(!loc.is_null(), "allocation failed");
|
assert!(!loc.is_null(), "allocation failed");
|
||||||
|
|
||||||
(*loc).location_id = row.get(0)?;
|
(*loc).location_id = row.get(0)?;
|
||||||
@@ -413,7 +413,7 @@ pub unsafe fn dc_save_locations(
|
|||||||
let mut newest_location_id = 0;
|
let mut newest_location_id = 0;
|
||||||
|
|
||||||
for i in 0..dc_array_get_cnt(locations) {
|
for i in 0..dc_array_get_cnt(locations) {
|
||||||
let location = dc_array_get_ptr(locations, i as size_t) as *mut _dc_location;
|
let location = dc_array_get_ptr(locations, i as size_t) as *mut dc_location;
|
||||||
|
|
||||||
let exists =
|
let exists =
|
||||||
stmt_test.exists(params![(*location).timestamp, contact_id as i32])?;
|
stmt_test.exists(params![(*location).timestamp, contact_id as i32])?;
|
||||||
@@ -553,8 +553,8 @@ unsafe fn kml_endtag_cb(userdata: *mut libc::c_void, tag: *const libc::c_char) {
|
|||||||
&& 0. != (*kml).curr.latitude
|
&& 0. != (*kml).curr.latitude
|
||||||
&& 0. != (*kml).curr.longitude
|
&& 0. != (*kml).curr.longitude
|
||||||
{
|
{
|
||||||
let location: *mut _dc_location =
|
let location: *mut dc_location =
|
||||||
calloc(1, ::std::mem::size_of::<_dc_location>()) as *mut _dc_location;
|
calloc(1, ::std::mem::size_of::<dc_location>()) as *mut dc_location;
|
||||||
*location = (*kml).curr;
|
*location = (*kml).curr;
|
||||||
dc_array_add_ptr((*kml).locations, location as *mut libc::c_void);
|
dc_array_add_ptr((*kml).locations, location as *mut libc::c_void);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user