Commit b9943dbc authored by Alexander Danilov's avatar Alexander Danilov

Обновлены существующие функции для большего удобства построения клиентов, исправления ошибок

parent 2d44f6ca
......@@ -4,7 +4,7 @@ crate-type = ["dylib"]
[package]
name = "skaro"
version = "0.3.0"
version = "0.3.1"
authors = ["Alexander Danilov <[email protected]>"]
[dependencies]
......
......@@ -125,7 +125,6 @@ int main()
c = getchar( );
skaro_disconnect(x);
c = getchar( );
return 0;
......
......@@ -2,8 +2,8 @@ use handler::*;
pub fn add_contact(login: &str) -> Result<Vec<u8>, serde_cbor::Error> {
let mut storage = STORAGE.lock().unwrap();
let mut storage_data = HashMap::new();
storage_data.insert("type", "add_contact".to_string());
let mut storage_data: HashMap<String, String> = HashMap::new();
storage_data.insert("type".to_string(), "add_contact".to_string());
let mut response = HashMap::new();
let uuid = Uuid::new_v4().hyphenated().to_string();
......@@ -15,10 +15,7 @@ pub fn add_contact(login: &str) -> Result<Vec<u8>, serde_cbor::Error> {
serde_cbor::to_vec(&response)
}
pub fn __on_add_contact(message: message::SkaroMessage,
mut storage: MutexGuard<HashMap<String, HashMap<&'static str, String>>>) {
storage.remove(message.get_str("chain_uuid").unwrap());
pub fn __on_add_contact(message: message::SkaroMessage) {
let status = message.get_str("status").unwrap();
let data = if status == "200 OK" {
......
......@@ -16,10 +16,10 @@ pub fn authorize(login: &str,
password: &str)
-> Result<Vec<u8>, serde_cbor::Error> {
let mut storage = STORAGE.lock().unwrap();
let mut storage_data = HashMap::new();
storage_data.insert("type", "authorize".to_string());
storage_data.insert("private_key", private_key.to_string());
storage_data.insert("password", password.to_string());
let mut storage_data: HashMap<String, String> = HashMap::new();
storage_data.insert("type".to_string(), "authorize".to_string());
storage_data.insert("private_key".to_string(), private_key.to_string());
storage_data.insert("password".to_string(), password.to_string());
let mut response = HashMap::new();
let uuid = Uuid::new_v4().hyphenated().to_string();
......@@ -28,16 +28,16 @@ pub fn authorize(login: &str,
response.insert("login", Value::String(login.to_string()));
storage.insert(uuid, storage_data);
serde_cbor::to_vec(&response)
}
pub fn __on_authorize(message: message::SkaroMessage,
mut storage: MutexGuard<HashMap<String, HashMap<&'static str, String>>>,
data: &HashMap<&'static str, String>)
data: &HashMap<String, String>)
-> Result<Vec<u8>, serde_cbor::Error> {
let mut storage_data = HashMap::new();
storage.remove(message.get_str("chain_uuid").unwrap());
storage_data.insert("type", "authorize2".to_string());
let mut storage_data: HashMap<String, String> = HashMap::new();
storage_data.insert("type".to_string(), "authorize2".to_string());
let encrypted_rnd = &decode(message.get_str("encrypted_rnd").unwrap().as_bytes()).unwrap();
......@@ -59,15 +59,12 @@ pub fn __on_authorize(message: message::SkaroMessage,
data.insert("rnd_hash", Value::String(res));
data.insert("status", Value::String("200 OK".to_string()));
storage.insert(message.get_str("chain_uuid").unwrap().to_string(),
storage_insert(message.get_str("chain_uuid").unwrap().to_string(),
storage_data);
serde_cbor::to_vec(&data)
}
pub fn __on_authorize_2(message: message::SkaroMessage,
mut storage: MutexGuard<HashMap<String, HashMap<&'static str, String>>>) {
storage.remove(message.get_str("chain_uuid").unwrap());
pub fn __on_authorize_2(message: message::SkaroMessage) {
let status = message.get_str("status").unwrap();
let data = if status == "200 OK" {
......
use handler::*;
pub fn __on_changed_user_data(message: message::SkaroMessage) {
let status = message.get_str("status").unwrap();
let data = message.get_obj("update").and_then(|s| s.to_json()).unwrap();
let data = if status == "200 OK" {
message.get_obj("update").and_then(|s| s.to_json()).unwrap()
} else {
"".to_string()
};
let c_status = CString::new(status).unwrap();
let c_info = CString::new(message.get_str("info").unwrap_or("")).unwrap();
let c_login = CString::new(message.get_str("login").unwrap_or("")).unwrap();
let c_data = CString::new(data).unwrap();
unsafe {
skaro_on_changed_user_data(c_status.as_ptr(), c_info.as_ptr(), c_data.as_ptr());
skaro_on_changed_user_data(c_login.as_ptr(), c_data.as_ptr());
}
}
......@@ -2,8 +2,9 @@ use handler::*;
pub fn del_contact(login: &str) -> Result<Vec<u8>, serde_cbor::Error> {
let mut storage = STORAGE.lock().unwrap();
let mut storage_data = HashMap::new();
storage_data.insert("type", "del_contact".to_string());
let mut storage_data: HashMap<String, String> = HashMap::new();
storage_data.insert("type".to_string(), "del_contact".to_string());
storage_data.insert("login".to_string(), login.to_string());
let mut response = HashMap::new();
let uuid = Uuid::new_v4().hyphenated().to_string();
......@@ -15,16 +16,15 @@ pub fn del_contact(login: &str) -> Result<Vec<u8>, serde_cbor::Error> {
serde_cbor::to_vec(&response)
}
pub fn __on_del_contact(message: message::SkaroMessage,
mut storage: MutexGuard<HashMap<String, HashMap<&'static str, String>>>) {
storage.remove(message.get_str("chain_uuid").unwrap());
pub fn __on_del_contact(message: message::SkaroMessage, data: &HashMap<String, String>) {
let status = message.get_str("status").unwrap();
let login = data.get("login").unwrap_or(&"".to_string()).to_owned();
let c_status = CString::new(status).unwrap();
let c_info = CString::new(message.get_str("info").unwrap_or("")).unwrap();
let c_login = CString::new(login).unwrap();
unsafe {
skaro_on_del_contact(c_status.as_ptr(), c_info.as_ptr());
skaro_on_del_contact(c_status.as_ptr(), c_info.as_ptr(), c_login.as_ptr());
}
}
......@@ -2,8 +2,8 @@ use handler::*;
pub fn get_contacts() -> Result<Vec<u8>, serde_cbor::Error> {
let mut storage = STORAGE.lock().unwrap();
let mut storage_data = HashMap::new();
storage_data.insert("type", "get_contacts".to_string());
let mut storage_data: HashMap<String, String> = HashMap::new();
storage_data.insert("type".to_string(), "get_contacts".to_string());
let mut response = HashMap::new();
let uuid = Uuid::new_v4().hyphenated().to_string();
......@@ -14,10 +14,7 @@ pub fn get_contacts() -> Result<Vec<u8>, serde_cbor::Error> {
serde_cbor::to_vec(&response)
}
pub fn __on_get_contacts(message: message::SkaroMessage,
mut storage: MutexGuard<HashMap<String, HashMap<&'static str, String>>>) {
storage.remove(message.get_str("chain_uuid").unwrap());
pub fn __on_get_contacts(message: message::SkaroMessage) {
let status = message.get_str("status").unwrap();
let data = if status == "200 OK" {
......
use handler::*;
pub fn get_history(login: &str, is_conference: bool) -> Result<Vec<u8>, serde_cbor::Error> {
pub fn get_history(login: &str) -> Result<Vec<u8>, serde_cbor::Error> {
let mut storage = STORAGE.lock().unwrap();
let mut storage_data = HashMap::new();
storage_data.insert("type", "get_history".to_string());
let mut storage_data: HashMap<String, String> = HashMap::new();
storage_data.insert("type".to_string(), "get_history".to_string());
storage_data.insert("login".to_string(), login.to_string());
let mut response = HashMap::new();
let uuid = Uuid::new_v4().hyphenated().to_string();
response.insert("chain_uuid", Value::String(uuid.clone()));
response.insert("type", Value::String("get_history".to_string()));
response.insert("login", Value::String(login.to_string()));
response.insert("is_conference", Value::Bool(is_conference));
storage.insert(uuid, storage_data);
serde_cbor::to_vec(&response)
}
pub fn __on_get_history(message: message::SkaroMessage,
mut storage: MutexGuard<HashMap<String, HashMap<&'static str, String>>>) {
storage.remove(message.get_str("chain_uuid").unwrap());
pub fn __on_get_history(message: message::SkaroMessage, data: &HashMap<String, String>) {
let status = message.get_str("status").unwrap();
let login = data.get("login").unwrap();
let data = if status == "200 OK" {
message.get_arr("history").and_then(|s| s.to_json()).unwrap()
......@@ -28,11 +27,17 @@ pub fn __on_get_history(message: message::SkaroMessage,
"".to_string()
};
println!("json: {:?}", data);
let c_status = CString::new(status).unwrap();
let c_info = CString::new(message.get_str("info").unwrap_or("")).unwrap();
let c_login = CString::new(login.to_string()).unwrap();
let c_data = CString::new(data).unwrap();
unsafe {
skaro_on_get_history(c_status.as_ptr(), c_info.as_ptr(), c_data.as_ptr());
skaro_on_get_history(c_status.as_ptr(),
c_info.as_ptr(),
c_login.as_ptr(),
c_data.as_ptr());
}
}
......@@ -2,8 +2,8 @@ use handler::*;
pub fn get_user_data(login: &str) -> Result<Vec<u8>, serde_cbor::Error> {
let mut storage = STORAGE.lock().unwrap();
let mut storage_data = HashMap::new();
storage_data.insert("type", "get_user_data".to_string());
let mut storage_data: HashMap<String, String> = HashMap::new();
storage_data.insert("type".to_string(), "get_user_data".to_string());
let mut response = HashMap::new();
let uuid = Uuid::new_v4().hyphenated().to_string();
......@@ -15,10 +15,7 @@ pub fn get_user_data(login: &str) -> Result<Vec<u8>, serde_cbor::Error> {
serde_cbor::to_vec(&response)
}
pub fn __on_get_user_data(message: message::SkaroMessage,
mut storage: MutexGuard<HashMap<String, HashMap<&'static str, String>>>) {
storage.remove(message.get_str("chain_uuid").unwrap());
pub fn __on_get_user_data(message: message::SkaroMessage) {
let status = message.get_str("status").unwrap();
let data = if status == "200 OK" {
......
This diff is collapsed.
use handler::*;
pub fn __on_received_message(message: message::SkaroMessage) {
let status = message.get_str("status").unwrap();
let from = message.get_obj("from").and_then(|s| s.to_json()).unwrap();
let from = if status == "200 OK" {
message.get_obj("from").and_then(|s| s.to_json()).unwrap()
} else {
"".to_string()
};
let c_status = CString::new(status).unwrap();
let c_info = CString::new(message.get_str("info").unwrap_or("")).unwrap();
let c_mid = message.get_int("mid").unwrap_or(0);
let c_date = CString::new(message.get_str("date").unwrap_or("")).unwrap();
let c_from = CString::new(from).unwrap();
let c_body = CString::new(message.get_str("body").unwrap_or("")).unwrap();
unsafe {
skaro_on_received_message(c_status.as_ptr(),
c_info.as_ptr(),
c_mid,
c_date.as_ptr(),
c_from.as_ptr(),
c_body.as_ptr());
skaro_on_received_message(c_mid, c_date.as_ptr(), c_from.as_ptr(), c_body.as_ptr());
}
}
......@@ -6,8 +6,9 @@ use handler::*;
pub fn register(email: &str, login: &str, password: &str) -> Result<Vec<u8>, serde_cbor::Error> {
let mut storage = STORAGE.lock().unwrap();
let mut storage_data = HashMap::new();
storage_data.insert("type", "register".to_string());
let mut storage_data: HashMap<String, String> = HashMap::new();
storage_data.insert("type".to_string(), "register".to_string());
storage_data.insert("login".to_string(), login.to_string());
// 1. Клиент выбирает себе логин и пароль
// 2. Клиент генерирует ключевую пару RSA.
......@@ -21,8 +22,8 @@ pub fn register(email: &str, login: &str, password: &str) -> Result<Vec<u8>, ser
// 4. Клиент сохраняет в локальном хранилище
// свой публичный ключ и запароленный приватный ключ
let public_key_string = String::from_utf8(public_key).expect("Found invalid UTF-8");
storage_data.insert("public_key", public_key_string.clone());
storage_data.insert("private_key",
storage_data.insert("public_key".to_string(), public_key_string.clone());
storage_data.insert("private_key".to_string(),
String::from_utf8(private_key).expect("Found invalid UTF-8"));
// 5. Клиент отсылает на сервер, а сервер сохраняет:
......@@ -39,15 +40,16 @@ pub fn register(email: &str, login: &str, password: &str) -> Result<Vec<u8>, ser
serde_cbor::to_vec(&response)
}
pub fn __on_register(message: message::SkaroMessage,
mut storage: MutexGuard<HashMap<String, HashMap<&'static str, String>>>,
data: &HashMap<&'static str, String>) {
storage.remove(message.get_str("chain_uuid").unwrap());
pub fn __on_register(message: message::SkaroMessage, data: &HashMap<String, String>) {
let status = message.get_str("status").unwrap();
let login = data.get("login").unwrap();
let c_login = CString::new(login.to_string()).unwrap();
if status == "200 OK" {
unsafe {
skaro_export_keys(CStr::from_bytes_with_nul_unchecked(data.get("private_key")
skaro_export_keys(c_login.as_ptr(),
CStr::from_bytes_with_nul_unchecked(data.get("private_key")
.unwrap()
.as_bytes())
.as_ptr(),
......@@ -59,7 +61,7 @@ pub fn __on_register(message: message::SkaroMessage,
}
let c_status = CString::new(status).unwrap();
let c_info = CString::new(message.get_str("info").unwrap()).unwrap();
let c_info = CString::new(message.get_str("info").unwrap_or("")).unwrap();
unsafe {
skaro_on_register(c_status.as_ptr(), c_info.as_ptr());
......
......@@ -2,8 +2,8 @@ use handler::*;
pub fn register_type() -> Result<Vec<u8>, serde_cbor::Error> {
let mut storage = STORAGE.lock().unwrap();
let mut storage_data = HashMap::new();
storage_data.insert("type", "register_type".to_string());
let mut storage_data: HashMap<String, String> = HashMap::new();
storage_data.insert("type".to_string(), "register_type".to_string());
let mut response = HashMap::new();
let uuid = Uuid::new_v4().hyphenated().to_string();
......@@ -14,10 +14,7 @@ pub fn register_type() -> Result<Vec<u8>, serde_cbor::Error> {
serde_cbor::to_vec(&response)
}
pub fn __on_register_type(message: message::SkaroMessage,
mut storage: MutexGuard<HashMap<String, HashMap<&'static str, String>>>) {
storage.remove(message.get_str("chain_uuid").unwrap());
pub fn __on_register_type(message: message::SkaroMessage) {
let c_status = CString::new(message.get_str("status").unwrap()).unwrap();
let c_info = CString::new(message.get_str("info").unwrap_or("")).unwrap();
let c_register_type = CString::new(message.get_str("register_type").unwrap_or("")).unwrap();
......
......@@ -2,8 +2,8 @@ use handler::*;
pub fn search_contacts(query: &str) -> Result<Vec<u8>, serde_cbor::Error> {
let mut storage = STORAGE.lock().unwrap();
let mut storage_data = HashMap::new();
storage_data.insert("type", "search_contacts".to_string());
let mut storage_data: HashMap<String, String> = HashMap::new();
storage_data.insert("type".to_string(), "search_contacts".to_string());
let mut response = HashMap::new();
let uuid = Uuid::new_v4().hyphenated().to_string();
......@@ -15,11 +15,7 @@ pub fn search_contacts(query: &str) -> Result<Vec<u8>, serde_cbor::Error> {
serde_cbor::to_vec(&response)
}
pub fn __on_search_contacts(message: message::SkaroMessage,
mut storage: MutexGuard<HashMap<String,
HashMap<&'static str, String>>>) {
storage.remove(message.get_str("chain_uuid").unwrap());
pub fn __on_search_contacts(message: message::SkaroMessage) {
let status = message.get_str("status").unwrap();
let data = if status == "200 OK" {
......
......@@ -2,11 +2,14 @@ use handler::*;
pub fn send_message(to: &str,
body: &str,
is_conference: bool)
is_conference: bool,
marker: &str)
-> Result<Vec<u8>, serde_cbor::Error> {
let mut storage = STORAGE.lock().unwrap();
let mut storage_data = HashMap::new();
storage_data.insert("type", "send_message".to_string());
let mut storage_data: HashMap<String, String> = HashMap::new();
storage_data.insert("type".to_string(), "send_message".to_string());
storage_data.insert("marker".to_string(), marker.to_string());
storage_data.insert("login".to_string(), to.to_string());
let mut response = HashMap::new();
let uuid = Uuid::new_v4().hyphenated().to_string();
......@@ -20,18 +23,25 @@ pub fn send_message(to: &str,
serde_cbor::to_vec(&response)
}
pub fn __on_send_message(message: message::SkaroMessage,
mut storage: MutexGuard<HashMap<String, HashMap<&'static str, String>>>) {
storage.remove(message.get_str("chain_uuid").unwrap());
pub fn __on_send_message(message: message::SkaroMessage, data: &HashMap<String, String>) {
let status = message.get_str("status").unwrap();
let marker = data.get("marker").unwrap_or(&"".to_string()).to_owned();
let login = data.get("login").unwrap_or(&"".to_string()).to_owned();
let c_status = CString::new(status).unwrap();
let c_info = CString::new(message.get_str("info").unwrap_or("")).unwrap();
let c_mid = message.get_int("mid").unwrap_or(0);
let c_date = CString::new(message.get_str("date").unwrap_or("")).unwrap();
let c_login = CString::new(login).unwrap();
let c_marker = CString::new(marker).unwrap();
unsafe {
skaro_on_send_message(c_status.as_ptr(), c_info.as_ptr(), c_mid, c_date.as_ptr());
skaro_on_send_message(c_status.as_ptr(),
c_info.as_ptr(),
c_mid,
c_date.as_ptr(),
c_login.as_ptr(),
c_marker.as_ptr());
}
}
......@@ -2,8 +2,8 @@ use handler::*;
pub fn session_restore(session_id: &str) -> Result<Vec<u8>, serde_cbor::Error> {
let mut storage = STORAGE.lock().unwrap();
let mut storage_data = HashMap::new();
storage_data.insert("type", "session_restore".to_string());
let mut storage_data: HashMap<String, String> = HashMap::new();
storage_data.insert("type".to_string(), "session_restore".to_string());
let mut response = HashMap::new();
let uuid = Uuid::new_v4().hyphenated().to_string();
......@@ -15,11 +15,7 @@ pub fn session_restore(session_id: &str) -> Result<Vec<u8>, serde_cbor::Error> {
serde_cbor::to_vec(&response)
}
pub fn __on_session_restore(message: message::SkaroMessage,
mut storage: MutexGuard<HashMap<String,
HashMap<&'static str, String>>>) {
storage.remove(message.get_str("chain_uuid").unwrap());
pub fn __on_session_restore(message: message::SkaroMessage) {
let status = message.get_str("status").unwrap();
let data = if status == "200 OK" {
......
use serde_json;
use handler::*;
pub fn update_my_data(records: &str) -> Result<Vec<u8>, serde_cbor::Error> {
let mut storage = STORAGE.lock().unwrap();
let mut storage_data = HashMap::new();
storage_data.insert("type", "update_my_data".to_string());
let mut storage_data: HashMap<String, String> = HashMap::new();
storage_data.insert("type".to_string(), "update_my_data".to_string());
storage_data.insert("records".to_string(), records.to_string());
let records_json: Value = serde_json::from_str(records).unwrap();
let mut response = HashMap::new();
let uuid = Uuid::new_v4().hyphenated().to_string();
response.insert("chain_uuid", Value::String(uuid.clone()));
response.insert("type", Value::String("update_my_data".to_string()));
response.insert("records", Value::String(records.to_string()));
response.insert("update", records_json);
storage.insert(uuid, storage_data);
serde_cbor::to_vec(&response)
}
pub fn __on_update_my_data(message: message::SkaroMessage,
mut storage: MutexGuard<HashMap<String,
HashMap<&'static str, String>>>) {
storage.remove(message.get_str("chain_uuid").unwrap());
pub fn __on_update_my_data(message: message::SkaroMessage, data: &HashMap<String, String>) {
let status = message.get_str("status").unwrap();
let records = data.get("records").unwrap_or(&"".to_string()).to_owned();
let c_status = CString::new(status).unwrap();
let c_info = CString::new(message.get_str("info").unwrap_or("")).unwrap();
let c_records = CString::new(records).unwrap();
unsafe {
skaro_on_update_my_data(c_status.as_ptr(), c_info.as_ptr());
skaro_on_update_my_data(c_status.as_ptr(), c_info.as_ptr(), c_records.as_ptr());
}
}
......@@ -98,9 +98,9 @@ pub extern "C" fn skaro_authorize(handle: *mut std::sync::mpsc::Sender<websocket
let password: &str = unsafe { CStr::from_ptr(c_password) }.to_str().unwrap();
let _ = s.send(websocket::OwnedMessage::Binary(handler::authorize::authorize(login,
private_key,
password)
.unwrap()));
private_key,
password)
.unwrap()));
}
None => {
println!("null ptr");
......@@ -166,9 +166,9 @@ pub extern "C" fn skaro_register(handle: *mut std::sync::mpsc::Sender<websocket:
let password: &str = unsafe { CStr::from_ptr(c_password) }.to_str().unwrap();
let _ = s.send(websocket::OwnedMessage::Binary(handler::register::register(email,
login,
password)
.unwrap()));
login,
password)
.unwrap()));
}
None => {
println!("null ptr");
......@@ -232,7 +232,7 @@ pub extern "C" fn skaro_get_contacts(
match maybe_channel {
Some(s) => {
let _ = s.send(websocket::OwnedMessage::Binary(handler::get_contacts::get_contacts()
.unwrap()));
.unwrap()));
}
None => {
println!("null ptr");
......@@ -386,8 +386,7 @@ pub extern "C" fn skaro_get_user_data(
/// ```
#[no_mangle]
pub extern "C" fn skaro_get_history(handle: *mut std::sync::mpsc::Sender<websocket::OwnedMessage>,
c_login: *const c_char,
is_conference: bool) {
c_login: *const c_char) {
let maybe_channel = unsafe { handle.as_mut() };
......@@ -396,8 +395,7 @@ pub extern "C" fn skaro_get_history(handle: *mut std::sync::mpsc::Sender<websock
let login: &str = unsafe { CStr::from_ptr(c_login) }.to_str().unwrap();
let _ = s.send(websocket::OwnedMessage::Binary(
::handler::get_history::get_history(login, is_conference)
.unwrap()));
::handler::get_history::get_history(login).unwrap()));
}
None => {
println!("null ptr");
......@@ -405,24 +403,27 @@ pub extern "C" fn skaro_get_history(handle: *mut std::sync::mpsc::Sender<websock
};
}
/// The fifth argument specifies the UUID string to be returned when the server responds.
///
/// ## Example (C)
/// ### Headers
///
/// ```ignore
/// void skaro_send_message(handle, const char*, const char*, bool);
/// void skaro_send_message(handle, const char*, const char*, bool, const char*);
/// ```
///
/// ### Implementation
///
/// ```ignore
/// skaro_send_message(x, "login", "message", false);
/// skaro_send_message(x, "login", "message", false, "23bccb5a-1433-4429-ad60-93a33393b82e");
/// ```
#[no_mangle]
pub extern "C" fn skaro_send_message(
handle: *mut std::sync::mpsc::Sender<websocket::OwnedMessage>,
c_to: *const c_char,
c_body: *const c_char,
is_conference: bool
is_conference: bool,
c_marker: *const c_char
) {
let maybe_channel = unsafe { handle.as_mut() };
......@@ -431,9 +432,10 @@ pub extern "C" fn skaro_send_message(
Some(s) => {
let to: &str = unsafe { CStr::from_ptr(c_to) }.to_str().unwrap();
let body: &str = unsafe { CStr::from_ptr(c_body) }.to_str().unwrap();
let marker: &str = unsafe { CStr::from_ptr(c_marker) }.to_str().unwrap();
let _ = s.send(websocket::OwnedMessage::Binary(
::handler::send_message::send_message(to, body, is_conference)
::handler::send_message::send_message(to, body, is_conference, marker)
.unwrap()));
}
None => {
......@@ -446,13 +448,13 @@ pub extern "C" fn skaro_send_message(
/// ### Headers
///
/// ```ignore
/// void skaro_get_user_data(handle, const char*);
/// void skaro_update_my_data(handle, const char*);
/// ```
///
/// ### Implementation
///
/// ```ignore
/// skaro_get_user_data(x, "{\"login\": \"newlogin\"}");
/// skaro_update_my_data(x, "{\"login\": \"newlogin\"}");
/// ```
#[no_mangle]
pub extern "C" fn skaro_update_my_data(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment