Back to index

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

Go to the source code of this file.

Functions

 winnwstr (WINDOW *win, wchar_t *wstr, int n)
 winwstr (WINDOW *win, wchar_t *wstr)

Function Documentation

winnwstr ( WINDOW win,
wchar_t *  wstr,
int  n 
)

Definition at line 45 of file lib_inwstr.c.

{
    int row, col, inx;
    int count = 0;
    int last = 0;
    cchar_t *text;
    wchar_t wch;

    T((T_CALLED("winnwstr(%p,%p,%d)"), win, wstr, n));
    if (wstr != 0) {
       if (win) {
           getyx(win, row, col);

           text = win->_line[row].text;
           while (count < n && count != ERR) {
              if (!isnac(text[col])) {
                  for (inx = 0; (inx < CCHARW_MAX)
                      && ((wch = text[col].chars[inx]) != 0);
                      ++inx) {
                     if (count + 1 > n) {
                         if ((count = last) == 0) {
                            count = ERR;  /* error if we store nothing */
                         }
                         break;
                     }
                     wstr[count++] = wch;
                  }
              }
              last = count;
              if (++col > win->_maxx) {
                  break;
              }
           }
       }
       if (count > 0) {
           wstr[count] = '\0';
           T(("winnwstr returns %s", _nc_viswbuf(wstr)));
       }
    }
    returnCode(count);
}

Here is the caller graph for this function:

winwstr ( WINDOW win,
wchar_t *  wstr 
)

Definition at line 93 of file lib_inwstr.c.

{
    int result = OK;
    T((T_CALLED("winwstr(%p,%p)"), win, wstr));
    if (winnwstr(win, wstr, CCHARW_MAX * (win->_maxx - win->_curx + 1)) == ERR)
       result = ERR;
    returnCode(result);
}

Here is the call graph for this function: