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

Function create_savefile

outdated/sys/mac/mrecover.c:1134–1163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1132}
1133
1134static short
1135create_savefile(unsigned char *savename)
1136{
1137 short fRefNum;
1138
1139 /* translate savename to a pascal string (in place) */
1140 {
1141 unsigned char *pC;
1142 short nameLen;
1143
1144 for (pC = savename; *pC; pC++)
1145 ;
1146
1147 nameLen = pC - savename;
1148
1149 for (; pC > savename; pC--)
1150 *pC = *(pC - 1);
1151
1152 *savename = nameLen;
1153 }
1154
1155 if (HCreate(vRefNum, dirID, savename, MAC_CREATOR, SAVE_TYPE)
1156 || HOpen(vRefNum, dirID, savename, fsRdWrPerm, &fRefNum)) {
1157 endRecover();
1158 note(noErr, alidNote, "\pSorry: File Create Error");
1159 return (-1);
1160 }
1161
1162 return fRefNum;
1163}
1164
1165static void
1166copy_bytes(short inRefNum, short outRefNum)

Callers 1

restore_savefileFunction · 0.70

Calls 2

endRecoverFunction · 0.85
noteFunction · 0.85

Tested by

no test coverage detected