diff --git a/include/flags.h b/include/flags.h index 7c670d4..48f88bd 100644 --- a/include/flags.h +++ b/include/flags.h @@ -31,11 +31,13 @@ const enum EXIT_CODES //exit codes you fucking idiot #define DEPRECATED __attribute__((deprecated)) //SAME COMMENT AS VERSIONS_NAME'S #define UNUSED __attribute__((unused)) //SAME COMMENT AS DEPRECATED'S +typedef char boolean; + typedef struct { - _Bool noCheck; //BOOLEAN FOR SKIPPING VERSION CHECK - _Bool noOutput; //BOOLEAN FOR NOT PRINTING OUTPUT WHEN ENCRYPTING/DECRYPTING - _Bool update; //BOOLEAN FOR UPDATING YOUR WHY VERSION IF OLD IS USED + boolean noCheck; //BOOLEAN FOR SKIPPING VERSION CHECK + boolean noOutput; //BOOLEAN FOR NOT PRINTING OUTPUT WHEN ENCRYPTING/DECRYPTING + boolean update; //BOOLEAN FOR UPDATING YOUR WHY VERSION IF OLD IS USED } inputFlags; typedef struct @@ -45,7 +47,7 @@ typedef struct unsigned long unusedKeySize; //VARIABLE FOR COUNT OF UNUSED CHARACTERS IN KEY unsigned long repeatedKeySize; //VARIABLE FOR COUNT OF REPEATED CHARACTERS IN KEY (basically reversed unusedKeySize) unsigned long elapsedTime; //VARIABLE FOR ELAPSED TIME IN MICROSECONDS => 1s = 1000000µs - _Bool exitCode; //VARIABLE FOR EXIT CODE + boolean exitCode; //VARIABLE FOR EXIT CODE } outputFlags; //NOTE: Variables were moved to 'flags.c' to force y'all using getters @@ -55,7 +57,7 @@ char getEncryptionSeparator(); unsigned long getKeyLength(); inputFlags defaultFlags(); //THIS GENERATES inputFlags WITH DEFAULT VALUES inputFlags getFlags(); //RETURNS USED FLAGS -outputFlags noOutput(_Bool exitCode); //SAME AS defaultFlags() BUT FOR outputFlags +outputFlags noOutput(boolean exitCode); //SAME AS defaultFlags() BUT FOR outputFlags //SETTERS void setEncryptionSeparator(char encryptionSeparatorNew); diff --git a/include/misc.h b/include/misc.h index b5029f8..5f86901 100644 --- a/include/misc.h +++ b/include/misc.h @@ -7,9 +7,9 @@ void generateTextKeyChain(char *key, int *textKeyChain, int textKeyChainSize); //GENERATES ARRAY FOR ENCRYPTION/DECRYPTION void deallocateOutput(outputFlags flags); //DEALLOCATES flags -_Bool checkVersion(); //THIS FUNCTION CHECKS IF LATEST VERSION OF WHY2 IS USED -_Bool checkKey(char *key); //CHECKS IF KEY IS VALID -_Bool checkText(char *text); //CHECKS IF TEXT IS VALID +boolean checkVersion(); //THIS FUNCTION CHECKS IF LATEST VERSION OF WHY2 IS USED +boolean checkKey(char *key); //CHECKS IF KEY IS VALID +boolean checkText(char *text); //CHECKS IF TEXT IS VALID unsigned long countIntLength(int number); //RETURNS LENGTH OF number unsigned long countUnusedKeySize(char *text, char *key); //COUNT unusedKeySize unsigned long countRepeatedKeySize(char *text, char *key); //COUNT repeatedKeySize diff --git a/src/lib/flags.c b/src/lib/flags.c index 48f2789..0b7fd19 100644 --- a/src/lib/flags.c +++ b/src/lib/flags.c @@ -31,7 +31,7 @@ inputFlags getFlags() return flags; } -outputFlags noOutput(_Bool exitCode) +outputFlags noOutput(boolean exitCode) { char *emptyText = malloc(1); //TEXT emptyText[0] = '\0'; diff --git a/src/lib/misc.c b/src/lib/misc.c index 68d7257..830695a 100644 --- a/src/lib/misc.c +++ b/src/lib/misc.c @@ -72,7 +72,7 @@ char *replaceWord(char *string, char *old, char *new) //CODE FROM: https://www.g return result; } -_Bool checkVersion() +boolean checkVersion() { if (getFlags().noCheck) return SUCCESS; @@ -300,7 +300,7 @@ void deallocateOutput(outputFlags flags) free(flags.usedKey); } -_Bool checkKey(char *key) +boolean checkKey(char *key) { if (strlen(key) < getKeyLength()) { @@ -311,7 +311,7 @@ _Bool checkKey(char *key) return SUCCESS; } -_Bool checkText(char *text) +boolean checkText(char *text) { if (strcmp(text, "") == 0) {