Mail Archives: djgpp/2000/07/18/17:31:21
|> First of all, (trust me here):
|> cprintf CAN BE re-directed; _IF_ properly implemented!
| Says who? Who defines 'proper' implementation of cprintf()?
As one small example, VBDOS 1.0 allows cprintf to be redirected:
colored text if no re-dir; normal ASCII chars to wherever re-dired.
|> DOES ANYONE understand what the DJGPP DOC's are trying to say about
|> this issue?
| The ones I looked at say nothing about that cprintf() might ever
| produce redirectable output. Could you please tell us what docs you're
| talking about? Or quote a the relevant bits?
What I did was search the GCC and LIBC docs for ANY/ALL references
to "redirection", "cprintf", and related such topics. I definately
received the impression that what I'd like to see happen CAN BE
implemented if one knew enough about the internal workings of DJGPP.
| AFAICS, the only way to get redirectable output is by not using
| cprintf(), if stdout is not pointing to the screen. I.e. instead of
| calling cprintf(), you'ld have to call a routine dprintf() that
| roughly does this:
|
| i (! isatty(fileno(stdin)))
| printf(...);
| else
| cprintf(...);
|
I shall try this approach. One thing we know will be essential is to
have a single function call; its okay if we define it ourselves (got
that impression from the DOCs mentions above anyhways).
What I think the DOCs were gettting at, might of been in "internal"
system (DJGPP) reference to isatty perhaps....
/* stdout == console -> cprintf else -> printf */
int smartcprintf(fg, bg, char*);
| --
| Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
| Even if all the snow were burnt, ashes would remain.
PS:(At the risk of being off topic)
If anyone should happen to know how to write a little MS-Windows 3.1
'C' style Code... you're help is also needed. Thanks.
- Raw text -