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

Function copy_bytes

outdated/sys/mac/mrecover.c:1165–1188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1163}
1164
1165static void
1166copy_bytes(short inRefNum, short outRefNum)
1167{
1168 char *buf = (char *) pIOBuf;
1169 long bufSiz = pBytes->memIOBuf;
1170
1171 long nfrom, nto;
1172
1173 do {
1174 nfrom = read_levelfile(inRefNum, buf, bufSiz);
1175 if (!in.Recover)
1176 return;
1177
1178 nto = write_savefile(outRefNum, buf, nfrom);
1179 if (!in.Recover)
1180 return;
1181
1182 if (nto != nfrom) {
1183 endRecover();
1184 note(noErr, alidNote, "\pSorry: File Copy Error");
1185 return;
1186 }
1187 } while (nfrom == bufSiz);
1188}
1189
1190static void
1191restore_savefile()

Callers 1

restore_savefileFunction · 0.70

Calls 4

read_levelfileFunction · 0.85
write_savefileFunction · 0.85
endRecoverFunction · 0.85
noteFunction · 0.85

Tested by

no test coverage detected