Date: Tue, 21 Sep 1999 15:47:38 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Hans-Bernhard Broeker cc: djgpp AT delorie DOT com, "T.E.Dickey" Subject: Re: tgetstr, tputs & other term functions In-Reply-To: <7s4q0s$gdl@acp3bf.knirsch.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On 20 Sep 1999, Hans-Bernhard Broeker wrote: > In the longer run, I doubt termcap (or terminfo, for essentially the > same reason) can be implemented to use direct video memory writes and > stuff, instead of an ANSI.SYS implementation. The main problem with > that would be that application do have the choice to query termcap > strings and print them on their own, without going through termcap at > all. That means we'ld need an ANSI.SYS implementation inside the libc, > checking and filtering all output to the console for those > -sequences, or require an external ANSI.SYS being preloaded for > programs that use termcap. I did something like that as part of the DJGPP port of GNU Fileutils (to support "ls --color"), see the file src/ls-msdos.c in the ported Fileutils source distribution, v2gnu/fil316s.zip. It is quite easy, using the DJGPP Filesystem Extension feature. The beauty of it is that the mainline source doesn't even know that somebody catches its output and redirects it to direct screen writes. I think something very similar can be used to make a port of Termcap that doesn't require an external ANSI driver, and yet satisfies all the requirements that Hans-Bernhard quite correctly wrote above. The code used by Fileutils already implements all the color-related ANSI commands, so you only need to add the rest. Adding the termcap query functions would be a rather trivial excercise, unless I miss something. Any takers?