MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / BFD_AsyncReadStatus

Function BFD_AsyncReadStatus

src/SB/Core/x/xbinio.cpp:665–720  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

663}
664
665static en_BIO_ASYNC_ERRCODES BFD_AsyncReadStatus(st_FILELOADINFO* fli)
666{
667 en_BIO_ASYNC_ERRCODES status;
668 st_BINIO_XTRADATA* xtra = (st_BINIO_XTRADATA*)fli->xtradata;
669
670 if (!g_async_context)
671 {
672 status = BINIO_ASYNC_NOOP;
673 }
674 else if (xtra != g_async_context)
675 {
676 status = BINIO_ASYNC_INPROG;
677 }
678 else
679 {
680 if (xtra->asyn_status == BINIO_ASYNC_INPROG)
681 {
682 XFILE_READSECTOR_STATUS xrdstat;
683 S32 amtsofar = 0;
684
685 xrdstat = xFileReadAsyncStatus(xtra->gcaskey, &amtsofar);
686
687 switch (xrdstat)
688 {
689 case XFILE_RDSTAT_INPROG:
690 case XFILE_RDSTAT_QUEUED:
691 {
692 xtra->asyn_status = BINIO_ASYNC_INPROG;
693 break;
694 }
695 case XFILE_RDSTAT_DONE:
696 {
697 xtra->asyn_status = BINIO_ASYNC_DONE;
698 break;
699 }
700 case XFILE_RDSTAT_FAIL:
701 case XFILE_RDSTAT_EXPIRED:
702 default:
703 {
704 xtra->asyn_status = BINIO_ASYNC_FAIL;
705 break;
706 }
707 }
708 }
709
710 status = xtra->asyn_status;
711
712 if (status == BINIO_ASYNC_FAIL || status == BINIO_ASYNC_DONE)
713 {
714 xtra->asyn_status = BINIO_ASYNC_NOOP;
715 g_async_context = NULL;
716 }
717 }
718
719 return status;
720}

Callers 1

AsyncReadStatusFunction · 0.70

Calls 1

xFileReadAsyncStatusFunction · 0.85

Tested by

no test coverage detected