Back to index

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

Go to the source code of this file.

Functions

 wclrtoeol (WINDOW *win)

Function Documentation

wclrtoeol ( WINDOW win)

Definition at line 46 of file lib_clreol.c.

{
    int code = ERR;

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

    if (win) {
       NCURSES_CH_T blank;
       NCURSES_CH_T *ptr, *end;
       struct ldat *line;
       NCURSES_SIZE_T y = win->_cury;
       NCURSES_SIZE_T x = win->_curx;

       /*
        * If we have just wrapped the cursor, the clear applies to the
        * new line, unless we are at the lower right corner.
        */
       if ((win->_flags & _WRAPPED) != 0
           && y < win->_maxy) {
           win->_flags &= ~_WRAPPED;
       }

       /*
        * There's no point in clearing if we're not on a legal
        * position, either.
        */
       if ((win->_flags & _WRAPPED) != 0
           || y > win->_maxy
           || x > win->_maxx)
           returnCode(ERR);

       blank = win->_nc_bkgd;
       line = &win->_line[y];
       CHANGED_TO_EOL(line, x, win->_maxx);

       ptr = &(line->text[x]);
       end = &(line->text[win->_maxx]);

       while (ptr <= end)
           *ptr++ = blank;

       _nc_synchook(win);
       code = OK;
    }
    returnCode(code);
}

Here is the call graph for this function:

Here is the caller graph for this function: