]> pd.if.org Git - pdclib/blob - functions/stdio/_PDCLIB_seek.c
_PDCLIB_seek: Incorrect specification (used int64_t where int_fast64_t was correct)
[pdclib] / functions / stdio / _PDCLIB_seek.c
1 /* int64_t _PDCLIB_seek( FILE *, int64_t, int )\r
2 \r
3    This file is part of the Public Domain C Library (PDCLib).\r
4    Permission is granted to use, modify, and / or redistribute at will.\r
5 */\r
6 \r
7 #include <stdio.h>\r
8 #include <stdint.h>\r
9 #include <errno.h>\r
10 #ifndef REGTEST\r
11 \r
12 int_fast64_t _PDCLIB_seek( struct _PDCLIB_file_t * stream, \r
13                            int_fast64_t offset, \r
14                            int whence )\r
15 {\r
16     int_fast64_t newPos;\r
17     if(!stream->ops->seek(stream->handle, offset, whence, &newPos)) {\r
18         return EOF;\r
19     }\r
20 \r
21     stream->ungetidx = 0;\r
22     stream->bufidx = 0;\r
23     stream->bufend = 0;\r
24     stream->pos.offset = newPos;\r
25     return newPos;\r
26 }\r
27 \r
28 #endif\r
29 \r
30 #ifdef TEST\r
31 #include <_PDCLIB_test.h>\r
32 \r
33 int main( void )\r
34 {\r
35     /* Testing covered by ftell.c */\r
36     return TEST_RESULTS;\r
37 }\r
38 \r
39 #endif\r
40 \r