diff options
author | Jakob Kaivo <jkk@ung.org> | 2019-02-08 18:42:39 -0500 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2019-02-08 18:42:39 -0500 |
commit | 7ef8a7379f7f7d09e71ccae2a0b688c3cd80423f (patch) | |
tree | 092ab0aed1769117fd7b28b8592f6f96b0e0d5af /src/stdio/fseek.c | |
parent | 6acf19370e8adff79cd83b257d3f04aeaf2a59dd (diff) |
merge sources into single tree
Diffstat (limited to 'src/stdio/fseek.c')
-rw-r--r-- | src/stdio/fseek.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/stdio/fseek.c b/src/stdio/fseek.c new file mode 100644 index 00000000..2cee57a1 --- /dev/null +++ b/src/stdio/fseek.c @@ -0,0 +1,35 @@ +#include <stdio.h> + +/** set the file position indicator **/ +int fseek(FILE *stream, long int offset, int whence) +{ + (void)stream; (void)offset; + + if (whence == SEEK_CUR) { + } else if (whence == SEEK_END) { + } else if (whence == SEEK_SET) { + } + + return 1; +} + +/*** +sets the file position indicator for ARGUMENT(stream). + +How the indicator is set is determined by ARGUMENT(whence): + +FLAG(CONSTANT(SEEK_SET), The indicator is set to the beginning of the file plus ARGUMENT(offset)) +FLAG(CONSTANT(SEEK_CUR), The indicator is advanced from its current position by ARGUMENT(offset), which may be negative) +FLAG(CONSTANT(SEEK_END), The indicator is set to the end of the file minus ARGUMENT(offset)) + +A successful call to fn(fseek) clears the end-of-file indicator and discards +any characters pushed with fn(ungetc). +***/ + +/* +UNDEFINED(Specifying CONSTANT(SEEK_END) for ARGUMENT(whence) on a binary file) +UNDEFINED(Specifying a value for ARGUMENT(offset) other than 0 or a previous return value of FUNCTION(ftell) on a text file) +*/ +/* +STDC(1) +*/ |