From e85a14b2530d6c8a39be946f691a0f9047d38f73 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Tue, 3 May 2022 18:36:44 +0200 Subject: [PATCH] created getter & setter for keyLength (replacement for KEY_LENGTH) --- include/flags.h | 5 ++++- src/flags.c | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/include/flags.h b/include/flags.h index 43e7c86..5706353 100644 --- a/include/flags.h +++ b/include/flags.h @@ -2,7 +2,6 @@ #define WHY2_FLAGS_H //CONSTS -#define KEY_LENGTH 50 #define ENCRYPTION_SEPARATOR '.' #define ENCRYPTION_SEPARATOR_STRING "." @@ -13,10 +12,14 @@ #define VERSIONS_NAME "versions.json" //VARIABLES +static int keyLength = 50; static int skipCheck = 0; //FUNCTIONS int getSkipCheck(); void setSkipCheck(int skipCheckNew); +int getKeyLength(); +void setKeyLength(int keyLengthNew); + #endif diff --git a/src/flags.c b/src/flags.c index 6d43a2d..cd90ca0 100644 --- a/src/flags.c +++ b/src/flags.c @@ -8,4 +8,14 @@ int getSkipCheck() void setSkipCheck(int skipCheckNew) { skipCheck = skipCheckNew; +} + +int getKeyLength() +{ + return keyLength; +} + +void setKeyLength(int keyLengthNew) +{ + keyLength = keyLengthNew; } \ No newline at end of file