* LoadSzFile * Loads the selected file # from the specified 7z into rbuffer * Returns file size ***************************************************************************/
| 812 | * Returns file size |
| 813 | ***************************************************************************/ |
| 814 | size_t |
| 815 | LoadSzFile(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 |
no test coverage detected