created anon fns for core-flags changed vars

calling sets flag without changing flag_changed variable
This commit is contained in:
Václav Šmejkal 2025-01-13 19:54:44 +01:00
parent 9e5016feb7
commit 520f8bce34
Signed by: ENGO150
GPG Key ID: 4A57E86482968843
2 changed files with 16 additions and 4 deletions

View File

@ -111,10 +111,12 @@ char *why2_get_default_memory_identifier(void);
//SETTERS
void why2_set_encryption_separator(char encryption_separator_new);
void why2_set_key_length(int keyLengthNew);
void why2_set_flags(why2_input_flags newFlags); //.... whatcha think?
void why2_set_flags(why2_input_flags new_flags); //.... whatcha think?
void __why2_set_flags_anon(why2_input_flags new_flags); //DO NOT CHANGE flags_changed ON USAGE
void why2_set_encryption_operation(why2_encryption_operation_cb newEncryptionOperation); //are you that dumb?
void why2_set_memory_identifier(char *new_memory_identifier);
void why2_set_padding(unsigned long padding); //SET PADDING RATE WITHOUT REWRITING INPUT FLAGS
void __why2_set_padding_anon(unsigned long padding);
void why2_reset_memory_identifier(void); //hmmm, what could reset mean.... huh

View File

@ -132,9 +132,9 @@ void why2_set_key_length(int keyLengthNew)
keyLength = keyLengthNew;
}
void why2_set_flags(why2_input_flags newFlags)
void why2_set_flags(why2_input_flags new_flags)
{
used_flags = newFlags;
__why2_set_flags_anon(new_flags);
if (!flags_changed)
{
@ -143,6 +143,11 @@ void why2_set_flags(why2_input_flags newFlags)
}
}
void __why2_set_flags_anon(why2_input_flags new_flags)
{
used_flags = new_flags;
}
void why2_set_encryption_operation(why2_encryption_operation_cb newEncryptionOperation)
{
encryptionOperation_cb = newEncryptionOperation;
@ -157,10 +162,15 @@ void why2_set_memory_identifier(char *new_memory_identifier)
void why2_set_padding(unsigned long padding)
{
used_flags.padding = padding;
__why2_set_padding_anon(padding);
if (!padding_changed) padding_changed = 1;
}
void __why2_set_padding_anon(unsigned long padding)
{
used_flags.padding = padding;
}
void why2_reset_memory_identifier(void)
{
why2_list_remove_back(&identifier_list);