Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

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

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

fopen(3)

fread(3)

fgetws(3)

getc(3)

gets(3)

putwc(3)

scanf(3)

getwc(3)  —  Subroutines

NAME

getwc, getwc_unlocked, fgetwc, getwchar − Get a character or word from an input stream

LIBRARY

Standard C Library (libc.a)

SYNOPSIS

#include <wchar.h> wint_t getwc(
FILE ∗stream); wint_t getwc_unlocked(
FILE ∗stream); wint_t fgetwc(
FILE ∗stream); wint_t getwchar(void);

PARAMETERS

streamSpecifies the input data. 

DESCRIPTION

The getwc() function gets the next wide character from the input stream specified by the stream parameter.  The fgetwc() function performs the same function as getwc(). 

The getwchar() function gets the next wide character from the standard input stream. 

The getwc_unlocked() function is functionally identical to the getwc() function, except that getwc_unlocked() may be safely used only within a scope that is protected by the flockfile() and funlockfile() functions used as a pair.  The caller must ensure that the stream is locked before these functions are used. 

RETURN VALUES

These functions return the wide character read or the constant WEOF (wide-character End-Of-File) at the end of the file or upon an error. 

ERRORS

If any of the following conditions occur, the getwc(), getwc(), getwc_unlocked(), and getwchar(), functions set errno to the corresponding value:

[EAGAIN]The O_NONBLOCK flag is set for the underlying stream and the process would be delayed by the read operation. 

[EBADF]The file descriptor underlying the stream is not a valid file descriptor or is not open for reading. 

[EINTR]The read operation was interrupted by a signal which was caught and no data was transferred. 

[EIO]The call is attempting to read from the process’s controlling terminal and either the process is ignoring or blocking the SIGTTIN signal or the process group is orphaned. 

[ENOMEM]Insufficient memory is available for the operation. 

[ENXIO]Device associated with stream does not exist. 

RELATED INFORMATION

Functions: fopen(3), fread(3), fgetws(3), getc(3), gets(3), putwc(3), scanf(3). 

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