use libc::{c_char, c_double, c_int, c_longlong}; // https://doc.rust-lang.org/nomicon/ffi.html#representing-opaque-structs #[repr(C)] pub struct TdLibRawPtr { _private: [u8; 0], } #[link(name = "tdjson")] extern "C" { pub fn td_json_client_create() -> *mut TdLibRawPtr; pub fn td_json_client_send(client: *mut TdLibRawPtr, request: *const c_char); pub fn td_json_client_receive(client: *mut TdLibRawPtr, timeout: c_double) -> *mut c_char; pub fn td_json_client_execute(client: *mut TdLibRawPtr, request: *const c_char) -> *mut c_char; pub fn td_json_client_destroy(client: *mut TdLibRawPtr); pub fn td_set_log_verbosity_level(level: c_int); pub fn td_set_log_file_path(path: *const c_char) -> c_int; pub fn td_set_log_max_file_size(size: c_longlong); }