Mail Archives: djgpp-workers/1997/09/23/11:28:15
Eli Zaretskii wrote:
> The reason is that we wanted both CRLF -> NL conversions *and* correct
> byte counts from `fseek', without losing the buffering. So the buffer
> maintained as part of the FILE structure holds the original contents of
> the file on disk, with the CR characters; they are only stripped by the
> functions that are used to read the file, like `getc', `fread', etc.
> So Perl is right: if ``standard stdio'' means that the contents of the
> buffer is the same as what's returned to the application, then DJGPP's
> stdio is not very standard.
Ok. It's clear now.
> > $cat >try.c <<EOP
> > #include <stdio.h>
> > #define FILE_ptr(fp) (fp)->_ptr
> > #define FILE_cnt(fp) (fp)->_cnt
>
> Am I to understand that Perl actually assumes that the FILE structure
> includes members called `_ptr' and `_cnt'? If so, then it deserves to
> fail here. Is there any law against calling these members by any other
> name that I can fancy? These are internals of the implementation, and no
> program should depend on such internal details.
Sorry, I changed this for my mail (to make it simpler). Configure uses
this:
$cat >try.c <<EOP
#include <stdio.h>
#define FILE_ptr(fp) $stdio_ptr
#define FILE_cnt(fp) $stdio_cnt
Laszlo
- Raw text -