Re: Linux I/O: was: Re: Finished - <Program Name> DOS box

new topic     » topic index » view thread      » older message » newer message

On Thu, May 03, 2001 at 09:22:34PM +0000, sephiroth _ wrote:
> you could open the standard C library and call puts, but printf uses as 
> many arguments as is needed, so that might be a little harder to link 
> to. i suggested a "without ncurses" option a while ago to just use 
> regular text I/O using libc, but no one listened...

Actually, you don't even have to do that. All you have to do is
put this code in the start of you program:

integer basicioh
basicioh = open("/dev/tty", "wb")

then use basicioh intead of 1 as the screen output handle. A problems occurs
when using system() or system_exec(), however. The output, after calling
system[_exec]() will be on the ncurses screen. Therefore, I doubt using
glibc puts (or fputs) will solve the problem. (It would support redirection,
however, as my method does not.) The only way I see would be to use glibc
exec calls in place of system[_exec](). If anyone has any ideas or code,
don't hesitate to email me.

TIA,
jbrown

P.S. Euphoria, to my knowlege, has no support for variable parameters in
C funcs. Therefore. one would have to wrap glibc printf in another C func,
and use the wrapped version. A simpler way would be to use sprintf(), and
the send the output to glibc puts.

-- 
Linux User:190064
Linux Machine:84163
http://jbrown105.1avenue.com

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu