logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

ungetwc.3p (3982B)


  1. '\" et
  2. .TH UNGETWC "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. ungetwc
  12. \(em push wide-character code back into the input stream
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <stdio.h>
  17. #include <wchar.h>
  18. .P
  19. wint_t ungetwc(wint_t \fIwc\fP, FILE *\fIstream\fP);
  20. .fi
  21. .SH DESCRIPTION
  22. The functionality described on this reference page is aligned with the
  23. ISO\ C standard. Any conflict between the requirements described here and the
  24. ISO\ C standard is unintentional. This volume of POSIX.1\(hy2017 defers to the ISO\ C standard.
  25. .P
  26. The
  27. \fIungetwc\fR()
  28. function shall push the character corresponding to the wide-character
  29. code specified by
  30. .IR wc
  31. back onto the input stream pointed to by
  32. .IR stream .
  33. The pushed-back characters shall be returned by subsequent reads on that
  34. stream in the reverse order of their pushing. A successful intervening
  35. call (with the stream pointed to by
  36. .IR stream )
  37. to a file-positioning function (\c
  38. \fIfseek\fR(),
  39. \c
  40. \fIfseeko\fR(),
  41. \fIfsetpos\fR(),
  42. or
  43. \fIrewind\fR())
  44. or
  45. \fIfflush\fR()
  46. shall discard any pushed-back characters for the stream. The external
  47. storage corresponding to the stream is unchanged.
  48. .P
  49. At least one character of push-back shall be provided. If
  50. \fIungetwc\fR()
  51. is called too many times on the same stream without an intervening read
  52. or file-positioning operation on that stream, the operation may fail.
  53. .P
  54. If the value of
  55. .IR wc
  56. equals that of the macro WEOF, the operation shall fail and the input
  57. stream shall be left unchanged.
  58. .P
  59. A successful call to
  60. \fIungetwc\fR()
  61. shall clear the end-of-file indicator for the stream. The value of the
  62. file-position indicator for the stream after all pushed-back characters
  63. have been read, or discarded by calling
  64. \fIfseek\fR(),
  65. \c
  66. \fIfseeko\fR(),
  67. \fIfsetpos\fR(),
  68. or
  69. \fIrewind\fR()
  70. (but not
  71. \fIfflush\fR()),
  72. shall be the same as it was before the characters were pushed back. The
  73. file-position indicator is decremented (by one or more) by each successful
  74. call to
  75. \fIungetwc\fR();
  76. if its value was 0 before a call, its value is unspecified after the call.
  77. .SH "RETURN VALUE"
  78. Upon successful completion,
  79. \fIungetwc\fR()
  80. shall return the wide-character code corresponding to the pushed-back
  81. character. Otherwise, it shall return WEOF.
  82. .SH ERRORS
  83. The
  84. \fIungetwc\fR()
  85. function may fail if:
  86. .TP
  87. .BR EILSEQ
  88. An invalid character sequence is detected, or a wide-character code
  89. does not correspond to a valid character.
  90. .LP
  91. .IR "The following sections are informative."
  92. .SH EXAMPLES
  93. None.
  94. .SH "APPLICATION USAGE"
  95. None.
  96. .SH RATIONALE
  97. None.
  98. .SH "FUTURE DIRECTIONS"
  99. None.
  100. .SH "SEE ALSO"
  101. .IR "Section 2.5" ", " "Standard I/O Streams",
  102. .IR "\fIfseek\fR\^(\|)",
  103. .IR "\fIfsetpos\fR\^(\|)",
  104. .IR "\fIread\fR\^(\|)",
  105. .IR "\fIrewind\fR\^(\|)",
  106. .IR "\fIsetbuf\fR\^(\|)"
  107. .P
  108. The Base Definitions volume of POSIX.1\(hy2017,
  109. .IR "\fB<stdio.h>\fP",
  110. .IR "\fB<wchar.h>\fP"
  111. .\"
  112. .SH COPYRIGHT
  113. Portions of this text are reprinted and reproduced in electronic form
  114. from IEEE Std 1003.1-2017, Standard for Information Technology
  115. -- Portable Operating System Interface (POSIX), The Open Group Base
  116. Specifications Issue 7, 2018 Edition,
  117. Copyright (C) 2018 by the Institute of
  118. Electrical and Electronics Engineers, Inc and The Open Group.
  119. In the event of any discrepancy between this version and the original IEEE and
  120. The Open Group Standard, the original IEEE and The Open Group Standard
  121. is the referee document. The original Standard can be obtained online at
  122. http://www.opengroup.org/unix/online.html .
  123. .PP
  124. Any typographical or formatting errors that appear
  125. in this page are most likely
  126. to have been introduced during the conversion of the source files to
  127. man page format. To report such errors, see
  128. https://www.kernel.org/doc/man-pages/reporting_bugs.html .