From 492563ee400f812d48307a76457c8b5d6e24149f Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Wed, 24 Jan 2024 12:17:45 +0100 Subject: [PATCH] renamed why2_config_read to why2_toml_read idk why i didnt do this at first --- include/chat/config.h | 4 ++-- src/chat/config/src/lib.rs | 4 ++-- src/chat/misc.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/chat/config.h b/include/chat/config.h index 6c6f857..7bbe825 100644 --- a/include/chat/config.h +++ b/include/chat/config.h @@ -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 } diff --git a/src/chat/config/src/lib.rs b/src/chat/config/src/lib.rs index a9abe7f..85c167e 100644 --- a/src/chat/config/src/lib.rs +++ b/src/chat/config/src/lib.rs @@ -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) { diff --git a/src/chat/misc.c b/src/chat/misc.c index f4c36f1..4b65654 100644 --- a/src/chat/misc.c +++ b/src/chat/misc.c @@ -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;