MCPcopy Create free account
hub / github.com/dborth/fceugx / LoadSzFile

Function LoadSzFile

source/fileop.cpp:814–841  ·  view source on GitHub ↗

* LoadSzFile * Loads the selected file # from the specified 7z into rbuffer * Returns file size ***************************************************************************/

Source from the content-addressed store, hash-verified

812 * Returns file size
813 ***************************************************************************/
814size_t
815LoadSzFile(char * filepath, unsigned char * rbuffer)
816{
817 size_t size = 0;
818
819 // stop checking if devices were removed/inserted
820 // since we're loading a file
821 HaltDeviceThread();
822
823 // halt parsing
824 HaltParseThread();
825
826 file = fopen (filepath, "rb");
827 if (file)
828 {
829 size = SzExtractFile(browserList[browser.selIndex].filenum, rbuffer);
830 fclose (file);
831 }
832 else
833 {
834 ErrorPrompt("Error opening file!");
835 }
836
837 // go back to checking if devices were inserted/removed
838 ResumeDeviceThread();
839
840 return size;
841}
842
843/****************************************************************************
844 * LoadFile

Callers 1

BrowserLoadFileFunction · 0.85

Calls 5

HaltDeviceThreadFunction · 0.85
HaltParseThreadFunction · 0.85
SzExtractFileFunction · 0.85
ErrorPromptFunction · 0.85
ResumeDeviceThreadFunction · 0.85

Tested by

no test coverage detected