Searched refs:fp (Results 1 - 25 of 62) sorted by relevance

123

/bionic/libc/stdio/
H A Drget.c43 __srget(FILE *fp) argument
45 _SET_ORIENTATION(fp, -1);
46 if (__srefill(fp) == 0) {
47 fp->_r--;
48 return (*fp->_p++);
H A Drefill.c40 lflush(FILE *fp) argument
43 if ((fp->_flags & (__SLBF|__SWR)) == (__SLBF|__SWR))
44 return (__sflush(fp));
53 __srefill(FILE *fp) argument
60 fp->_r = 0; /* largely a convenience for callers */
63 if (fp->_flags & __SEOF)
67 if ((fp->_flags & __SRD) == 0) {
68 if ((fp->_flags & __SRW) == 0) {
70 fp->_flags |= __SERR;
74 if (fp
[all...]
H A Dclrerr.c38 clearerr(FILE *fp) argument
40 flockfile(fp);
41 __sclearerr(fp);
42 funlockfile(fp);
H A Dfpurge.c44 fpurge(FILE *fp) argument
46 if (!fp->_flags) {
51 if (HASUB(fp))
52 FREEUB(fp);
53 WCIO_FREE(fp);
54 fp->_p = fp->_bf._base;
55 fp->_r = 0;
56 fp->_w = fp
[all...]
H A Dwsetup.c44 __swsetup(FILE *fp) argument
53 if ((fp->_flags & __SWR) == 0) {
54 if ((fp->_flags & __SRW) == 0)
56 if (fp->_flags & __SRD) {
58 if (HASUB(fp))
59 FREEUB(fp);
60 fp->_flags &= ~(__SRD|__SEOF);
61 fp->_r = 0;
62 fp->_p = fp
[all...]
H A Dfgetc.c37 fgetc(FILE *fp) argument
39 return (__sgetc(fp));
H A Dwbuf.c44 __swbuf(int c, FILE *fp) argument
48 _SET_ORIENTATION(fp, -1);
56 fp->_w = fp->_lbfsize;
57 if (cantwrite(fp)) {
72 n = fp->_p - fp->_bf._base;
73 if (n >= fp->_bf._size) {
74 if (fflush(fp))
78 fp
[all...]
H A Dwcio.h43 #define WCIO_GET(fp) \
46 #define _SET_ORIENTATION(fp, mode) ((void)0)
51 #define WCIO_FREE(fp) ((void)(0))
53 #define WCIO_FREEUB(fp) ((void)0)
55 #define WCIO_INIT(fp) ((void)0)
H A Dfclose.c40 extern void __fremovelock(FILE *fp);
43 fclose(FILE *fp) argument
47 if (fp->_flags == 0) { /* not open! */
51 WCIO_FREE(fp);
52 r = fp->_flags & __SWR ? __sflush(fp) : 0;
53 if (fp->_close != NULL && (*fp->_close)(fp->_cookie) < 0)
55 if (fp
[all...]
H A Dungetc.c41 * Expand the ungetc buffer `in place'. That is, adjust fp->_p when
47 __submore(FILE *fp) argument
52 if (_UB(fp)._base == fp->_ubuf) {
58 _UB(fp)._base = p;
59 _UB(fp)._size = BUFSIZ;
60 p += BUFSIZ - sizeof(fp->_ubuf);
61 for (i = sizeof(fp->_ubuf); --i >= 0;)
62 p[i] = fp->_ubuf[i];
63 fp
79 ungetc(int c, FILE *fp) argument
[all...]
H A Drewind.c38 rewind(FILE *fp) argument
40 (void) fseek(fp, 0L, SEEK_SET);
41 clearerr(fp);
H A Dftell.c42 ftello(FILE *fp) argument
46 if (fp->_seek == NULL) {
55 __sflush(fp); /* may adjust seek offset on append stream */
56 if (fp->_flags & __SOFF)
57 pos = fp->_offset;
59 pos = (*fp->_seek)(fp->_cookie, (fpos_t)0, SEEK_CUR);
63 if (fp->_flags & __SRD) {
69 pos -= fp->_r;
70 if (HASUB(fp))
90 ftell(FILE *fp) argument
[all...]
H A Dfseek.c49 fseeko(FILE *fp, off_t offset, int whence) argument
64 if ((seekfn = fp->_seek) == NULL) {
81 __sflush(fp); /* may adjust seek offset on append stream */
82 if (fp->_flags & __SOFF)
83 curoff = fp->_offset;
85 curoff = (*seekfn)(fp->_cookie, (fpos_t)0, SEEK_CUR);
89 if (fp->_flags & __SRD) {
90 curoff -= fp->_r;
91 if (HASUB(fp))
92 curoff -= fp
246 fseek(FILE *fp, long offset, int whence) argument
[all...]
H A Dfread.c40 lflush(FILE *fp) argument
43 if ((fp->_flags & (__SLBF|__SWR)) == (__SLBF|__SWR))
44 return (__sflush(fp));
49 fread(void *buf, size_t size, size_t count, FILE *fp) argument
63 if (fp->_r < 0)
64 fp->_r = 0;
69 if (fp->_flags & __SNBF && fp->_ur == 0)
79 fp->_r = 0; /* largely a convenience for callers */
82 if (fp
[all...]
H A Dfeof.c42 feof(FILE *fp) argument
44 return (__sfeof(fp));
H A Dferror.c42 ferror(FILE *fp) argument
44 return (__sferror(fp));
H A Dfileext.h40 #define _EXT(fp) ((struct __sfileext *)((fp)->_ext._base))
41 #define _UB(fp) _EXT(fp)->_ub
43 #define _FILEEXT_INIT(fp) \
45 _UB(fp)._base = NULL; \
46 _UB(fp)._size = 0; \
47 WCIO_INIT(fp); \
H A Dfileno.c42 fileno(FILE *fp) argument
44 return (__sfileno(fp));
H A Dgetc.c42 getc_unlocked(FILE *fp) argument
44 return (__sgetc(fp));
53 getc(FILE *fp) argument
57 flockfile(fp);
58 c = __sgetc(fp);
59 funlockfile(fp);
H A Dfgetln.c47 __slbexpand(FILE *fp, size_t newsize) argument
54 if ((size_t)fp->_lb._size >= newsize)
56 if ((p = realloc(fp->_lb._base, newsize)) == NULL)
58 fp->_lb._base = p;
59 fp->_lb._size = newsize;
71 fgetln(FILE *fp, size_t *lenp) argument
78 if (fp->_r <= 0 && __srefill(fp)) {
84 if ((p = memchr((void *)fp->_p, '\n', fp
[all...]
H A Dfreopen.c49 freopen(const char *file, const char *mode, FILE *fp) argument
55 (void) fclose(fp);
70 if (fp->_flags == 0) {
71 fp->_flags = __SEOF; /* hold on to it */
76 if (fp->_flags & __SWR)
77 (void) __sflush(fp);
79 isopen = fp->_close != NULL;
80 if ((wantfd = fp->_file) < 0 && isopen) {
81 (void) (*fp->_close)(fp
[all...]
H A Dfunopen.c43 FILE *fp; local
58 if ((fp = __sfp()) == NULL)
60 fp->_flags = flags;
61 fp->_file = -1;
62 fp->_cookie = (void *)cookie; /* SAFE: cookie not modified */
63 fp->_read = readfn;
64 fp->_write = writefn;
65 fp->_seek = seekfn;
66 fp->_close = closefn;
67 return (fp);
[all...]
H A Dmakebuf.c49 __smakebuf(FILE *fp) argument
56 if (fp->_flags & __SNBF) {
57 fp->_bf._base = fp->_p = fp->_nbuf;
58 fp->_bf._size = 1;
61 flags = __swhatbuf(fp, &size, &couldbetty);
63 fp->_flags |= __SNBF;
64 fp->_bf._base = fp
81 __swhatbuf(FILE *fp, size_t *bufsize, int *couldbetty) argument
[all...]
H A Dfflush.c38 /* Flush a single file, or (if fp is NULL) all files. */
40 fflush(FILE *fp) argument
43 if (fp == NULL)
45 if ((fp->_flags & (__SWR | __SRW)) == 0) {
49 return (__sflush(fp));
53 __sflush(FILE *fp) argument
58 t = fp->_flags;
62 if ((p = fp->_bf._base) == NULL)
65 n = fp->_p - p; /* write this much */
71 fp
[all...]
H A Dputc.c44 putc_unlocked(int c, FILE *fp) argument
46 if (cantwrite(fp)) {
50 return (__sputc(c, fp));
59 putc(int c, FILE *fp) argument
63 flockfile(fp);
64 ret = putc_unlocked(c, fp);
65 funlockfile(fp);

Completed in 331 milliseconds

123