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

Function lseek

outdated/sys/wince/celib.c:180–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178}
179
180long __cdecl lseek(int f, long offset, int origin)
181{
182 HANDLE p = get_file_handle(f);
183 DWORD fpos;
184 switch (origin) {
185 case SEEK_SET:
186 fpos = SetFilePointer(p, offset, NULL, FILE_BEGIN);
187 break;
188 case SEEK_CUR:
189 fpos = SetFilePointer(p, offset, NULL, FILE_CURRENT);
190 break;
191 case SEEK_END:
192 fpos = SetFilePointer(p, offset, NULL, FILE_END);
193 break;
194 default:
195 fpos = 0xFFFFFFFF;
196 break;
197 }
198 if (fpos == 0xFFFFFFFF)
199 return -1;
200 else
201 return (long) fpos;
202}
203
204int __cdecl open(const char *filename, int oflag, ...)
205{

Callers 5

rewind_nhfileFunction · 0.85
recover_savefileFunction · 0.85
fseekFunction · 0.85
ftellFunction · 0.85
mainFunction · 0.85

Calls 1

get_file_handleFunction · 0.85

Tested by

no test coverage detected