X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=platform%2Fwin32%2Ffunctions%2F_PDCLIB%2F_PDCLIB_seek.c;fp=platform%2Fwin32%2Ffunctions%2F_PDCLIB%2F_PDCLIB_seek.c;h=0000000000000000000000000000000000000000;hb=c5d49235e09fbd58416f10dec2799e61cf3431c8;hp=6bf53e9809780562e136cd94f83b5dcfe28c54cc;hpb=4c7c56442f6b3e08c17594dd4e8095fca3aec9cf;p=pdclib diff --git a/platform/win32/functions/_PDCLIB/_PDCLIB_seek.c b/platform/win32/functions/_PDCLIB/_PDCLIB_seek.c deleted file mode 100644 index 6bf53e9..0000000 --- a/platform/win32/functions/_PDCLIB/_PDCLIB_seek.c +++ /dev/null @@ -1,51 +0,0 @@ -/* $Id$ */ - -/* int64_t _PDCLIB_seek( FILE *, int64_t, int ) - - This file is part of the Public Domain C Library (PDCLib). - Permission is granted to use, modify, and / or redistribute at will. -*/ - -#include -#include -#ifndef REGTEST -#include <_PDCLIB_glue.h> -#include - -#if _PDCLIB_C_MIN(2011) -_Static_assert(SEEK_SET == FILE_BEGIN, "SEEK_SET is incorrect"); -_Static_assert(SEEK_CUR == FILE_CURRENT, "SEEK_CUR is incorrect"); -_Static_assert(SEEK_END == FILE_END, "SEEK_END is incorrect"); -#endif - -extern void _PDCLIB_w32errno( void ); -_PDCLIB_int64_t _PDCLIB_seek( struct _PDCLIB_file_t * stream, _PDCLIB_int64_t offset, int whence ) -{ - LARGE_INTEGER liOffset; - liOffset.QuadPart = offset; - BOOL rv = SetFilePointerEx( stream->handle, liOffset, &liOffset, whence ); - if(!rv) { - _PDCLIB_w32errno(); - return EOF; - } - - stream->ungetidx = 0; - stream->bufidx = 0; - stream->bufend = 0; - stream->pos.offset = liOffset.QuadPart; - return liOffset.QuadPart; -} - -#endif - -#ifdef TEST -#include <_PDCLIB_test.h> - -int main( void ) -{ - /* Testing covered by ftell.c */ - return TEST_RESULTS; -} - -#endif -