From 8a7189c6bf446a8d56029a6fe8edab6f95e0a3dc Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Mon, 16 Feb 2026 16:47:30 +0600 Subject: [PATCH 1/2] Added new function --- source/libublsettings.c | 8 ++++++++ source/libublsettings.h | 17 ++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/source/libublsettings.c b/source/libublsettings.c index f7cf7cc..7c8fab2 100644 --- a/source/libublsettings.c +++ b/source/libublsettings.c @@ -35,6 +35,14 @@ float yon_size_convert_automatic(int bytes, int *size){ return byte_float; } +long yon_size_to_bytes(long size, int size_mod){ + long final = size; + for (int i=0;i Date: Tue, 17 Feb 2026 09:52:56 +0600 Subject: [PATCH 2/2] Added new functions --- source/libublsettings.c | 32 ++++++++++++++++++++++++++++++++ source/libublsettings.h | 4 ++++ 2 files changed, 36 insertions(+) diff --git a/source/libublsettings.c b/source/libublsettings.c index 7c8fab2..6289ad3 100644 --- a/source/libublsettings.c +++ b/source/libublsettings.c @@ -73,6 +73,38 @@ char *yon_size_get_mod(int size){ return size_modifier; } +double yon_size_long_convert_to_mod(double size, char mod){ + int sizemod = yon_get_size_get_from_letter(mod); + double final_size = size; + for (int i=-1;i1024;repeats++){ + byte_float=byte_float/1024; + } + if (repeats==-1) { + repeats=0; + byte_float=byte_float/1024; + } + switch(repeats){ + case 0: (*size)='K'; + break; + case 1: (*size)='M'; + break; + case 2: (*size)='G'; + break; + case 3: (*size)='T'; + break; + } + return byte_float; +} + config_str yon_dir_get_contents(char *dir_path, int *size){ config_str dir = NULL; *size=0; diff --git a/source/libublsettings.h b/source/libublsettings.h index 1fd1bf4..543f44f 100644 --- a/source/libublsettings.h +++ b/source/libublsettings.h @@ -1084,6 +1084,10 @@ int yon_get_size_get_from_letter(char size); */ char *yon_size_get_mod(int size); +double yon_size_long_convert_to_mod(double size, char mod); + +double yon_size_long_convert_automatic(unsigned long bytes, char *size); + /**yon_file_path_proceed_spaces(char *path) * [EN] * -- 2.35.1