Back to index

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

Go to the source code of this file.

Functions

 whline (WINDOW *win, chtype ch, int n)

Function Documentation

whline ( WINDOW win,
chtype  ch,
int  n 
)

Definition at line 46 of file lib_hline.c.

{
    int code = ERR;
    NCURSES_SIZE_T start;
    NCURSES_SIZE_T end;

    T((T_CALLED("whline(%p,%s,%d)"), win, _tracechtype(ch), n));

    if (win) {
       struct ldat *line = &(win->_line[win->_cury]);
       NCURSES_CH_T wch;

       start = win->_curx;
       end = start + n - 1;
       if (end > win->_maxx)
           end = win->_maxx;

       CHANGED_RANGE(line, start, end);

       if (ch == 0)
           SetChar(wch, ChCharOf(ACS_HLINE), ChAttrOf(ACS_HLINE));
       else
           SetChar(wch, ChCharOf(ch), ChAttrOf(ch));
       wch = _nc_render(win, wch);

       while (end >= start) {
           line->text[end] = wch;
           end--;
       }

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

Here is the call graph for this function: