X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=platform%2Fexample_cygwin%2Ffunctions%2F_PDCLIB%2Fseek.c;fp=platform%2Fexample_cygwin%2Ffunctions%2F_PDCLIB%2Fseek.c;h=0000000000000000000000000000000000000000;hb=0cd903b82201176f3148f6d18d68fd30b82746d5;hp=77b74792e3823603fe46874b8d0176c4570ceb38;hpb=56bacb39160e13397fde32a36329461f3ae56ec1;p=pdclib diff --git a/platform/example_cygwin/functions/_PDCLIB/seek.c b/platform/example_cygwin/functions/_PDCLIB/seek.c deleted file mode 100644 index 77b7479..0000000 --- a/platform/example_cygwin/functions/_PDCLIB/seek.c +++ /dev/null @@ -1,65 +0,0 @@ -/* 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 <_PDCLIB_glue.h> - -#include "/usr/include/errno.h" - -extern int lseek( int fd, int offset, int whence ); - -_PDCLIB_int64_t _PDCLIB_seek( struct _PDCLIB_file_t * stream, _PDCLIB_int64_t offset, int whence ) -{ - switch ( whence ) - { - case SEEK_SET: - case SEEK_CUR: - case SEEK_END: - /* EMPTY - OK */ - break; - default: - _PDCLIB_errno = _PDCLIB_ERROR; - return EOF; - break; - } - _PDCLIB_int64_t rc = lseek( stream->handle, offset, whence ); - if ( rc != EOF ) - { - stream->ungetidx = 0; - stream->bufidx = 0; - stream->bufend = 0; - stream->pos.offset = rc; - return rc; - } - switch ( errno ) - { - /* See comments on implementation-defined errno values in - <_PDCLIB_config.h>. - */ - case EBADF: - case EFAULT: - _PDCLIB_errno = _PDCLIB_ERROR; - break; - default: - /* This should be something like EUNKNOWN. */ - _PDCLIB_errno = _PDCLIB_ERROR; - break; - } - return EOF; -} - -#ifdef TEST -#include <_PDCLIB_test.h> - -int main( void ) -{ - /* Testing covered by ftell.c */ - return TEST_RESULTS; -} - -#endif -