www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2000/05/19/16:45:16

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-developers-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-developers-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin-developers AT sourceware DOT cygnus DOT com
Message-ID: <20000519204415.27070.qmail@web115.yahoomail.com>
Date: Fri, 19 May 2000 13:44:15 -0700 (PDT)
From: Earnie Boyd <earnie_boyd AT yahoo DOT com>
Reply-To: earnie_boyd AT yahoo DOT com
Subject: Re: cr/lf conundrum
To: DJ Delorie <dj AT delorie DOT com>, cygwin-developers AT sourceware DOT cygnus DOT com
MIME-Version: 1.0

--- DJ Delorie <dj AT delorie DOT com> wrote:
> 
> OK, I've been working on the CR/LF problem, and I've come down to a
> problem that isn't easily solved:
> 
> 	getc() and putc() are macros.
> 
> That means that part of the buffering system in stdio is in the
> application, not the dll, so there's no way I can fix the application
> to use the new scheme, which moves CR/LF conversions to the stdio
> buffering layer (to fix ftell()).  That means that any existing
> program that uses getc or putc (or putchar, fgetc, or any other macro
> derivitive) is going to do binary I/O for those calls, no matter what.
> 
> The reason this is a big deal is because it affects terminal I/O too,
> that is, you get stairstepped text:
> 	example
> 	        stair-stepped
> 	                      text
> 
> because there are no CR's to move the cursor back to the beginning of
> the line.
> 
> There are a couple of things I can do to prevent this type of problem
> in the future (namely, making getc/putc *not* be macros), but I can't
> think of a good solution to handle existing applications.  I can think
> of many hacks, but they all have drawbacks.
> 
> Ideas?

After investigating stdio.h I see that getc/putc are already prototyped as
functions.  The getc/putc macros are conditioned with `#ifndef lint' already. 
This could be modified to also condition __CYGWIN__ or give instructions to use
`-Dlint' in CFLAGS.

Regards,

=====
---
   Earnie Boyd: <mailto:earnie_boyd AT yahoo DOT com>
            __Cygwin: POSIX on Windows__
Cygwin Newbies: <http://www.freeyellow.com/members5/gw32/index.html>
           __Minimalist GNU for Windows__
  Mingw32 List: <http://www.egroups.com/group/mingw32/>
    Mingw Home: <http://www.mingw.org/>

__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

- Raw text -


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