Mail Archives: djgpp/1996/12/10/17:54:02
On Fri, 6 Dec 1996, A.Appleyard wrote:
> In v1, and in v2, when writing to screen in the ordinary text mode by fprint()
> etc, how can I tell the PC to start writing with such-and-such a foreground
> and background color?
The only way I know of (short of replacing DOS I/O with conio) is to use
the filesystem extensions mechanism available with DJGPP v2. A simple
example of a filesystem extension which catches all output to the screen
(no matter which higher-level I/O functions were used) and converts it to
direct conio-style writes is included with the DJGPP libc reference from
v2.01 (type "info libc alpha __FSEXT_set_function RET" from the DOS
prompt). A more complex example can be found in the DJGPP port of GNU ls
(v2gnu/fil313s.zip, filename ls-msdos.c) which is used to produce the
colorization of file names according to their type.
- Raw text -