Searched refs:fp (Results 1 - 25 of 67) 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
42 if ((fp->_flags & (__SLBF|__SWR)) == (__SLBF|__SWR))
43 return (__sflush_locked(fp)); /* ignored... */
52 __srefill(FILE *fp) argument
59 fp->_r = 0; /* largely a convenience for callers */
62 if (fp->_flags & __SEOF)
66 if ((fp->_flags & __SRD) == 0) {
67 if ((fp->_flags & __SRW) == 0) {
69 fp->_flags |= __SERR;
73 if (fp
[all...]
H A Dclrerr.c39 clearerr(FILE *fp) argument
41 FLOCKFILE(fp);
42 __sclearerr(fp);
43 FUNLOCKFILE(fp);
H A Dflockfile.c47 flockfile(FILE * fp) argument
49 if (fp != NULL) {
50 _FLOCK_LOCK(fp);
56 ftrylockfile(FILE *fp) argument
63 if (fp != NULL) {
64 ret = _FLOCK_TRYLOCK(fp);
70 funlockfile(FILE * fp) argument
72 if (fp != NULL) {
73 _FLOCK_UNLOCK(fp);
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 (getc(fp));
H A Dfpurge.c44 fpurge(FILE *fp) argument
46 FLOCKFILE(fp);
47 if (!fp->_flags) {
48 FUNLOCKFILE(fp);
53 if (HASUB(fp))
54 FREEUB(fp);
55 WCIO_FREE(fp);
56 fp->_p = fp->_bf._base;
57 fp
[all...]
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 (__sflush(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 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 Dfclose.c40 fclose(FILE *fp) argument
44 if (fp->_flags == 0) { /* not open! */
48 FLOCKFILE(fp);
49 WCIO_FREE(fp);
50 r = fp->_flags & __SWR ? __sflush(fp) : 0;
51 if (fp->_close != NULL && (*fp->_close)(fp->_cookie) < 0)
53 if (fp
[all...]
H A Dfileext.h46 #define _EXT(fp) ((struct __sfileext *)((fp)->_ext._base))
47 #define _UB(fp) _EXT(fp)->_ub
48 #define _FLOCK(fp) _EXT(fp)->_lock
50 #define _FILEEXT_INIT(fp) \
52 _UB(fp)._base = NULL; \
53 _UB(fp)._size = 0; \
54 WCIO_INIT(fp); \
[all...]
H A Dftell.c42 ftello(FILE *fp) argument
46 if (fp->_seek == NULL) {
56 FLOCKFILE(fp);
57 __sflush(fp); /* may adjust seek offset on append stream */
58 if (fp->_flags & __SOFF)
59 pos = fp->_offset;
61 pos = (*fp->_seek)(fp->_cookie, (fpos_t)0, SEEK_CUR);
65 if (fp->_flags & __SRD) {
71 pos -= fp
93 ftell(FILE *fp) argument
[all...]
H A Dfseek.c49 fseeko(FILE *fp, off_t offset, int whence) argument
64 if ((seekfn = fp->_seek) == NULL) {
73 FLOCKFILE(fp);
82 __sflush(fp); /* may adjust seek offset on append stream */
83 if (fp->_flags & __SOFF)
84 curoff = fp->_offset;
86 curoff = (*seekfn)(fp->_cookie, (fpos_t)0, SEEK_CUR);
88 FUNLOCKFILE(fp);
92 if (fp->_flags & __SRD) {
93 curoff -= fp
254 fseek(FILE *fp, long offset, int whence) argument
[all...]
H A Drewind.c38 rewind(FILE *fp) argument
40 (void) fseek(fp, 0L, SEEK_SET);
41 clearerr(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 FLOCKFILE(fp);
81 if (fp->_r <= 0 && __srefill(fp))
85 if ((p = memchr((void *)fp
[all...]
H A Dfread.c40 lflush(FILE *fp) argument
42 if ((fp->_flags & (__SLBF|__SWR)) == (__SLBF|__SWR))
43 return (__sflush_locked(fp));
48 fread(void *buf, size_t size, size_t count, FILE *fp) argument
62 FLOCKFILE(fp);
63 if (fp->_r < 0)
64 fp->_r = 0;
69 if (fp->_flags & __SNBF && fp->_ur == 0)
79 fp
[all...]
H A Dfeof.c43 feof(FILE *fp) argument
47 FLOCKFILE(fp);
48 ret = __sfeof(fp);
49 FUNLOCKFILE(fp);
H A Dfileno.c43 fileno(FILE *fp) argument
47 FLOCKFILE(fp);
48 ret = __sfileno(fp);
49 FUNLOCKFILE(fp);
H A Dferror.c42 ferror(FILE *fp) argument
44 return (__sferror(fp));
H A Dfreopen.c49 freopen(const char *file, const char *mode, FILE *fp) argument
55 (void) fclose(fp);
62 FLOCKFILE(fp);
72 if (fp->_flags == 0) {
73 fp->_flags = __SEOF; /* hold on to it */
78 if (fp->_flags & __SWR)
79 (void) __sflush(fp);
81 isopen = fp->_close != NULL;
82 if ((wantfd = fp->_file) < 0 && isopen) {
83 (void) (*fp
[all...]
H A Dgetc.c43 getc_unlocked(FILE *fp) argument
45 return (__sgetc(fp));
54 getc(FILE *fp) argument
58 FLOCKFILE(fp);
59 c = __sgetc(fp);
60 FUNLOCKFILE(fp);
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 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 54 milliseconds

123