Back to index

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

Go to the source code of this file.

Functions

 wadd_wch (WINDOW *win, const cchar_t *wch)
 wecho_wchar (WINDOW *win, const cchar_t *wch)

Function Documentation

wadd_wch ( WINDOW win,
const cchar_t *  wch 
)

Definition at line 41 of file lib_add_wch.c.

{
    PUTC_DATA;
    int n;
    int code = ERR;

    TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wadd_wch(%p, %s)"), win,
                                  _tracech_t(wch)));

    if (win != 0) {
       PUTC_INIT;
       while (PUTC_i < CCHARW_MAX) {
           if ((PUTC_ch = wch->chars[PUTC_i++]) == L'\0')
              break;
           if ((PUTC_n = wcrtomb(PUTC_buf, PUTC_ch, &PUT_st)) <= 0) {
              code = ERR;
              if (is8bits(PUTC_ch))
                  code = waddch(win, UChar(PUTC_ch) | wch->attr);
              break;
           }
           for (n = 0; n < PUTC_n; n++) {
              if ((code = waddch(win, UChar(PUTC_buf[n]) | wch->attr)) == ERR) {
                  break;
              }
           }
           if (code == ERR)
              break;
       }
    }

    TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_RETURN("%d"), code));
    return (code);
}

Here is the call graph for this function:

Here is the caller graph for this function:

wecho_wchar ( WINDOW win,
const cchar_t *  wch 
)

Definition at line 76 of file lib_add_wch.c.

{
    PUTC_DATA;
    int n;
    int code = ERR;

    TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wecho_wchar(%p, %s)"), win,
                                  _tracech_t(wch)));

    if (win != 0) {
       PUTC_INIT;
       while (PUTC_i < CCHARW_MAX) {
           if ((PUTC_ch = wch->chars[PUTC_i++]) == L'\0')
              break;
           if ((PUTC_n = wcrtomb(PUTC_buf, PUTC_ch, &PUT_st)) <= 0) {
              code = ERR;
              if (is8bits(PUTC_ch))
                  code = waddch(win, UChar(PUTC_ch) | wch->attr);
              break;
           }
           for (n = 0; n < PUTC_n; n++) {
              if ((code = waddch(win, UChar(PUTC_buf[n]) | wch->attr)) == ERR) {
                  break;
              }
           }
           if (code == ERR)
              break;
       }
       wrefresh(win);
    }

    TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_RETURN("%d"), code));
    return (code);
}

Here is the call graph for this function:

Here is the caller graph for this function: