Add progress dialog

This commit is contained in:
Xpl0itU 2023-07-18 17:50:11 +02:00
parent cb0510931e
commit f8a15b1d5b
7 changed files with 170 additions and 32 deletions

View file

@ -346,7 +346,7 @@ out:
}
#undef BLOCK_SIZE
int cdecrypt_main(int argc, char **argv) {
int cdecrypt_main(int argc, char **argv, int *progress) {
int r = EXIT_FAILURE;
char str[PATH_MAX], *tmd_path = NULL, *tik_path = NULL;
FILE *src = NULL;
@ -526,6 +526,7 @@ int cdecrypt_main(int argc, char **argv) {
uint32_t level = 0;
for (uint32_t i = 1; i < entries; i++) {
*progress = (i * 100) / entries;
if (level > 0) {
while ((level >= 1) && (l_entry[level - 1] == i))
level--;