Back to index

tetex-bin  3.0
Functions
lib_ungetch.c File Reference
#include <curses.priv.h>
#include <fifo_defs.h>

Go to the source code of this file.

Functions

 ungetch (int ch)

Function Documentation

ungetch ( int  ch)

Definition at line 59 of file lib_ungetch.c.

{
    T((T_CALLED("ungetch(%s)"), _tracechar(ch)));

    if (tail == -1)
       returnCode(ERR);
    if (head == -1) {
       head = 0;
       t_inc()
           peek = tail;     /* no raw keys */
    } else
       h_dec();

    SP->_fifo[head] = ch;
    T(("ungetch %s ok", _tracechar(ch)));
#ifdef TRACE
    if (_nc_tracing & TRACE_IEVENT)
       _nc_fifo_dump();
#endif
    returnCode(OK);
}

Here is the caller graph for this function: