Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > U

ungetwc(3C)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

ungetwc() — push a wide character back into an input stream

SYNOPSIS

#include <wchar.h>

wint_t ungetwc(wint_t wc, FILE *stream);

Obsolescent Interface

wint_t ungetwc_unlocked(wint_t wc, FILE *stream);

Remarks:

This function is compliant with the XPG4 Worldwide Portability Interface wide-character I/O functions. It parallels the 8-bit character I/O function defined in ungetc(3S).

DESCRIPTION

ungetwc() pushes the character corresponding to the wide-character code wc into the buffer associated with an input stream. That wide-character code, wc, is returned by the next call to getwc() (see getwc(3C)) on that stream. A successful intervening call to a file positioning function with stream (fseek(), fsetpos(), or rewind()) erases all memory of the pushed-back characters.

ungetwc() affects only the buffer associated with the input stream. It does not affect the contents of the file corresponding to stream.

One character of pushback is guaranteed.

If wc equals WEOF, ungetwc() does nothing to the buffer and returns WEOF.

The definition for this function, the type wint_t and the value WEOF are provided in the <wchar.h> header.

Obsolescent Interface

ungetwc_unlocked() pushes a wide character back into an input stream.

APPLICATION USAGE

After ungetwc() is applied to a stream, the stream becomes wide-oriented (see orientation(5)).

EXTERNAL INFLUENCES

Locale

The LC_CTYPE category determines how wide character conversions are done.

International Code Set Support

Single- and multi-byte character code sets are supported.

RETURN VALUE

If successful, ungetwc() and ungetwc_unlocked() return wc and clear the end-of-file indicator for the stream. ungetwc() and ungetwc_unlocked() return WEOF if they cannot insert the wide character.

WARNINGS

ungetwc_unlocked() is an obsolescent interface supported only for compatibility with existing DCE applications. New multithreaded applications should use ungetwc().

AUTHOR

ungetwc() and ungetwc_unlocked() were developed by OSF and HP.

STANDARDS CONFORMANCE

ungetwc(): XPG4

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.