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

Function ReadHandleFile

outdated/sys/mac/macfile.c:106–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106static int
107ReadHandleFile(int fd, void *ptr, unsigned len)
108{
109 unsigned maxBytes;
110 Handle h;
111
112 if (!IsHandleFile(fd))
113 return -1;
114
115 fd -= FIRST_HF;
116 maxBytes = theHandleFiles[fd].size - theHandleFiles[fd].mark;
117 if (len > maxBytes)
118 len = maxBytes;
119
120 h = theHandleFiles[fd].data;
121
122 HLock(h);
123 BlockMove(*h + theHandleFiles[fd].mark, ptr, len);
124 HUnlock(h);
125 theHandleFiles[fd].mark += len;
126
127 return (len);
128}
129
130static long
131SetHandleFilePos(int fd, short whence, long pos)

Callers 2

macreadFunction · 0.85
rsrc_dlb_freadFunction · 0.85

Calls 1

IsHandleFileFunction · 0.85

Tested by

no test coverage detected