void FILEPREVIEWINFO::Preview(u8 *cat) { ::dlg = innerdlg.h; u8 bas = getcheck(IDC_PREVIEW_BASIC); u8 del = getcheck(IDC_PREVIEW_ERASED); int count = 0; char fn[10]; LVITEM item; item.mask = LVIF_TEXT; item.pszText = fn; for (unsigned p = 0; p < 0x800; p += 0x10) { if (!cat[p]) break; if (!del && cat[p] == 1) continue; if (bas && cat[p+8] != 'B') continue; memcpy(fn, cat+p, 8); fn[8] = 0; item.iItem = count++; item.iSubItem = 0; item.iItem = SendMessage(list.h, LVM_INSERTITEM, 0, (LPARAM) &item); fn[0] = cat[p+8]; fn[1] = 0; item.iSubItem = 1; SendMessage(list.h, LVM_SETITEM, 0, (LPARAM) &item); sprintf(fn, "%d", cat[p+13]); item.iSubItem = 2; SendMessage(list.h, LVM_SETITEM, 0, (LPARAM) &item); } }
static int unlink(char* filename) { if (!getcheck(filename)) return 0; sys_unlink(filename); return 1; }