raw() and unraw()

Okay now that I have these functions how are they used? Is is something
along the lines of before I start reading in data I call raw and then upon
exiting I reset it and call unraw again?

What they do is take the terminal into and out of canonical or ‘line’ mode.
In non-canonical mode, every character entered is immediately passed to
whoever is reading. Canonical mode means that the entire line is passed
when it reads a newline or EOF. So, if you call raw(0), since 0 is stdin,
and then do a read on stdin, read will return with one character every time
the keyboard is hit.

If you’re trying to make a nice terminal application, you might want to look
at ncurses - it give you a lot of good stuff - arbitrary positioning of
characters, creation of window regions, etc. All in a terminal. One of the
best books I’ve ever seen on the subject of general purpose, practical unix
programming (it has great chapters on terminal IO and curses) is published
by WROX. It’s called, “Beginning Linux Programming” and, besides being
excellent, is pretty cheap too.

cheers,

Kris

“Kevin Weisser” <kweisser@udel.edu> wrote in message
news:adlv6e$lpe$1@inn.qnx.com

Okay now that I have these functions how are they used? Is is something
along the lines of before I start reading in data I call raw and then upon
exiting I reset it and call unraw again?