[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    getws(3I) manual page Table of Contents

Name

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

Synopsis

cc [ flag ... ] file ... -lw [ library ... ]


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

wchar_t *getws(wchar_t *s);

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

MT-Level

MT-Safe

Description

getws() 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. getws() returns its argument.

fgetws() 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. fgetws() 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.

See Also

ferror(3S) , fread(3S) , getwc(3I) , putws(3I) , scanf(3S)


Table of Contents