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

Function getidx

src/sfstruct.c:383–400  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

381 */
382
383staticfn int
384getidx(int fd, int flg)
385{
386 int i, retval = -1;
387
388 for (i = 0; i < MAXFD; ++i)
389 if (bw_sticky[i] == fd)
390 return i;
391 if (flg == NOSLOT)
392 return retval;
393 for (i = 0; i < MAXFD; ++i)
394 if (bw_sticky[i] < 0) {
395 bw_sticky[i] = fd;
396 retval = i;
397 break;
398 }
399 return retval;
400}
401
402/* Let caller know that bclose() should handle it (TRUE) */
403boolean

Callers 6

close_checkFunction · 0.85
bufonFunction · 0.85
bufoffFunction · 0.85
bcloseFunction · 0.85
bflushFunction · 0.85
bwriteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected