Mail Archives: djgpp/2015/06/20/11:07:32
X-Authentication-Warning: | delorie.com: mail set sender to djgpp-bounces using -f
|
X-Recipient: | djgpp AT delorie DOT com
|
Message-ID: | <558581FC.4040605@gmx.de>
|
Date: | Sat, 20 Jun 2015 17:08:44 +0200
|
From: | "Juan Manuel Guerrero (juan DOT guerrero AT gmx DOT de)" <djgpp AT delorie DOT com>
|
User-Agent: | Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.2.13) Gecko/20101206 SUSE/3.1.7 Thunderbird/3.1.7
|
MIME-Version: | 1.0
|
To: | djgpp AT delorie DOT com
|
Subject: | fseeko.txh and ftello.txh added.
|
X-Provags-ID: | V03:K0:Kk6qTNXgPVWxTVBMV/xXr/7Cc4EqhHPYqQCwSAlpQNYn+92qjqe
|
| fq8/g3E8V7HJJ2UJ7L24gEywt/9K3QiBjw8+d1J7Obeosrbw92tbl/k/UdjaIlSdGnYrtt/
|
| CR1ZW/ksZud682ZGJ11O9Tqbt1l9JkSl2bO+L1kEYCCa1wQQdYp7lujbfnsNG3ROWEdsH7E
|
| x1O1Zmp4XIoRCoDNC597w==
|
X-UI-Out-Filterresults: | notjunk:1;V01:K0:fOcyr5+pkuk=:ZaIfphHz6wSpZFp3EggD61
|
| O0y3Y5uaH/QkyP6GnzU9F1eEazXrj6Zp3YFzyiDZHozxjDN/NCvefCD2ImjaDvb8uZSyV+c+7
|
| VfUYBPFluDXjCIeIU3eFarBBBqy7mIwecJUw3Ay8fexWUBIwmLj0icsJWuWBzNVXtiQJCPhDK
|
| ZuMJvtuM0cVU/hDkRVKuEXyWkatoLWy3WM0wxEgFpMEPE4P83wWhKXWG3+hVnjYM8rRAHsdKn
|
| B8PuKnCkfgzqY9ztwiB5mw4z1ZZnUyge6wdtYCQUZrzgt5+BSUQyhPfIcpp3cL9V/fVm/khPg
|
| vyPwyOb947Ksf+grL1D+RQMV5C9ZeJ0zYPIr/lYG2eo/q4G9Rio112fmEMtHJp1bBk6qB8zcq
|
| F/9w891b1xUaFWbpNK61GoEAokATnR7scPcdvqXwi78+YXrQUf4t7Qnrfa79ci5HPyS1gR7CH
|
| Px2iyVYY8KirrjN89qum9baSpNZ4FmB0SeeAi/b9AFdPcmDWsIYRf9XBeDFtCzbl/yEHIXLOc
|
| RA27ERLW8tU7emAQO/e6tvqVkQfhFLaJfee4dcaYEFPdT3UxZ03SWws8FcQa8muMQYh5AsyJX
|
| 7hbeuZ5ciO/lz5CpaI+2+g68ZMhSbhVHsbkFttL17iNiPD5B3XGdN17NquKh0QgE/m9fCQgHl
|
| dBU9y2lZ7Bo6iw9N8laSb6g8ex9k8VczQs1H9rB1jFUMJEnUFwuwbMW2hKlZ6y2C3OhY=
|
Reply-To: | djgpp AT delorie DOT com
|
OFYI, I have added txh files for fseeko and ftello to the main branch. If no
one objects I will add them also to v2_05_1 or shall that branch considered to
be closed? BTW, may be some one remembers how fseeko64 and ftello64 are supposed
to work and writes little txh files for both.
Regards,
Juan M. Guerrero
diff -aprNU5 djgpp.orig/src/libc/compat/stdio/fseeko.txh djgpp/src/libc/compat/stdio/fseeko.txh
--- djgpp.orig/src/libc/compat/stdio/fseeko.txh 1970-01-01 00:00:00 +0000
+++ djgpp/src/libc/compat/stdio/fseeko.txh 2015-06-20 16:37:44 +0000
@@ -0,0 +1,68 @@
+@node fseeko, stdio
+@findex fseeko
+@subheading Syntax
+
+@example
+#include <stdio.h>
+
+int fseeko(FILE *file, off_t offset, int mode);
+@end example
+
+@subheading Description
+
+@code{fseeko} is a wrapper function of @code{fseek} (@pxref{fseek}).
+So it is identical to @code{fseek}, except that the offset argument
+of @code{fseeko} is of type @code{off_t} instead of @code{long}.
+
+
+This function moves the file pointer for @var{file} according to
+@var{mode}:
+
+@table @code
+
+@item SEEK_SET
+
+The file pointer is moved to the offset specified.
+
+@item SEEK_CUR
+
+The file pointer is moved relative to its current position.
+
+@item SEEK_END
+
+The file pointer is moved to a position @var{offset} bytes from the end
+of the file. The offset is usually nonpositive in this case.
+
+@end table
+
+@emph{Warning!} The ANSI standard only allows values of zero for
+@var{offset} when @var{mode} is not @code{SEEK_SET} and the file has
+been opened as a text file. Although this restriction is not enforced,
+beware that there is not a one-to-one correspondence between file
+characters and text characters under MS-DOS, so some @code{fseeko}
+operations may not do exactly what you expect.
+
+Also, since @code{lseek} under DOS does not return an error indication
+when you try to move the file pointer before the beginning of the file,
+neither will @code{fseeko}. Portable programs should call @code{ftello}
+after @code{fseeko} to get the actual position of the file pointer.
+
+Note that DOS does not mind if you seek before the beginning of the
+file, like seeking from the end of the file by more than the file's
+size. Therefore, @code{lseek} will not return with an error in such
+cases either.
+
+@subheading Return Value
+
+Zero if successful, nonzero if not.
+
+@subheading Portability
+
+@portability ansi, posix
+
+@subheading Example
+
+@example
+fseeko(stdin, 12, SEEK_CUR); /* skip 12 bytes */
+@end example
+
diff -aprNU5 djgpp.orig/src/libc/compat/stdio/ftello.txh djgpp/src/libc/compat/stdio/ftello.txh
--- djgpp.orig/src/libc/compat/stdio/ftello.txh 1970-01-01 00:00:00 +0000
+++ djgpp/src/libc/compat/stdio/ftello.txh 2015-06-20 16:37:44 +0000
@@ -0,0 +1,33 @@
+@node ftello, stdio
+@findex ftello
+@subheading Syntax
+
+@example
+#include <stdio.h>
+
+off_t ftello(FILE *file);
+@end example
+
+@subheading Description
+
+@code{ftello} is a wrapper function of @code{ftell} (@pxref{ftell}).
+So it is identical to @code{ftell}, except that the return value of
+@code{ftello} is of type @code{off_t} instead of @code{long}.
+
+Returns the current file position for @code{file}. This is suitable for
+a future call to @code{fseeko}.
+
+@subheading Return Value
+
+The file position, or -1 on error.
+
+@subheading Portability
+
+@portability ansi, posix
+
+@subheading Example
+
+@example
+off_t p = ftello(stdout);
+@end example
+
- Raw text -