Lines Matching refs:fp
50 freopen(const char *file, const char *mode, FILE *fp)
56 (void) fclose(fp);
63 FLOCKFILE(fp);
73 if (fp->_flags == 0) {
74 fp->_flags = __SEOF; /* hold on to it */
79 if (fp->_flags & __SWR)
80 (void) __sflush(fp);
82 isopen = fp->_close != NULL;
83 if ((wantfd = fp->_file) < 0 && isopen) {
84 (void) (*fp->_close)(fp->_cookie);
94 (void) (*fp->_close)(fp->_cookie);
102 * Finish closing fp. Even if the open succeeded above, we cannot
103 * keep fp->_base: it may be the wrong size. This loses the effect
107 (void) (*fp->_close)(fp->_cookie);
108 if (fp->_flags & __SMBF)
109 free((char *)fp->_bf._base);
110 fp->_w = 0;
111 fp->_r = 0;
112 fp->_p = NULL;
113 fp->_bf._base = NULL;
114 fp->_bf._size = 0;
115 fp->_lbfsize = 0;
116 if (HASUB(fp))
117 FREEUB(fp);
118 _UB(fp)._size = 0;
119 WCIO_FREE(fp);
120 if (HASLB(fp))
121 FREELB(fp);
122 fp->_lb._size = 0;
125 fp->_flags = 0; /* set it free */
126 FUNLOCKFILE(fp);
145 fp->_flags = 0; /* set it free */
146 FUNLOCKFILE(fp);
151 fp->_flags = flags;
152 fp->_file = f;
153 fp->_cookie = fp;
154 fp->_read = __sread;
155 fp->_write = __swrite;
156 fp->_seek = __sseek;
157 fp->_close = __sclose;
168 (void) __sseek(fp, 0, SEEK_END);
169 FUNLOCKFILE(fp);
170 return (fp);