Return Values

Insert a line above the line containing the current cursor position. The
insertln
function acts on the
stdscr
window.

Format

#include <curses.h>

int insertln();

int winsertln (WINDOW *win);

Argument

win

A pointer to the window.

Description

The current line and every line below it shifts down, and the bottom
line disappears. The inserted line is blank and the current
(y,x) coordinates remain the same. For more
information, see the
scrollok
function.

Return Values

Indicates if a wide character is classed either as alphabetic or as a
digit in the program's current locale.

Format

#include <wctype.h> (ISO C)

#include <wchar.h> (XPG4)

int iswalnum (wint_t wc);

Argument

wc

An object of type
wint_t
. The value of character must be representable as a
wchar_t
in the current locale, or must equal the value of the macro WEOF. If it
has any other value, the behavior is undefined.

Return Values

Format

#include <wctype.h> (ISO C)

#include <wchar.h> (XPG4)

int iswctype (wint_t wc, wctype_t wc_prop);

Arguments

wc

An object of type
wint_t
. The value of wc must be representable as a valid
wide-character code in the current locale, or must equal the value of
the macro WEOF. If it has any other value, the behavior is undefined.

wc_prop

A valid property name in the current locale. This is set up by calling
the
wctype
function.

Description

The
iswctype
function tests whether wc has the character-class property
wc_prop. Set wc_prop by calling the
wctype
function.

See also
wctype
.

Return Values

nonzero

If the character has the property
wc_prop.

0

If the character does not have the property
wc_prop.

Example

#include <locale.h>
#include <wchar.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
/* This test will set up the "upper" character class using */
/* wctype() and then verify whether the characters 'a' and 'A' */
/* are members of this class */
#include <stdlib.h>
main()
{
wchar_t w_char1,
w_char2;
wctype_t ret_val;
char *char1 = "a";
char *char2 = "A";
ret_val = wctype("upper");
/* Convert char1 to wide-character format - w_char1 */
if (mbtowc(&w_char1, char1, 1) == -1) {
perror("mbtowc");
exit(EXIT_FAILURE);
}
if (iswctype((wint_t) w_char1, ret_val))
printf("[%C] is a member of the character class upper\n",
w_char1);
else
printf("[%C] is not a member of the character class upper\n",
w_char1);
/* Convert char2 to wide-character format - w_char2 */
if (mbtowc(&w_char2, char2, 1) == -1) {
perror("mbtowc");
exit(EXIT_FAILURE);
}
if (iswctype((wint_t) w_char2, ret_val))
printf("[%C] is a member of the character class upper\n",
w_char2);
else
printf("[%C] is not a member of the character class upper\n",
w_char2);
}

Running the example program produces the following result:

[a] is not a member of the character class upper
[A] is a member of the character class upper