Back to index

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

Go to the source code of this file.

Functions

 is_linetouched (WINDOW *win, int line)
 is_wintouched (WINDOW *win)
 wtouchln (WINDOW *win, int y, int n, int changed)

Function Documentation

is_linetouched ( WINDOW win,
int  line 
)

Definition at line 49 of file lib_touch.c.

{
    T((T_CALLED("is_linetouched(%p,%d)"), win, line));

    /* XSI doesn't define any error */
    if (!win || (line > win->_maxy) || (line < 0))
       returnCode((bool) ERR);

    returnCode(win->_line[line].firstchar != _NOCHANGE ? TRUE : FALSE);
}
is_wintouched ( WINDOW win)

Definition at line 61 of file lib_touch.c.

{
    int i;

    T((T_CALLED("is_wintouched(%p)"), win));

    if (win)
       for (i = 0; i <= win->_maxy; i++)
           if (win->_line[i].firstchar != _NOCHANGE)
              returnCode(TRUE);
    returnCode(FALSE);
}

Here is the caller graph for this function:

wtouchln ( WINDOW win,
int  y,
int  n,
int  changed 
)

Definition at line 75 of file lib_touch.c.

{
    int i;

    T((T_CALLED("wtouchln(%p,%d,%d,%d)"), win, y, n, changed));

    if (!win || (n < 0) || (y < 0) || (y > win->_maxy))
       returnCode(ERR);

    for (i = y; i < y + n; i++) {
       if (i > win->_maxy)
           break;
       win->_line[i].firstchar = changed ? 0 : _NOCHANGE;
       win->_line[i].lastchar = changed ? win->_maxx : _NOCHANGE;
    }
    returnCode(OK);
}