delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/07/30/11:55:38

From: "Mark E." <snowball3 AT bigfoot DOT com>
To: djgpp-workers AT delorie DOT com
Date: Mon, 30 Jul 2001 11:55:29 -0400
MIME-Version: 1.0
Subject: Re: termios flag to control ecma-48
Message-ID: <3B654B31.1922.7F1137@localhost>
References: <3B652B0E DOT 12711 DOT 182C5 AT localhost>
In-reply-to: <Pine.SUN.3.91.1010730184236.16014G-100000@is>
X-mailer: Pegasus Mail for Win32 (v3.12c)
Reply-To: djgpp-workers AT delorie DOT com

> If you send me a test program, I can try it on DJ's machine.  (Sorry, 
> don't have time to throw together a program myself.)

One program I've been using is below.

#include <termios.h>
#include <stdio.h>
#include <fcntl.h>

int main()
{
  struct termios term;
  unsigned char c;
  int n;
  const char out_str[]="abcdef\e[SBghij\e[Tkl";
  size_t out_len = sizeof(out_str) - 1;
  size_t first_len = 7;

  tcgetattr(0, &term);

  setmode(0, O_BINARY);

#if 0
  while (1)
  {
    n = read(fileno(stdin), &c, 1);
    if (n == 0)
      break;
    putc(c, stdout);
  }
#else
  write(fileno(stdout), out_str, out_len);
#endif
  return 0;
}

> It does?  I thought Cygwin's handling of text/binary was fundamentally 
> different.

I looked at their console source, and their "libc" is actually in C++ so its 
possible I'm missing something present in the classes the console class 
derives from. DJ could give a more certain answer than me.

Mark

- Raw text -


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