MCPcopy Create free account
hub / github.com/NetHack/NetHack / beginRecover

Function beginRecover

outdated/sys/mac/mrecover.c:934–982  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

932}
933
934static void
935beginRecover()
936{
937 SFTypeList levlType = { 'LEVL' };
938 SFReply sfGetReply;
939
940 SFGetFile(sfGetWhere, "\p", basenameFileFilterUPP, 1, levlType,
941 (DlgHookUPP) 0L, &sfGetReply);
942
943 memActivity++;
944
945 if (!sfGetReply.good)
946 return;
947
948 /* get volume (working directory) refnum, basename, and directory i.d. */
949 vRefNum = sfGetReply.vRefNum;
950 BlockMove(sfGetReply.fName, lock, sfGetReply.fName[0] + 1);
951 {
952 static CInfoPBRec catInfo;
953
954 catInfo.hFileInfo.ioNamePtr = (StringPtr) sfGetReply.fName;
955 catInfo.hFileInfo.ioVRefNum = sfGetReply.vRefNum;
956 catInfo.hFileInfo.ioDirID = 0L;
957
958 if (PBGetCatInfoSync(&catInfo)) {
959 note(noErr, alidNote, "\pSorry: Bad File Info");
960 return;
961 }
962
963 dirID = catInfo.hFileInfo.ioFlParID;
964 }
965
966 /* open the progress thermometer dialog */
967 (void) GetNewDialog(dlogProgress, (Ptr) &dlgThermo, (WindowPtr) -1L);
968 if (ResError() || MemError())
969 note(noErr, alidNote, "\pOops: Progress thermometer unavailable");
970 else {
971 in.Dialog = 1;
972 memActivity++;
973
974 itemizeThermo(initItem);
975
976 ShowWindow(WNDTHM);
977 }
978
979 timeCursor = TickCount() + CURS_LATENT;
980 saveRefNum = gameRefNum = levRefNum = -1;
981 in.Recover = 1;
982}
983
984static void
985continueRecover()

Callers 1

RecoverMenuEventFunction · 0.85

Calls 2

noteFunction · 0.85
itemizeThermoFunction · 0.85

Tested by

no test coverage detected