MCPcopy Index your code
hub / github.com/NetHack/NetHack / bufon

Function bufon

src/sfstruct.c:414–433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

412}
413
414void
415bufon(int fd)
416{
417 int idx = getidx(fd, NOFLG);
418
419 if (idx >= 0) {
420 bw_sticky[idx] = fd;
421#ifdef USE_BUFFERING
422 if (bw_buffered[idx])
423 panic("buffering already enabled");
424 if (!bw_FILE[idx]) {
425 if ((bw_FILE[idx] = fdopen(fd, "w")) == 0)
426 panic("buffering of file %d failed", fd);
427 }
428 bw_buffered[idx] = (bw_FILE[idx] != 0);
429#else
430 bw_buffered[idx] = 1;
431#endif
432 }
433}
434
435void
436bufoff(int fd)

Callers 6

save_currentstateFunction · 0.85
goto_levelFunction · 0.85
restlevelfileFunction · 0.85
recover_savefileFunction · 0.85
store_versionFunction · 0.85
store_plname_in_fileFunction · 0.85

Calls 2

getidxFunction · 0.85
panicFunction · 0.50

Tested by

no test coverage detected