From e06a2374915f3d1da34e4233c962d44be591abfa Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Sun, 1 Sep 2024 20:57:29 +0200 Subject: [PATCH] replaced asking_password with boolean --- include/chat/flags.h | 6 ++++-- src/chat/flags.c | 10 +++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/include/chat/flags.h b/include/chat/flags.h index dbca5ca..c864972 100644 --- a/include/chat/flags.h +++ b/include/chat/flags.h @@ -23,6 +23,8 @@ along with this program. If not, see . extern "C" { #endif +#include + //MACROS #define WHY2_SA struct sockaddr #define WHY2_CHAT_SERVER_PORT 1204 //PORT @@ -61,8 +63,8 @@ extern "C" { #define WHY2_CHAT_CODE_SSQC WHY2_CHAT_CODE_SERVER_SIDE_QUIT_COMMUNICATION //FUNCTIONS -void __why2_increment_asking_password(unsigned char asking_password); //IF HASH SHOULD BE SENT INSTEAD OF NORMAL MESSAGE -void __why2_reset_asking_password(); +void __why2_set_asking_password(why2_bool value); //IF HASH SHOULD BE SENT INSTEAD OF NORMAL MESSAGE +why2_bool __why2_get_asking_password(); #ifdef __cplusplus } diff --git a/src/chat/flags.c b/src/chat/flags.c index 48bcdb0..6126dca 100644 --- a/src/chat/flags.c +++ b/src/chat/flags.c @@ -18,14 +18,14 @@ along with this program. If not, see . #include -unsigned char asking_password = 0; +why2_bool asking_password = 0; -void __why2_increment_asking_password() +void __why2_set_asking_password(why2_bool value) { - asking_password++; + asking_password = value; } -void __why2_reset_asking_password() +why2_bool __why2_get_asking_password() { - asking_password = 0; + return asking_password; } \ No newline at end of file