renamed boolean typedef to why2_bool
to prevent from conflicts
This commit is contained in:
parent
5c50174212
commit
5524a4b6e5
@ -50,13 +50,13 @@ const enum EXIT_CODES //exit codes you fucking idiot
|
||||
#define UNUSED __attribute__((unused)) //SAME COMMENT AS DEPRECATED'S
|
||||
|
||||
//TYPES
|
||||
typedef char boolean; //READ THE NAME OR I WILL FIND YOU AND FUCK YOUR MOTHERFUCKING DOG!!!
|
||||
typedef char why2_bool; //READ THE NAME OR I WILL FIND YOU AND FUCK YOUR MOTHERFUCKING DOG!!!
|
||||
typedef int (*encryptionOperation_type_cb)(int, int); //TYPE FOR encryptionOperation CALLBACK
|
||||
typedef struct
|
||||
{
|
||||
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
|
||||
why2_bool noCheck; //BOOLEAN FOR SKIPPING VERSION CHECK
|
||||
why2_bool noOutput; //BOOLEAN FOR NOT PRINTING OUTPUT WHEN ENCRYPTING/DECRYPTING
|
||||
why2_bool update; //BOOLEAN FOR UPDATING YOUR WHY VERSION IF OLD IS USED
|
||||
} inputFlags;
|
||||
|
||||
typedef struct
|
||||
@ -66,7 +66,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
|
||||
boolean exitCode; //VARIABLE FOR EXIT CODE
|
||||
why2_bool exitCode; //VARIABLE FOR EXIT CODE
|
||||
} outputFlags;
|
||||
|
||||
//NOTE: Variables were moved to 'flags.c' to force y'all using getters
|
||||
@ -76,9 +76,9 @@ char getEncryptionSeparator(void);
|
||||
unsigned long getKeyLength(void);
|
||||
inputFlags getDefaultFlags(void); //THIS GENERATES inputFlags WITH DEFAULT VALUES
|
||||
inputFlags getFlags(void); //RETURNS USED FLAGS
|
||||
outputFlags noOutput(boolean exitCode); //SAME AS getDefaultFlags() BUT FOR outputFlags
|
||||
outputFlags noOutput(why2_bool exitCode); //SAME AS getDefaultFlags() BUT FOR outputFlags
|
||||
encryptionOperation_type_cb getEncryptionOperation(void); //RETURNS FUNCTION WHICH IS USED FOR ENCRYPTION & DECRYPTION
|
||||
boolean getFlagsChanged(void);
|
||||
why2_bool getFlagsChanged(void);
|
||||
|
||||
//SETTERS
|
||||
void setEncryptionSeparator(char encryptionSeparatorNew);
|
||||
|
@ -26,9 +26,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
void generateTextKeyChain(char *key, int *textKeyChain, int textKeyChainSize); //GENERATES ARRAY FOR ENCRYPTION/DECRYPTION
|
||||
void generateKey(char *key, int keyLength); //GENERATE ENCRYPTION KEY
|
||||
void deallocateOutput(outputFlags flags); //DEALLOCATES flags
|
||||
boolean checkVersion(void); //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
|
||||
why2_bool checkVersion(void); //THIS FUNCTION CHECKS IF LATEST VERSION OF WHY2 IS USED
|
||||
why2_bool checkKey(char *key); //CHECKS IF KEY IS VALID
|
||||
why2_bool 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
|
||||
|
@ -30,7 +30,7 @@ char encryptionSeparator = '.'; //NOPE > DO NOT TOUCH THIS, USE setEncryptio
|
||||
unsigned long keyLength = 50; //LENGTH OF KEY > DO NOT TOUCH THIS, USE setKeyLength instead <
|
||||
inputFlags flagsAllah = DEFAULT_FLAGS; //IT IS CALLED flagsAllah CUZ flags CAUSED SOME FUCKING MEMORY PROBLEMS
|
||||
encryptionOperation_type_cb encryptionOperation_cb = encryptionOperation;
|
||||
boolean flagsChanged = 0; //CHANGES TO 1 WHEN U USE setFlags
|
||||
why2_bool flagsChanged = 0; //CHANGES TO 1 WHEN U USE setFlags
|
||||
|
||||
//GETTERS
|
||||
char getEncryptionSeparator(void)
|
||||
@ -53,7 +53,7 @@ inputFlags getFlags(void)
|
||||
return flagsAllah;
|
||||
}
|
||||
|
||||
outputFlags noOutput(boolean exitCode)
|
||||
outputFlags noOutput(why2_bool exitCode)
|
||||
{
|
||||
char *emptyText = malloc(1); //TEXT
|
||||
emptyText[0] = '\0';
|
||||
@ -73,7 +73,7 @@ encryptionOperation_type_cb getEncryptionOperation(void)
|
||||
return encryptionOperation_cb;
|
||||
}
|
||||
|
||||
boolean getFlagsChanged(void)
|
||||
why2_bool getFlagsChanged(void)
|
||||
{
|
||||
return flagsChanged;
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include <why2/flags.h>
|
||||
|
||||
boolean seedSet = 0; //DO NOT FUCKING TOUCH THIS!!!
|
||||
why2_bool seedSet = 0; //DO NOT FUCKING TOUCH THIS!!!
|
||||
|
||||
double multiply_cb(int a, int b) { return a * b; }
|
||||
double subtract_cb(int a, int b) { return a - b; }
|
||||
@ -87,7 +87,7 @@ char *replaceWord(char *string, char *old, char *new) //CODE FROM: https://www.g
|
||||
return result;
|
||||
}
|
||||
|
||||
boolean checkVersion(void)
|
||||
why2_bool checkVersion(void)
|
||||
{
|
||||
if (getFlags().noCheck) return SUCCESS;
|
||||
|
||||
@ -319,7 +319,7 @@ void deallocateOutput(outputFlags flags)
|
||||
flags.usedKey = NULL;
|
||||
}
|
||||
|
||||
boolean checkKey(char *key)
|
||||
why2_bool checkKey(char *key)
|
||||
{
|
||||
if (strlen(key) < getKeyLength())
|
||||
{
|
||||
@ -330,7 +330,7 @@ boolean checkKey(char *key)
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
boolean checkText(char *text)
|
||||
why2_bool checkText(char *text)
|
||||
{
|
||||
if (strcmp(text, "") == 0)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user