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

Function eof

outdated/sys/wince/celib.c:160–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158}
159
160int __cdecl eof(int f)
161{
162 DWORD fpos, fsize;
163 HANDLE p = get_file_handle(f);
164
165 if (f == -1)
166 return -1;
167
168 fpos = SetFilePointer(p, 0, NULL, FILE_CURRENT);
169 fsize = SetFilePointer(p, 0, NULL, FILE_END);
170 if (fpos == 0xFFFFFFFF || fsize == 0xFFFFFFFF)
171 return -1;
172 if (fpos == fsize)
173 return 1;
174 else {
175 SetFilePointer(p, fpos, NULL, FILE_BEGIN);
176 return 0;
177 }
178}
179
180long __cdecl lseek(int f, long offset, int origin)
181{

Callers 1

feofFunction · 0.85

Calls 1

get_file_handleFunction · 0.85

Tested by

no test coverage detected