diff options
author | syn <isaqtm@gmail.com> | 2021-01-03 11:59:24 +0300 |
---|---|---|
committer | syn <isaqtm@gmail.com> | 2021-01-03 11:59:24 +0300 |
commit | ef2b020d504a62c2c6ed234b3a93ba61b051b66e (patch) | |
tree | 4a3fdbdef741bf4527c4fd994e11290f7a85ee7a /src | |
download | tdlib-sys-ef2b020d504a62c2c6ed234b3a93ba61b051b66e.tar.gz |
can automatically find brew's openssl
looking up /usr/local/Cellar/openssl@1.1/1.1.1x
where x is any letter in 'a'..'i'
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..8bdb227 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,20 @@ +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); +} |