Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ fgetws(3S) — SunOS 5.6

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ferror(3S)

fread(3S)

getwc(3S)

putws(3S)

scanf(3S)

attributes(5)

getws(3S)

NAME

getws, fgetws − convert a string of EUC characters from the stream to Process Code

SYNOPSIS

#include <stdio.h>
#include <widec.h>

wchar_t ∗getws(wchar_t ∗s);

wchar_t ∗fgetws(wchar_t ∗s, int n, FILE ∗stream);

DESCRIPTION

The getws() function reads a string of Extended Unix Code (EUC) characters from the standard input stream, stdin, converts it to process code, and writes it to the array pointed to by s, until a new-line character is read or an end-of-file condition is encountered. The new-line character is discarded and the string is terminated with a wchar_t NULL character.  The getws() function returns its argument. 

The fgetws() function reads EUC characters from the stream, converts them to Process Code, and writes them to the array pointed to by s.  It stops when either n−1 characters are read, a new-line character is read and transferred to s, or an end-of-file condition is encountered. The string is then terminated with a wchar_t NULL character.  The fgetws() function returns its first argument. 

RETURN VALUES

If end-of-file is encountered and no characters have been read, no characters are transferred to s and a NULL pointer is returned.  If a read error occurs, such as trying to use these functions on a file that has not been opened for reading, a NULL pointer is returned.  Otherwise s is returned. 

ERRORS

The fgetws() function will fail if data needs to be read and:

EOVERFLOW The file is a regular file and an attempt was made to read at or beyond the offset maximum associated with the corresponding stream.

ATTRIBUTES

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE ATTRIBUTE VALUE
MT-Level MT-Safe

SEE ALSO

ferror(3S), fread(3S), getwc(3S), putws(3S), scanf(3S), attributes(5)

SunOS 5.6  —  Last change: 22 Apr 1997

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