Searched defs:fp (Results 1 - 25 of 58) sorted by relevance

123

/bionic/libc/stdio/
H A Dfgetc.c37 fgetc(FILE *fp) argument
39 return (getc(fp));
H A Drewind.c38 rewind(FILE *fp) argument
40 (void) fseek(fp, 0L, SEEK_SET);
41 clearerr(fp);
H A Dfputc.c38 fputc(int c, FILE *fp) argument
40 return (putc(c, fp));
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 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 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 Dfprintf.c38 fprintf(FILE *fp, const char *fmt, ...) argument
44 ret = vfprintf(fp, fmt, ap);
H A Dfscanf.c38 fscanf(FILE *fp, const char *fmt, ...) argument
44 ret = vfscanf(fp, fmt, ap);
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...]
/bionic/libc/upstream-freebsd/lib/libc/stdio/
H A Dclrerr.c48 clearerr(FILE *fp) argument
50 FLOCKFILE(fp);
51 __sclearerr(fp);
52 FUNLOCKFILE(fp);
56 clearerr_unlocked(FILE *fp) argument
59 __sclearerr(fp);
H A Dfclose.c49 fclose(FILE *fp) argument
53 if (fp->_flags == 0) { /* not open! */
57 FLOCKFILE(fp);
58 r = fp->_flags & __SWR ? __sflush(fp) : 0;
59 if (fp->_close != NULL && (*fp->_close)(fp->_cookie) < 0)
61 if (fp->_flags & __SMBF)
62 free((char *)fp
[all...]
H A Dfgetpos.c42 fgetpos(FILE * __restrict fp, fpos_t * __restrict pos) argument
45 * ftello is thread-safe; no need to lock fp.
47 if ((*pos = ftello(fp)) == (fpos_t)-1)
H A Dfpurge.c52 fpurge(FILE *fp) argument
55 FLOCKFILE(fp);
56 if (!fp->_flags) {
60 if (HASUB(fp))
61 FREEUB(fp);
62 fp->_p = fp->_bf._base;
63 fp->_r = 0;
64 fp->_w = fp
[all...]
H A Drget.c48 __srget(FILE *fp) argument
50 if (__srefill(fp) == 0) {
51 fp->_r--;
52 return (*fp->_p++);
H A Dsetbuf.c43 setbuf(FILE * __restrict fp, char * __restrict buf) argument
45 (void) setvbuf(fp, buf, buf ? _IOFBF : _IONBF, BUFSIZ);
H A Dwsetup.c50 __swsetup(FILE *fp) argument
59 if ((fp->_flags & __SWR) == 0) {
60 if ((fp->_flags & __SRW) == 0) {
62 fp->_flags |= __SERR;
65 if (fp->_flags & __SRD) {
67 if (HASUB(fp))
68 FREEUB(fp);
69 fp->_flags &= ~(__SRD|__SEOF);
70 fp->_r = 0;
71 fp
[all...]
H A Dfeof.c48 feof(FILE *fp) argument
52 FLOCKFILE(fp);
53 ret= __sfeof(fp);
54 FUNLOCKFILE(fp);
59 feof_unlocked(FILE *fp) argument
62 return (__sfeof(fp));
H A Dferror.c48 ferror(FILE *fp) argument
52 FLOCKFILE(fp);
53 ret = __sferror(fp);
54 FUNLOCKFILE(fp);
59 ferror_unlocked(FILE *fp) argument
62 return (__sferror(fp));
H A Dfileno.c48 fileno(FILE *fp) argument
52 FLOCKFILE(fp);
53 fd = __sfileno(fp);
54 FUNLOCKFILE(fp);
60 fileno_unlocked(FILE *fp) argument
63 return (__sfileno(fp));
H A Dfunopen.c51 FILE *fp; local
66 if ((fp = __sfp()) == NULL)
68 fp->_flags = flags;
69 fp->_file = -1;
70 fp->_cookie = (void *)cookie;
71 fp->_read = readfn;
72 fp->_write = writefn;
73 fp->_seek = seekfn;
74 fp->_close = closefn;
75 return (fp);
[all...]
H A Dgetc.c49 getc(FILE *fp) argument
52 FLOCKFILE(fp);
54 /* ORIENT(fp, -1); */
55 retval = __sgetc(fp);
56 FUNLOCKFILE(fp);
61 getc_unlocked(FILE *fp) argument
64 return (__sgetc(fp));
H A Dfputs.c51 fputs(const char * __restrict s, FILE * __restrict fp) argument
61 FLOCKFILE(fp);
62 ORIENT(fp, -1);
63 retval = __sfvwrite(fp, &uio);
64 FUNLOCKFILE(fp);
H A Dfwalk.c47 FILE *fp; local
61 for (fp = g->iobs, n = g->niobs; --n >= 0; fp++)
62 if ((fp->_flags != 0) && ((fp->_flags & __SIGN) == 0))
63 ret |= (*function)(fp);
/bionic/libc/bionic/
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);
/bionic/tests/
H A Dsys_stat_test.cpp24 FILE* fp = tmpfile(); local
25 ASSERT_TRUE(fp != NULL);
27 int fd = fileno(fp);
42 fclose(fp);

Completed in 9417 milliseconds

123