delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/09/23/11:28:15

Sender: ml AT delorie DOT com
Message-ID: <3427DFA0.6BD58E61@cdata.tvnet.hu>
Date: Tue, 23 Sep 1997 17:26:24 +0200
From: Molnar Laszlo <molnarl AT cdata DOT tvnet DOT hu>
MIME-Version: 1.0
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
CC: DJGPP workers <djgpp-workers AT delorie DOT com>
Subject: Re: perl and stdio test
References: <Pine DOT SUN DOT 3 DOT 91 DOT 970923180333 DOT 15819F-100000 AT is>

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019