*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> getwc (3)              
Title
Content
Arch
Section
 

getwc(3)

Contents


NAME    [Toc]    [Back]

       getwc, getwc_unlocked, fgetwc, getwchar - Get a wide character
 from an input stream

SYNOPSIS    [Toc]    [Back]

       #include <stdio.h> #include <wchar.h>

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

       wint_t getwchar(
               void );

LIBRARY    [Toc]    [Back]

       Standard C Library (libc)

STANDARDS    [Toc]    [Back]

       Interfaces documented on this reference  page  conform  to
       industry standards as follows:

       fgetwc(), getwc(), getwchar(): XSH5.0

       Refer to the standards(5) reference page for more information
 about industry standards and associated tags.

PARAMETERS    [Toc]    [Back]

       Specifies an input stream from a file.

DESCRIPTION    [Toc]    [Back]

       The fgetwc() function gets the  next  character  from  the
       input  stream  specified by the stream parameter, converts
       it to a wide-character code, and advances  the  associated
       file  position  indicator  for  the  stream.  If  an error
       occurs, the file position indicator is indeterminate. This
       function also marks the st_atime field of the file associated
 with stream for update.

       The  getwc()  function  performs  the  same  function   as
       fgetwc()  but can be implemented as a macro on implementations
 that conform to X/Open standards.

       The getwchar() function gets the next wide character  from
       the  standard input stream. This function is equivalent to
       getwc(stdin).

       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.

       On  return from calls to the preceding functions, applications
  should  use  ferror()  and  feof()  to  distinguish
       between error and end-of-file conditions.





NOTES    [Toc]    [Back]

       Because  getwc()  can  be implemented as a macro, applications
 should not use it with a stream argument that is  an
       expression  with  side effects (for example, getwc(*f++)).
       The fgetwc() function  is  recommended  over  getwc()  for
       reading characters from a stream associated with a file.

       If the value returned by the getwchar() function is stored
       into a variable of type wchar_t and then compared  to  the
       macro  WEOF  (defined as type wint_t in the wchar.h header
       file), the comparison may never succeed.

RETURN VALUES    [Toc]    [Back]

       These functions return either the resultant wide-character
       code  or,  for  error and end-of-file conditions, the constant
 WEOF (wide-character End-Of-File).

ERRORS    [Toc]    [Back]

       If any of the following conditions  occur,  the  fgetwc(),
       getwc(),  getwc_unlocked(),  and getwchar(), functions set
       errno to the corresponding value: The O_NONBLOCK option is
       set  for the file descriptor underlying the stream parameter
 and the process would be delayed by  the  read  operation.
  The file descriptor underlying the stream parameter
       is not a valid file descriptor open for reading.  The data
       obtained  from the input stream does not form a valid wide
       character in the current locale.  The read  operation  was
       interrupted  by  a signal that was caught, and no data was
       transferred.  One of the following  errors  occurred:  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.  A
       physical I/O error occurred.  This  condition  is  defined
       starting with XSH Issue 4, Version 2.  Insufficient memory
       is available for the  operation.   The  device  associated
       with  stream  either  does  not exist or cannot handle the
       request.  The file is a regular file and  an  attempt  was
       made  to  read  at or beyond the offset maximum associated
       with the corresponding stream.

SEE ALSO    [Toc]    [Back]

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

       Standards: standards(5)



                                                         getwc(3)
[ Back ]
 Similar pages
Name OS Title
ungetwc NetBSD un-get wide-character from input stream
getwchar FreeBSD get next wide-character from input stream
ungetwc FreeBSD un-get wide-character from input stream
getwc NetBSD get next wide-character from input stream
getwchar NetBSD get next wide-character from input stream
fgetwc NetBSD get next wide-character from input stream
getwc FreeBSD get next wide-character from input stream
fgetwc FreeBSD get next wide-character from input stream
ungetc Tru64 Push a byte or wide-character code back into the input stream
ungetwc Tru64 Push a byte or wide-character code back into the input stream
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service