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

Function set_levelfile_name

src/files.c:605–618  ·  view source on GitHub ↗

Construct a file name for a level-type file, which is of the form * something.level (with any old level stripped off). * This assumes there is space on the end of 'file' to append * a two digit number. This is true for 'level' * but be careful if you use it for other things -dgk */

Source from the content-addressed store, hash-verified

603 * but be careful if you use it for other things -dgk
604 */
605void
606set_levelfile_name(char *file, int lev)
607{
608 char *tf;
609
610 tf = strrchr(file, '.');
611 if (!tf)
612 tf = eos(file);
613 Sprintf(tf, ".%d", lev);
614#ifdef VMS
615 Strcat(tf, ";1");
616#endif
617 return;
618}
619
620NHFILE *
621create_levelfile(int lev, char errbuf[])

Callers 12

create_levelfileFunction · 0.70
open_levelfileFunction · 0.70
delete_levelfileFunction · 0.70
recover_savefileFunction · 0.70
eraseoldlocksFunction · 0.50
getlockFunction · 0.50
eraseoldlocksFunction · 0.50
getlockFunction · 0.50
veryoldFunction · 0.50
getlockFunction · 0.50
eraseoldlocksFunction · 0.50
getlockFunction · 0.50

Calls 2

strrchrFunction · 0.85
eosFunction · 0.85

Tested by

no test coverage detected