Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ wechowchar(3) — OSF/1 3.0 αXP

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

clrtoeol(3)

inwch(3)

putwchar(3)

scrollok(3)

standout(3)

addwch(3)  —  Subroutines

NAME

addwch, waddwch, mvaddwch, mvwaddwch, echowchar, wechowchar − Add a wchar_t character (with attributes) to a curses window

LIBRARY

The curses library (libcurses.so, libcurses.a)

SYNOPSIS

#include <curses.h>

int addwch(chtype wch);

int waddwch(
        WINDOW ∗win,
        chtype wch);

int mvaddwch(
        int y,
        int x,
        chtype wch);

int mvwaddwch(
        WINDOW ∗win,
        int y,
        int x,
        chtype wch);

int echowchar(chtype wch);

int wechowchar(
        WINDOW ∗win,
        chtype wch);

PARAMETERS

wchSpecifies the wide character being added to the window. 

winSpecifies a curses window. If not specified, the window is the default window stdscr. 

y, xSpecifies the line (y) and column (x) coordinates of the target position on the window.  If coordinates are not specified, the target position is the current position of the logical cursor. 

DESCRIPTION

The addwch routine adds the wchar_t character wch to the default window at the current cursor position and the window cursor is advanced.  The character is of the type chtype, which is defined in the <curses.h> header file as containing both data and attributes. 

The waddwch routine adds the wchar_t character wch to the specified window at the current cursor position.  The cursor position is advanced. 

The mvaddwch routine moves the cursor to the specified (y, x) position and adds the wchar_t character wch to the default window.  The cursor position is advanced after the character has been added. 

The mvwaddwch routine moves the cursor to the specified (y, x) position and adds the wchar_t character wch to the specified window.  The cursor position is advanced after the character has been added. 

The echowchar routine adds the wchar_t character wch to the default window at the current cursor position and the window cursor is advanced. The screen is also refreshed. 

The wechowchar routine adds the wchar_t character wch to the specified window at the current cursor position.  The cursor position is advanced and the screen is also refreshed. 

All these routines are similar to the putwchar routine.  The following information applies to all the routines. 

If the cursor moves into the right margin, a newline character is generated automatically.  If scrollok is enabled and a character is added to the bottom right corner of the screen, the scrolling region is scrolled up one line.  If scrolling is not allowed, ERR is returned. 

If wch is a tab, newline, or backspace, the cursor is moved appropriately within the window.  If wch is a newline, the clrtoeol routine is called before the cursor is moved to the beginning of the next line.  If newline mapping is off, the cursor is moved to the next line, but the x coordinate is unchanged.  If wch is a tab, the cursor is moved to the next tab position within the window.  If wch is another control character, it will be drawn in the ^X notation.  Calling the inwch routine after adding a control character returns the representation of the control character, not the control character. 

A logical OR operation can combine video attributes with a character in the parameter. This operation:

       •Sets the video attributes

       •Allows you to copy text, including attributes, from one place to another using the inwch and addwch routines

For more information, see the standout(3) reference page. 

The addwch, mvaddwch, mvwaddwch, echowchar, and wechowchar routines are macros. 

RETURN VALUES

The addwch, waddwch, mvaddwch, mvwaddwch, echowchar and wechowchar, routines return OK on success and ERR on error. 

RELATED INFORMATION

Functions: clrtoeol(3), inwch(3), putwchar(3), scrollok(3), standout(3). 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026