renamed why2_config_read to why2_toml_read
idk why i didnt do this at first
This commit is contained in:
parent
8f3a45f3ef
commit
492563ee40
@ -40,8 +40,8 @@ extern "C" {
|
||||
void why2_chat_init_server_config(void); //CHECK IF SERVER CONFIG EXISTS, CREATE IT
|
||||
void why2_chat_init_client_config(void); //Dementia is a term used to describe a group of symptoms affecting memory, thinking and social abilities. In people who have dementia, the symptoms interfere with their daily lives. Dementia isn't one specific disease. Several diseases can cause dementia. ...
|
||||
|
||||
char *why2_config_read(const char* path, const char* key);
|
||||
void why2_config_read_free(char* s);
|
||||
char *why2_toml_read(const char* path, const char* key);
|
||||
void why2_toml_read_free(char* s);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ use std::
|
||||
};
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn why2_config_read(path: *const c_char, key: *const c_char) -> *mut c_char
|
||||
pub extern "C" fn why2_toml_read(path: *const c_char, key: *const c_char) -> *mut c_char
|
||||
{
|
||||
//CONVERT C STRINGS TO
|
||||
let path_r = unsafe { CStr::from_ptr(path).to_string_lossy().into_owned() };
|
||||
@ -62,7 +62,7 @@ pub extern "C" fn why2_config_read(path: *const c_char, key: *const c_char) -> *
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn why2_config_read_free(s: *mut c_char) //BECAUSE THIS IS RUST MODULE I HAVE TO CREATE A DEALLOCATING FUNCTION
|
||||
pub extern "C" fn why2_toml_read_free(s: *mut c_char) //BECAUSE THIS IS RUST MODULE I HAVE TO CREATE A DEALLOCATING FUNCTION
|
||||
{
|
||||
unsafe //DON'T TRUST THIS, I DEFINITELY KNOW WHAT I'M DOING (idk)
|
||||
{
|
||||
|
@ -304,7 +304,7 @@ void *why2_communicate_thread(void *arg)
|
||||
|
||||
//GET USERNAME
|
||||
char *string_buffer = why2_replace(WHY2_CHAT_CONFIG_DIR "/" WHY2_CHAT_CONFIG_SERVER, "{USER}", getenv("USER"));
|
||||
char *config_username = why2_config_read(string_buffer, "user_pick_username");
|
||||
char *config_username = why2_toml_read(string_buffer, "user_pick_username");
|
||||
|
||||
if (config_username == NULL || strcmp(config_username, "true") == 0)
|
||||
{
|
||||
@ -317,7 +317,7 @@ void *why2_communicate_thread(void *arg)
|
||||
}
|
||||
|
||||
why2_deallocate(string_buffer);
|
||||
why2_config_read_free(config_username);
|
||||
why2_toml_read_free(config_username);
|
||||
|
||||
void *buffer;
|
||||
char *received = NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user