replaced _Bool with boolean typedef
basically char but it looks good and smart now
This commit is contained in:
parent
344c9eb296
commit
a40f9637f0
@ -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);
|
||||
|
@ -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
|
||||
|
@ -31,7 +31,7 @@ inputFlags getFlags()
|
||||
return flags;
|
||||
}
|
||||
|
||||
outputFlags noOutput(_Bool exitCode)
|
||||
outputFlags noOutput(boolean exitCode)
|
||||
{
|
||||
char *emptyText = malloc(1); //TEXT
|
||||
emptyText[0] = '\0';
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user