Documentation updates.
* libc/stdio/ungetc.c: Document ungetc. * libc/stdio/Makefile.am (CHEWOUT_FILES): Sort, match current list of files with documentation. * libc/stdio/Makefile.in: Regenerate. * libc/stdio/stdio.tex: Sort and update stdio documentation index.
This commit is contained in:
@ -1,3 +1,12 @@
|
|||||||
|
2007-07-13 Eric Blake <ebb9@byu.net>
|
||||||
|
|
||||||
|
Documentation updates.
|
||||||
|
* libc/stdio/ungetc.c: Document ungetc.
|
||||||
|
* libc/stdio/Makefile.am (CHEWOUT_FILES): Sort, match current list
|
||||||
|
of files with documentation.
|
||||||
|
* libc/stdio/Makefile.in: Regenerate.
|
||||||
|
* libc/stdio/stdio.tex: Sort and update stdio documentation index.
|
||||||
|
|
||||||
2007-07-11 Jeff Johnston <jjohnstn@redhat.com>
|
2007-07-11 Jeff Johnston <jjohnstn@redhat.com>
|
||||||
|
|
||||||
* libc/include/math.h: Fix so C99 functions/macros are accessible
|
* libc/include/math.h: Fix so C99 functions/macros are accessible
|
||||||
|
@ -179,7 +179,6 @@ CHEWOUT_FILES = \
|
|||||||
fgetpos.def \
|
fgetpos.def \
|
||||||
fgets.def \
|
fgets.def \
|
||||||
fileno.def \
|
fileno.def \
|
||||||
fiprintf.def \
|
|
||||||
fopen.def \
|
fopen.def \
|
||||||
fopencookie.def \
|
fopencookie.def \
|
||||||
fputc.def \
|
fputc.def \
|
||||||
@ -192,8 +191,8 @@ CHEWOUT_FILES = \
|
|||||||
funopen.def \
|
funopen.def \
|
||||||
fwrite.def \
|
fwrite.def \
|
||||||
getc.def \
|
getc.def \
|
||||||
getchar.def \
|
|
||||||
getc_u.def \
|
getc_u.def \
|
||||||
|
getchar.def \
|
||||||
getchar_u.def \
|
getchar_u.def \
|
||||||
getdelim.def \
|
getdelim.def \
|
||||||
getline.def \
|
getline.def \
|
||||||
@ -202,8 +201,8 @@ CHEWOUT_FILES = \
|
|||||||
mktemp.def \
|
mktemp.def \
|
||||||
perror.def \
|
perror.def \
|
||||||
putc.def \
|
putc.def \
|
||||||
putchar.def \
|
|
||||||
putc_u.def \
|
putc_u.def \
|
||||||
|
putchar.def \
|
||||||
putchar_u.def \
|
putchar_u.def \
|
||||||
puts.def \
|
puts.def \
|
||||||
putw.def \
|
putw.def \
|
||||||
@ -220,6 +219,7 @@ CHEWOUT_FILES = \
|
|||||||
sscanf.def \
|
sscanf.def \
|
||||||
tmpfile.def \
|
tmpfile.def \
|
||||||
tmpnam.def \
|
tmpnam.def \
|
||||||
|
ungetc.def \
|
||||||
vfprintf.def \
|
vfprintf.def \
|
||||||
vfscanf.def \
|
vfscanf.def \
|
||||||
viprintf.def \
|
viprintf.def \
|
||||||
|
@ -463,7 +463,6 @@ CHEWOUT_FILES = \
|
|||||||
fgetpos.def \
|
fgetpos.def \
|
||||||
fgets.def \
|
fgets.def \
|
||||||
fileno.def \
|
fileno.def \
|
||||||
fiprintf.def \
|
|
||||||
fopen.def \
|
fopen.def \
|
||||||
fopencookie.def \
|
fopencookie.def \
|
||||||
fputc.def \
|
fputc.def \
|
||||||
@ -476,8 +475,8 @@ CHEWOUT_FILES = \
|
|||||||
funopen.def \
|
funopen.def \
|
||||||
fwrite.def \
|
fwrite.def \
|
||||||
getc.def \
|
getc.def \
|
||||||
getchar.def \
|
|
||||||
getc_u.def \
|
getc_u.def \
|
||||||
|
getchar.def \
|
||||||
getchar_u.def \
|
getchar_u.def \
|
||||||
getdelim.def \
|
getdelim.def \
|
||||||
getline.def \
|
getline.def \
|
||||||
@ -486,8 +485,8 @@ CHEWOUT_FILES = \
|
|||||||
mktemp.def \
|
mktemp.def \
|
||||||
perror.def \
|
perror.def \
|
||||||
putc.def \
|
putc.def \
|
||||||
putchar.def \
|
|
||||||
putc_u.def \
|
putc_u.def \
|
||||||
|
putchar.def \
|
||||||
putchar_u.def \
|
putchar_u.def \
|
||||||
puts.def \
|
puts.def \
|
||||||
putw.def \
|
putw.def \
|
||||||
@ -504,6 +503,7 @@ CHEWOUT_FILES = \
|
|||||||
sscanf.def \
|
sscanf.def \
|
||||||
tmpfile.def \
|
tmpfile.def \
|
||||||
tmpnam.def \
|
tmpnam.def \
|
||||||
|
ungetc.def \
|
||||||
vfprintf.def \
|
vfprintf.def \
|
||||||
vfscanf.def \
|
vfscanf.def \
|
||||||
viprintf.def \
|
viprintf.def \
|
||||||
|
@ -25,9 +25,11 @@ structure.
|
|||||||
|
|
||||||
@menu
|
@menu
|
||||||
* clearerr:: Clear file or stream error indicator
|
* clearerr:: Clear file or stream error indicator
|
||||||
|
* diprintf:: Print to a file descriptor (integer only)
|
||||||
* dprintf:: Print to a file descriptor
|
* dprintf:: Print to a file descriptor
|
||||||
* fclose:: Close a file
|
* fclose:: Close a file
|
||||||
* fcloseall:: Close all files
|
* fcloseall:: Close all files
|
||||||
|
* fdopen:: Turn an open file into a stream
|
||||||
* feof:: Test for end of file
|
* feof:: Test for end of file
|
||||||
* ferror:: Test whether read/write error has occurred
|
* ferror:: Test whether read/write error has occurred
|
||||||
* fflush:: Flush buffered file output
|
* fflush:: Flush buffered file output
|
||||||
@ -36,7 +38,7 @@ structure.
|
|||||||
* fgets:: Get character string from a file or stream
|
* fgets:: Get character string from a file or stream
|
||||||
* fileno:: Get file descriptor associated with stream
|
* fileno:: Get file descriptor associated with stream
|
||||||
* fopen:: Open a file
|
* fopen:: Open a file
|
||||||
* fdopen:: Turn an open file into a stream
|
* fopencookie:: Open a stream with custom callbacks
|
||||||
* fputc:: Write a character on a stream or file
|
* fputc:: Write a character on a stream or file
|
||||||
* fputs:: Write a character string in a file or stream
|
* fputs:: Write a character string in a file or stream
|
||||||
* fread:: Read array elements from a file
|
* fread:: Read array elements from a file
|
||||||
@ -44,6 +46,7 @@ structure.
|
|||||||
* fseek:: Set file position
|
* fseek:: Set file position
|
||||||
* fsetpos:: Restore position of a stream or file
|
* fsetpos:: Restore position of a stream or file
|
||||||
* ftell:: Return position in a stream or file
|
* ftell:: Return position in a stream or file
|
||||||
|
* funopen:: Open a stream with custom callbacks
|
||||||
* fwrite:: Write array elements from memory to a file or stream
|
* fwrite:: Write array elements from memory to a file or stream
|
||||||
* getc:: Get a character from a file or stream (macro)
|
* getc:: Get a character from a file or stream (macro)
|
||||||
* getc_unlocked:: Get a character from a file or stream (macro)
|
* getc_unlocked:: Get a character from a file or stream (macro)
|
||||||
@ -68,21 +71,25 @@ structure.
|
|||||||
* setbuffer:: Specify full buffering for a file or stream with size
|
* setbuffer:: Specify full buffering for a file or stream with size
|
||||||
* setlinebuf:: Specify line buffering for a file or stream
|
* setlinebuf:: Specify line buffering for a file or stream
|
||||||
* setvbuf:: Specify buffering for a file or stream
|
* setvbuf:: Specify buffering for a file or stream
|
||||||
* printf:: Write formatted output
|
* siprintf:: Write formatted output (integer only)
|
||||||
* scanf:: Scan and format input
|
* siscanf:: Scan and format input (integer only)
|
||||||
* iprintf:: Write formatted output (integer only)
|
* sprintf:: Write formatted output
|
||||||
* iscanf:: Scan and format input (integer only)
|
* sscanf:: Scan and format input
|
||||||
* tmpfile:: Create a temporary file
|
* tmpfile:: Create a temporary file
|
||||||
* tmpnam:: Generate name for a temporary file
|
* tmpnam:: Generate name for a temporary file
|
||||||
* viprintf:: Format variable argument list for non-floating-point output
|
* ungetc:: Push data back into a stream
|
||||||
* viscanf:: Scan variable format list for non-floating-point input
|
* vfprintf:: Format variable argument list
|
||||||
* vprintf:: Format variable argument list
|
* vfscanf:: Scan variable argument list
|
||||||
* vscanf:: Format variable argument list
|
* viprintf:: Format variable argument list (integer only)
|
||||||
|
* viscanf:: Scan variable format list (integer only)
|
||||||
@end menu
|
@end menu
|
||||||
|
|
||||||
@page
|
@page
|
||||||
@include stdio/clearerr.def
|
@include stdio/clearerr.def
|
||||||
|
|
||||||
|
@page
|
||||||
|
@include stdio/diprintf.def
|
||||||
|
|
||||||
@page
|
@page
|
||||||
@include stdio/dprintf.def
|
@include stdio/dprintf.def
|
||||||
|
|
||||||
@ -92,6 +99,9 @@ structure.
|
|||||||
@page
|
@page
|
||||||
@include stdio/fcloseall.def
|
@include stdio/fcloseall.def
|
||||||
|
|
||||||
|
@page
|
||||||
|
@include stdio/fdopen.def
|
||||||
|
|
||||||
@page
|
@page
|
||||||
@include stdio/feof.def
|
@include stdio/feof.def
|
||||||
|
|
||||||
@ -117,7 +127,7 @@ structure.
|
|||||||
@include stdio/fopen.def
|
@include stdio/fopen.def
|
||||||
|
|
||||||
@page
|
@page
|
||||||
@include stdio/fdopen.def
|
@include stdio/fopencookie.def
|
||||||
|
|
||||||
@page
|
@page
|
||||||
@include stdio/fputc.def
|
@include stdio/fputc.def
|
||||||
@ -212,24 +222,27 @@ structure.
|
|||||||
@page
|
@page
|
||||||
@include stdio/setvbuf.def
|
@include stdio/setvbuf.def
|
||||||
|
|
||||||
@page
|
|
||||||
@include stdio/sprintf.def
|
|
||||||
|
|
||||||
@page
|
|
||||||
@include stdio/sscanf.def
|
|
||||||
|
|
||||||
@page
|
@page
|
||||||
@include stdio/siprintf.def
|
@include stdio/siprintf.def
|
||||||
|
|
||||||
@page
|
@page
|
||||||
@include stdio/siscanf.def
|
@include stdio/siscanf.def
|
||||||
|
|
||||||
|
@page
|
||||||
|
@include stdio/sprintf.def
|
||||||
|
|
||||||
|
@page
|
||||||
|
@include stdio/sscanf.def
|
||||||
|
|
||||||
@page
|
@page
|
||||||
@include stdio/tmpfile.def
|
@include stdio/tmpfile.def
|
||||||
|
|
||||||
@page
|
@page
|
||||||
@include stdio/tmpnam.def
|
@include stdio/tmpnam.def
|
||||||
|
|
||||||
|
@page
|
||||||
|
@include stdio/ungetc.def
|
||||||
|
|
||||||
@page
|
@page
|
||||||
@include stdio/vfprintf.def
|
@include stdio/vfprintf.def
|
||||||
|
|
||||||
@ -241,4 +254,3 @@ structure.
|
|||||||
|
|
||||||
@page
|
@page
|
||||||
@include stdio/viscanf.def
|
@include stdio/viscanf.def
|
||||||
|
|
||||||
|
@ -14,6 +14,48 @@
|
|||||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
|
FUNCTION
|
||||||
|
<<ungetc>>---push data back into a stream
|
||||||
|
|
||||||
|
INDEX
|
||||||
|
ungetc
|
||||||
|
INDEX
|
||||||
|
_ungetc_r
|
||||||
|
|
||||||
|
ANSI_SYNOPSIS
|
||||||
|
#include <stdio.h>
|
||||||
|
int ungetc(int <[c]>, FILE *<[stream]>);
|
||||||
|
|
||||||
|
int _ungetc_r(struct _reent *<[reent]>, int <[c]>, FILE *<[stream]>);
|
||||||
|
|
||||||
|
DESCRIPTION
|
||||||
|
<<ungetc>> is used to return bytes back to <[stream]> to be read again.
|
||||||
|
If <[c]> is EOF, the stream is unchanged. Otherwise, the unsigned
|
||||||
|
char <[c]> is put back on the stream, and subsequent reads will see
|
||||||
|
the bytes pushed back in reverse order. Pushed byes are lost if the
|
||||||
|
stream is repositioned, such as by <<fseek>>, <<fsetpos>>, or
|
||||||
|
<<rewind>>.
|
||||||
|
|
||||||
|
The underlying file is not changed, but it is possible to push back
|
||||||
|
something different than what was originally read. Ungetting a
|
||||||
|
character will clear the end-of-stream marker, and decrement the file
|
||||||
|
position indicator. Pushing back beyond the beginning of a file gives
|
||||||
|
unspecified behavior.
|
||||||
|
|
||||||
|
The alternate function <<_ungetc_r>> is a reentrant version. The
|
||||||
|
extra argument <[reent]> is a pointer to a reentrancy structure.
|
||||||
|
|
||||||
|
RETURNS
|
||||||
|
The character pushed back, or <<EOF>> on error.
|
||||||
|
|
||||||
|
PORTABILITY
|
||||||
|
ANSI C requires <<ungetc>>, but only requires a pushback buffer of one
|
||||||
|
byte; although this implementation can handle multiple bytes, not all
|
||||||
|
can. Pushing back a signed char is a common application bug.
|
||||||
|
|
||||||
|
Supporting OS subroutines required: <<sbrk>>.
|
||||||
|
*/
|
||||||
|
|
||||||
#if defined(LIBC_SCCS) && !defined(lint)
|
#if defined(LIBC_SCCS) && !defined(lint)
|
||||||
static char sccsid[] = "%W% (Berkeley) %G%";
|
static char sccsid[] = "%W% (Berkeley) %G%";
|
||||||
@ -171,4 +213,3 @@ _DEFUN(ungetc, (c, fp),
|
|||||||
return _ungetc_r (_REENT, c, fp);
|
return _ungetc_r (_REENT, c, fp);
|
||||||
}
|
}
|
||||||
#endif /* !_REENT_ONLY */
|
#endif /* !_REENT_ONLY */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user