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

Function macseek

outdated/sys/mac/macfile.c:337–363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

335}
336
337long
338macseek(int fd, long where, short whence)
339{
340 short posMode;
341 long curPos;
342
343 if (IsHandleFile(fd)) {
344 return SetHandleFilePos(fd, whence, where);
345 }
346
347 switch (whence) {
348 default:
349 posMode = fsFromStart;
350 break;
351 case SEEK_CUR:
352 posMode = fsFromMark;
353 break;
354 case SEEK_END:
355 posMode = fsFromLEOF;
356 break;
357 }
358
359 if (SetFPos(fd, posMode, where) == noErr && GetFPos(fd, &curPos) == noErr)
360 return (curPos);
361 else
362 return (-1);
363}
364
365int
366macunlink(const char *name)

Callers

nothing calls this directly

Calls 2

IsHandleFileFunction · 0.85
SetHandleFilePosFunction · 0.85

Tested by

no test coverage detected