MCPcopy Create free account
hub / github.com/TheOfficialFloW/VitaShell / export_thread

Function export_thread

io_process.c:547–663  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

545}
546
547int export_thread(SceSize args_size, ExportArguments *args) {
548 SceUID thid = -1;
549
550 // Lock power timers
551 powerLock();
552
553 // Set progress to 0%
554 sceMsgDialogProgressBarSetValue(SCE_MSG_DIALOG_PROGRESSBAR_TARGET_BAR_DEFAULT, 0);
555 sceKernelDelayThread(DIALOG_WAIT); // Needed to see the percentage
556
557 FileListEntry *file_entry = fileListGetNthEntry(args->file_list, args->index);
558
559 int count = 0;
560 FileListEntry *head = NULL;
561 FileListEntry *mark_entry_one = NULL;
562
563 if (fileListFindEntry(args->mark_list, file_entry->name)) { // On marked entry
564 count = args->mark_list->length;
565 head = args->mark_list->head;
566 } else {
567 count = 1;
568 mark_entry_one = fileListCopyEntry(file_entry);
569 head = mark_entry_one;
570 }
571
572 char path[MAX_PATH_LENGTH];
573 FileListEntry *mark_entry = NULL;
574
575 // Get paths info
576 uint64_t size = 0;
577 uint32_t files = 0;
578
579 mark_entry = head;
580
581 int i;
582 for (i = 0; i < count; i++) {
583 snprintf(path, MAX_PATH_LENGTH, "%s%s", args->file_list->path, mark_entry->name);
584 getPathInfo(path, &size, NULL, &files, mediaPathHandler);
585 mark_entry = mark_entry->next;
586 }
587
588 // No media files
589 if (size == 0) {
590 closeWaitDialog();
591 infoDialog(language_container[EXPORT_NO_MEDIA]);
592 goto EXIT;
593 }
594
595 // Check memory card free space
596 if (checkMemoryCardFreeSpace("ux0:", size))
597 goto EXIT;
598
599 // Update thread
600 thid = createStartUpdateThread(size, 0);
601
602 // Export process
603 uint64_t value = 0;
604 uint32_t songs = 0, videos = 0, pictures = 0;

Callers

nothing calls this directly

Calls 14

powerLockFunction · 0.85
fileListGetNthEntryFunction · 0.85
fileListFindEntryFunction · 0.85
fileListCopyEntryFunction · 0.85
getPathInfoFunction · 0.85
closeWaitDialogFunction · 0.85
infoDialogFunction · 0.85
checkMemoryCardFreeSpaceFunction · 0.85
createStartUpdateThreadFunction · 0.85
exportPathFunction · 0.85
setDialogStepFunction · 0.85

Tested by

no test coverage detected