Lines Matching +full:- +full:c

2  * Copyright (c) 1990 The Regents of the University of California.
19 <<ungetc>>---push data back into a stream
28 int ungetc(int <[c]>, FILE *<[stream]>);
30 int ungetc( int <[c]>, FILE *<[stream]>);
34 If <[c]> is EOF, the stream is unchanged. Otherwise, the unsigned
35 char <[c]> is put back on the stream, and subsequent reads will see
42 character will clear the end-of-stream marker, and decrement the file
53 ANSI C requires <<ungetc>>, but only requires a pushback buffer of one
71 * Expand the ungetc buffer `in place'. That is, adjust fp->_p when
74 * are all at the end (stack-style).
85 if (fp->_ub._base == fp->_ubuf) in __submore()
92 fp->_ub._base = p; in __submore()
93 fp->_ub._size = BUFSIZ; in __submore()
94 p += BUFSIZ - sizeof (fp->_ubuf); in __submore()
95 for (i = sizeof (fp->_ubuf); --i >= 0;) in __submore()
96 p[i] = fp->_ubuf[i]; in __submore()
97 fp->_p = p; in __submore()
100 i = fp->_ub._size; in __submore()
101 p = (unsigned char *) realloc ((void *) (fp->_ub._base), i << 1); in __submore()
105 fp->_p = p + i; in __submore()
106 fp->_ub._base = p; in __submore()
107 fp->_ub._size = i << 1; in __submore()
113 int c, in ungetc() argument
116 if (c == EOF) in ungetc()
121 have already been called to get the char we are un-getting. */ in ungetc()
128 fp->_flags &= ~__SEOF; in ungetc()
130 if ((fp->_flags & __SRD) == 0) in ungetc()
133 * Not already reading: no good unless reading-and-writing. in ungetc()
136 if ((fp->_flags & __SRW) == 0) in ungetc()
141 if (fp->_flags & __SWR) in ungetc()
148 fp->_flags &= ~__SWR; in ungetc()
149 fp->_w = 0; in ungetc()
150 fp->_lbfsize = 0; in ungetc()
152 fp->_flags |= __SRD; in ungetc()
154 c = (unsigned char) c; in ungetc()
163 if (fp->_r >= fp->_ub._size && __submore (fp)) in ungetc()
168 *--fp->_p = c; in ungetc()
169 fp->_r++; in ungetc()
171 return c; in ungetc()
180 if (fp->_bf._base != NULL && fp->_p > fp->_bf._base && fp->_p[-1] == c) in ungetc()
182 fp->_p--; in ungetc()
183 fp->_r++; in ungetc()
185 return c; in ungetc()
193 fp->_ur = fp->_r; in ungetc()
194 fp->_up = fp->_p; in ungetc()
195 fp->_ub._base = fp->_ubuf; in ungetc()
196 fp->_ub._size = sizeof (fp->_ubuf); in ungetc()
197 fp->_ubuf[sizeof (fp->_ubuf) - 1] = c; in ungetc()
198 fp->_p = &fp->_ubuf[sizeof (fp->_ubuf) - 1]; in ungetc()
199 fp->_r = 1; in ungetc()
201 return c; in ungetc()