Back to index

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

Go to the source code of this file.

Functions

 NCURSES_EXPORT (bool)
 NCURSES_EXPORT (int)
 NCURSES_EXPORT (wint_t)

Function Documentation

Definition at line 37 of file charable.c.

{
    bool result;
#if HAVE_WCTOB
    result = (wctob(ch) == ch);
#else
    result = (_nc_to_char(ch) >= 0);
#endif
    return result;
}
NCURSES_EXPORT ( int  ) [read]

Definition at line 48 of file charable.c.

{
    int result;
#if HAVE_WCTOB
    result = wctob(ch);
#elif HAVE_WCTOMB
    char temp[MB_LEN_MAX];
    result = wctomb(temp, ch);
    if (strlen(temp) == 1)
       result = UChar(temp[0]);
    else
       result = -1;
#endif
    return result;
}

Here is the call graph for this function:

NCURSES_EXPORT ( wint_t  )

Definition at line 64 of file charable.c.

{
    wint_t result;
#if HAVE_BTOWC
    result = btowc(ch);
#elif HAVE_MBTOWC
    wchar_t convert;
    char temp[2];
    temp[0] = ch;
    temp[1] = '\0';
    if (mbtowc(&convert, temp, 1) >= 0)
       result = convert;
    else
       result = WEOF;
#endif
    return result;
}