Back to index

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

Go to the source code of this file.

Functions

static void _nc_insert_wch (WINDOW *win, const cchar_t *wch)
 wins_wch (WINDOW *win, const cchar_t *wch)
 wins_nwstr (WINDOW *win, const wchar_t *wstr, int n)

Function Documentation

static void _nc_insert_wch ( WINDOW win,
const cchar_t *  wch 
) [static]

Definition at line 49 of file lib_ins_wch.c.

{
    if (win->_curx <= win->_maxx) {
       struct ldat *line = &(win->_line[win->_cury]);
       NCURSES_CH_T *end = &(line->text[win->_curx]);
       NCURSES_CH_T *temp1 = &(line->text[win->_maxx]);
       NCURSES_CH_T *temp2 = temp1 - 1;

       CHANGED_TO_EOL(line, win->_curx, win->_maxx);
       while (temp1 > end)
           *temp1-- = *temp2--;

       *temp1 = _nc_render(win, *wch);

       win->_curx++;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

wins_nwstr ( WINDOW win,
const wchar_t *  wstr,
int  n 
)

Definition at line 91 of file lib_ins_wch.c.

{
    int code = ERR;
    NCURSES_SIZE_T oy;
    NCURSES_SIZE_T ox;
    const wchar_t *cp;

    T((T_CALLED("wins_nwstr(%p,%s,%d)"), win, _nc_viswbufn(wstr, n), n));

    if (win != 0
       && wstr != 0) {
       if (n < 1)
           n = wcslen(wstr);
       if (n > 0) {
           oy = win->_cury;
           ox = win->_curx;
           for (cp = wstr; *cp && ((cp - wstr) < n); cp++) {
              if (wcwidth(*cp) > 1) {
                  cchar_t tmp_cchar;
                  wchar_t tmp_wchar = *cp;
                  memset(&tmp_cchar, 0, sizeof(tmp_cchar));
                  (void) setcchar(&tmp_cchar,
                                &tmp_wchar,
                                WA_NORMAL,
                                0,
                                (void *) 0);
                  _nc_insert_wch(win, &tmp_cchar);
              } else {
                  _nc_insert_ch(win, *cp);       /* tabs, other ASCII stuff */
              }
           }

           win->_curx = ox;
           win->_cury = oy;
           _nc_synchook(win);
       }
       code = OK;
    }
    returnCode(code);
}

Here is the call graph for this function:

wins_wch ( WINDOW win,
const cchar_t *  wch 
)

Definition at line 68 of file lib_ins_wch.c.

{
    NCURSES_SIZE_T oy;
    NCURSES_SIZE_T ox;
    int code = ERR;

    T((T_CALLED("wins_wch(%p, %s)"), win, _tracecchar_t(wch)));

    if (win != 0) {
       oy = win->_cury;
       ox = win->_curx;

       _nc_insert_wch(win, wch);

       win->_curx = ox;
       win->_cury = oy;
       _nc_synchook(win);
       code = OK;
    }
    returnCode(code);
}

Here is the call graph for this function: