United States    
COMPAQ STORE | PRODUCTS |
SERVICES | SUPPORT | CONTACT US | SEARCH
Compaq C

Compaq C
Run-Time Library Reference Manual for OpenVMS Systems


Previous Contents Index


[w]inch

Return the character at the current cursor position on the specified window without making changes to the window. The inch function acts on the stdscr window.

Format

#include <curses.h>

char inch();

char winch (WINDOW *win);


Argument

win

A pointer to the window.

Return Values

x The returned character.
ERR Indicates an input error.

index

Search for a character in a string.

Format

#include <strings.h>

char *index (const char *s, int c);

Function Variants This function also has variants named _index32 and _index64 for use with 32-bit and 64-bit pointer sizes, respectively. See Section 1.8 for more information on using pointer-size-specific functions.

Arguments

s

The string to search.

c

The character to search for.

Description

The index function is identical to the strchr function, and is provided for compatibility with some UNIX implementations.

initscr

Initializes the terminal-type data and all screen functions. You must call initscr before using any of the curses functions.

Format

#include <curses.h>

void initscr (void);


Description

The OpenVMS Curses version of this function clears the screen before doing the initialization. The BSD-based Curses version does not.

initstate

Initializes random number generators.

Format

#include <stdlib.h>

char *initstate (unsigned int seed, char *state, int size);


Arguments

seed

An initial seed value.

state

Pointer to an array of state information.

size

The size of the state information array.

Description

This function initializes random number generators. It lets you initialize for future use, a state array passed as an argument. The size in bytes of the state array is used by the initstate function to decide how sophisticated a random number generator to use; the larger the state array, the more random the numbers.

Values for the amount of state information are 8, 32, 64, 128, and 256 bytes. Amounts less than 8 bytes generate an error, while other amounts are rounded down to the nearest known value.

The seed argument specifies a starting point for the random number sequence and provides for restarting at the same point. The initstate function returns a pointer to the previous state information array.

Once you initialize a state, the setstate function allows rapid switching between states. The array defined by the state argument is used for further random number generation until the initstate function is called or the setstate function is called again. The setstate function returns a pointer to the previous state array.

After initialization, you can restart a state array at a different point in one of two ways:

See also setstate , srandom , and random , in this section.


Return Values

x A pointer to the previous state array information.
0 Indicates an error. Call made with less than 8 bytes of state information. Further specified in the global errno .

[w]insch

Insert a character at the current cursor position in the specified window. The insch function acts on the stdscr window.

Format

#include <curses.h>

int insch (char ch);

int winsch (WINDOW *win, char ch);


Arguments

win

A pointer to the window.

ch

The character to be inserted.

Description

After the character is inserted, each character on the line shifts to the right, and the last character in the line is deleted. For more information, see the scrollok function in this section.

Return Values

OK Indicates success.
ERR Indicates that the function makes the screen scroll illegally.

[w]insertln

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 in this section.

Return Values

OK Indicates success.
ERR Indicates that the function makes the screen scroll illegally.

[w]insstr

Insert a string at the current cursor position in the specified window. The insstr function acts on the stdscr window.

Format

#include <curses.h>

int insstr (char *str);

int winsstr (WINDOW *win, char *str);


Arguments

win

A pointer to the window.

str

A pointer to the string to be inserted.

Description

Each character after the string shifts to the right, and the last character disappears. These functions are specific to Compaq C for OpenVMS Systems and are not portable.

Return Values

OK Indicates success.
ERR Indicates that the function makes the screen scroll illegally. For more information, see the scrollok function in this section.

isalnum

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

Format

#include <ctype.h>

int isalnum (int character);


Argument

character

An object of type int . The value of character must be representable as an unsigned char or must equal the value of the macro EOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If alphanumeric.
0 If not alphanumeric.

isalpha

Indicates if a character is classed as an alphabetic character in the program's current locale.

Format

#include <ctype.h>

int isalpha (int character);


Argument

character

An object of type int . The value of character must be representable as an unsigned char or must equal the value of the macro EOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If alphabetic.
0 If not alphabetic.

isapipe

Indicates if a specified file descriptor is associated with a pipe.

Format

#include <unixio.h>

int isapipe (int file_desc);


Argument

file_desc

A file descriptor.

Description

For more information about pipes, see Chapter 5.

Return Values

1 Indicates an association with a pipe.
0 Indicates no association with a pipe.
--1 Indicates an error (for example, if the file descriptor is not associated with an open file).

isascii

Indicates if a character is an ASCII character.

Format

#include <ctype.h>

int isascii (int character);


Argument

character

An object of type char .

Return Values

nonzero If ASCII.
0 If not ASCII.

isatty

Indicates if a specified file descriptor is associated with a terminal.

Format

#include <unistd.h>

int isatty (int file_desc);


Argument

file_desc

A file descriptor.

Return Values

1 If the file descriptor is associated with a terminal.
0 If the file descriptor is not associated with a terminal.
--1 Indicates an error (for example, if the file descriptor is not associated with an open file).

iscntrl

Indicates if a character is classed as a control character in the program's current locale.

Format

#include <ctype.h>

int iscntrl (int character);


Argument

character

An object of type int . The value of character must be representable as an unsigned char or must equal the value of the macro EOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If a control character.
zero If not a control character.

isdigit

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

Format

#include <ctype.h>

int isdigit (int character);


Argument

character

An object of type int . The value of character must be representable as an unsigned char or must equal the value of the macro EOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If a decimal digit.
0 If not a decimal digit.

isgraph

Indicates if a character is classed as a graphic character in the program's current locale.

Format

#include <ctype.h>

int isgraph (int character);


Argument

character

An object of type int . The value of character must be representable as an unsigned char or must equal the value of the macro EOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If a graphic character.
0 If not a graphic character.

islower

Indicates if a character is classed as a lowercase character in the program's current locale.

Format

#include <ctype.h>

int islower (int character);


Argument

character

An object of type int . The value of character must be representable as an unsigned char or must equal the value of the macro EOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If a lowercase alphabetic character.
0 If not a lowercase alphabetic character.

isprint

Indicates if a character is classed as a printing character in the program's current locale.

Format

#include <ctype.h>

int isprint (int character);


Argument

character

An object of type int . The value of character must be representable as an unsigned char or must equal the value of the macro EOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If a printing character.
0 If not a printing character.

ispunct

Indicates if a character is classed as a punctuation character in the program's current locale.

Format

#include <ctype.h>

int ispunct (int character);


Argument

character

An object of type int . The value of character must be representable as an unsigned char or must equal the value of the macro EOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If a punctuation character.
0 If not a punctuation character.

isspace

Indicates if a character is classed as white space in the program's current locale; that is, if it is an ASCII space, tab (horizontal or vertical), carriage-return, form-feed, or new-line character.

Format

#include <ctype.h>

int isspace (int character);


Argument

character

An object of type int . The value of character must be representable as an unsigned char or must equal the value of the macro EOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If a white-space character.
0 If not a white-space character.

isupper

Indicates if a character is classed as an uppercase character in the program's current locale.

Format

#include <ctype.h>

int isupper (int character);


Argument

character

An object of type int . The value of character must be representable as an unsigned char or must equal the value of the macro EOF. If it has any other value, the behavior is undefined.

Return Values

nonzero If an uppercase alphabetic character.
0 If not an uppercase alphabetic character.

iswalnum

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);


Arguments

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

nonzero If alphanumeric.
0 If not alphanumeric.

iswalpha

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

Format

#include <wctype.h> (ISO C)

#include <wchar.h> (XPG4)

int iswalpha (wint_t wc);


Arguments

wc

An object of type wint_t . The value of wc 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

nonzero If alphabetic.
0 If not alphabetic.

iswcntrl

Indicates if a wide character is classed as a control character in the program's current locale.

Format

#include <wctype.h> (ISO C)

#include <wchar.h> (XPG4)

int iswcntrl (wint_t wc);


Arguments

wc

An object of type wint_t . The value of wc 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

nonzero If a control character.
0 If not a control character.


Previous Next Contents Index
  

1.800.AT.COMPAQ

privacy and legal statement