Back to index

tetex-bin  3.0
Defines | Functions
lib_raw.c File Reference
#include <curses.priv.h>
#include <term.h>

Go to the source code of this file.

Defines

#define _nc_setmode(mode)   /* nothing */
#define COOKED_INPUT   (IXON|BRKINT|PARMRK)
#define BEFORE(s)
#define AFTER(s)

Functions

 raw (void)
 cbreak (void)
 qiflush (void)
 noraw (void)
 nocbreak (void)
 noqiflush (void)
 intrflush (WINDOW *win GCC_UNUSED, bool flag)

Define Documentation

#define _nc_setmode (   mode)    /* nothing */

Definition at line 66 of file lib_raw.c.

#define AFTER (   s)

Definition at line 76 of file lib_raw.c.

#define BEFORE (   s)

Definition at line 75 of file lib_raw.c.

#define COOKED_INPUT   (IXON|BRKINT|PARMRK)

Definition at line 69 of file lib_raw.c.


Function Documentation

cbreak ( void  )

Definition at line 112 of file lib_raw.c.

{
    int result = ERR;

    T((T_CALLED("cbreak()")));

    if (SP != 0 && cur_term != 0) {
       TTY buf;

       BEFORE("cbreak");
       _nc_setmode(O_BINARY);

       buf = cur_term->Nttyb;
#ifdef TERMIOS
       buf.c_lflag &= ~ICANON;
       buf.c_iflag &= ~ICRNL;
       buf.c_lflag |= ISIG;
       buf.c_cc[VMIN] = 1;
       buf.c_cc[VTIME] = 0;
#else
       buf.sg_flags |= CBREAK;
#endif
       if ((result = _nc_set_tty_mode(&buf)) == OK) {
           SP->_cbreak = 1;
           cur_term->Nttyb = buf;
       }
       AFTER("cbreak");
    }
    returnCode(result);
}

Here is the call graph for this function:

Here is the caller graph for this function:

intrflush ( WINDOW *win  GCC_UNUSED,
bool  flag 
)

Definition at line 270 of file lib_raw.c.

{
    int result = ERR;

    T((T_CALLED("intrflush(%d)"), flag));

    if (cur_term != 0) {
       TTY buf;

       BEFORE("intrflush");
       buf = cur_term->Nttyb;
#ifdef TERMIOS
       if (flag)
           buf.c_lflag &= ~(NOFLSH);
       else
           buf.c_lflag |= (NOFLSH);
       result = _nc_set_tty_mode(&buf);
#else
       /* FIXME */
#endif
       if (result == OK) {
           cur_term->Nttyb = buf;
       }
       AFTER("intrflush");
    }
    returnCode(result);
}

Here is the call graph for this function:

nocbreak ( void  )

Definition at line 204 of file lib_raw.c.

{
    int result = ERR;

    T((T_CALLED("nocbreak()")));

    if (SP != 0 && cur_term != 0) {
       TTY buf;

       BEFORE("nocbreak");
       _nc_setmode(O_TEXT);

       buf = cur_term->Nttyb;
#ifdef TERMIOS
       buf.c_lflag |= ICANON;
       buf.c_iflag |= ICRNL;
#else
       buf.sg_flags &= ~CBREAK;
#endif
       if ((result = _nc_set_tty_mode(&buf)) == OK) {
           SP->_cbreak = 0;
           cur_term->Nttyb = buf;
       }
       AFTER("nocbreak");
    }
    returnCode(result);
}

Here is the call graph for this function:

Here is the caller graph for this function:

noqiflush ( void  )

Definition at line 237 of file lib_raw.c.

{
    int result = ERR;

    T((T_CALLED("noqiflush()")));

    if (cur_term != 0) {
       TTY buf;

       BEFORE("noqiflush");
       buf = cur_term->Nttyb;
#ifdef TERMIOS
       buf.c_lflag |= NOFLSH;
       result = _nc_set_tty_mode(&buf);
#else
       /* FIXME */
#endif
       if (result == OK) {
           cur_term->Nttyb = buf;
       }
       AFTER("noqiflush");
    }
    returnVoid;
}

Here is the call graph for this function:

noraw ( void  )

Definition at line 173 of file lib_raw.c.

{
    int result = ERR;

    T((T_CALLED("noraw()")));

    if (SP != 0 && cur_term != 0) {
       TTY buf;

       BEFORE("noraw");
       _nc_setmode(O_TEXT);

       buf = cur_term->Nttyb;
#ifdef TERMIOS
       buf.c_lflag |= ISIG | ICANON |
           (cur_term->Ottyb.c_lflag & IEXTEN);
       buf.c_iflag |= COOKED_INPUT;
#else
       buf.sg_flags &= ~(RAW | CBREAK);
#endif
       if ((result = _nc_set_tty_mode(&buf)) == OK) {
           SP->_raw = FALSE;
           SP->_cbreak = 0;
           cur_term->Nttyb = buf;
       }
       AFTER("noraw");
    }
    returnCode(result);
}

Here is the call graph for this function:

Here is the caller graph for this function:

qiflush ( void  )

Definition at line 148 of file lib_raw.c.

{
    int result = ERR;

    T((T_CALLED("qiflush()")));

    if (cur_term != 0) {
       TTY buf;

       BEFORE("qiflush");
       buf = cur_term->Nttyb;
#ifdef TERMIOS
       buf.c_lflag &= ~(NOFLSH);
       result = _nc_set_tty_mode(&buf);
#else
       /* FIXME */
#endif
       if (result == OK)
           cur_term->Nttyb = buf;
       AFTER("qiflush");
    }
    returnVoid;
}

Here is the call graph for this function:

raw ( void  )

Definition at line 80 of file lib_raw.c.

{
    int result = ERR;

    T((T_CALLED("raw()")));

    if (SP != 0 && cur_term != 0) {
       TTY buf;

       BEFORE("raw");
       _nc_setmode(O_BINARY);

       buf = cur_term->Nttyb;
#ifdef TERMIOS
       buf.c_lflag &= ~(ICANON | ISIG | IEXTEN);
       buf.c_iflag &= ~(COOKED_INPUT);
       buf.c_cc[VMIN] = 1;
       buf.c_cc[VTIME] = 0;
#else
       buf.sg_flags |= RAW;
#endif
       if ((result = _nc_set_tty_mode(&buf)) == OK) {
           SP->_raw = TRUE;
           SP->_cbreak = 1;
           cur_term->Nttyb = buf;
       }
       AFTER("raw");
    }
    returnCode(result);
}

Here is the call graph for this function:

Here is the caller graph for this function: