Searched refs:fp (Results 26 - 50 of 90) sorted by relevance

1234

/bionic/libc/upstream-openbsd/lib/libc/stdio/
H A Dfflush.c38 /* Flush a single file, or (if fp is NULL) all files. */
40 fflush(FILE *fp) argument
44 if (fp == NULL)
46 FLOCKFILE(fp);
47 if ((fp->_flags & (__SWR | __SRW)) == 0) {
51 r = __sflush(fp);
52 FUNLOCKFILE(fp);
57 __sflush(FILE *fp) argument
62 t = fp->_flags;
66 if ((p = fp
89 __sflush_locked(FILE *fp) argument
[all...]
H A Dfwalk.c42 FILE *fp; local
48 for (fp = g->iobs, n = g->niobs; --n >= 0; fp++) {
49 if ((fp->_flags != 0) && ((fp->_flags & __SIGN) == 0))
50 ret |= (*function)(fp);
H A Dfgetpos.c40 fgetpos(FILE *fp, fpos_t *pos) argument
42 return((*pos = ftello(fp)) == (fpos_t)-1);
H A Dfputc.c38 fputc(int c, FILE *fp) argument
40 return (putc(c, fp));
H A Dgetwc.c41 getwc(FILE *fp) argument
44 return fgetwc(fp);
H A Dsetbuf.c38 setbuf(FILE *fp, char *buf) argument
40 (void) setvbuf(fp, buf, buf ? _IOFBF : _IONBF, BUFSIZ);
H A Dungetwc.c38 __ungetwc(wint_t wc, FILE *fp) argument
45 _SET_ORIENTATION(fp, 1);
52 wcio = WCIO_GET(fp);
63 __sclearerr(fp);
69 ungetwc(wint_t wc, FILE *fp) argument
73 FLOCKFILE(fp);
74 r = __ungetwc(wc, fp);
75 FUNLOCKFILE(fp);
H A Dfvwrite.c48 __sfvwrite(FILE *fp, struct __suio *uio) argument
60 if (cantwrite(fp)) {
66 #define COPY(n) (void)memcpy((void *)fp->_p, (void *)p, (size_t)(n))
79 if (fp->_flags & __SNBF) {
85 w = (*fp->_write)(fp->_cookie, p, MIN(len, BUFSIZ));
91 } else if ((fp->_flags & __SLBF) == 0) {
105 if ((fp->_flags & (__SALC | __SSTR)) ==
106 (__SALC | __SSTR) && fp->_w < len) {
107 size_t blen = fp
[all...]
H A Dfwide.c37 fwide(FILE *fp, int mode) argument
52 FLOCKFILE(fp);
53 wcio = WCIO_GET(fp);
61 FUNLOCKFILE(fp);
H A Dsetbuffer.c37 setbuffer(FILE *fp, char *buf, int size) argument
40 (void)setvbuf(fp, buf, buf ? _IOFBF : _IONBF, size);
47 setlinebuf(FILE *fp) argument
50 return (setvbuf(fp, (char *)NULL, _IOLBF, (size_t)0));
H A Dfputs.c43 fputs(const char *s, FILE *fp) argument
53 FLOCKFILE(fp);
54 _SET_ORIENTATION(fp, -1);
55 ret = __sfvwrite(fp, &uio);
56 FUNLOCKFILE(fp);
H A Dputw.c39 putw(int w, FILE *fp) argument
49 FLOCKFILE(fp);
50 _SET_ORIENTATION(fp, -1);
51 ret = __sfvwrite(fp, &uio);
52 FUNLOCKFILE(fp);
H A Dfgets.c46 fgets(char *buf, int n, FILE *fp) argument
57 FLOCKFILE(fp);
58 _SET_ORIENTATION(fp, -1);
65 if (fp->_r <= 0) {
66 if (__srefill(fp)) {
69 FUNLOCKFILE(fp);
75 len = fp->_r;
76 p = fp->_p;
89 fp->_r -= len;
90 fp
[all...]
H A Dstdio.c46 FILE *fp = cookie; local
49 ret = read(fp->_file, buf, n);
52 fp->_offset += ret;
54 fp->_flags &= ~__SOFF; /* paranoia */
61 FILE *fp = cookie; local
63 if (fp->_flags & __SAPP)
64 (void) lseek(fp->_file, (off_t)0, SEEK_END);
65 fp->_flags &= ~__SOFF; /* in case FAPPEND mode is set */
66 return (write(fp->_file, buf, n));
72 FILE *fp local
[all...]
H A Dfgetws.c40 fgetws(wchar_t * __restrict ws, int n, FILE * __restrict fp) argument
45 FLOCKFILE(fp);
46 _SET_ORIENTATION(fp, 1);
55 if ((wc = __fgetwc_unlock(fp)) == WEOF && errno == EILSEQ) {
72 FUNLOCKFILE(fp);
77 FUNLOCKFILE(fp);
H A Dfgetwc.c38 __fgetwc_unlock(FILE *fp) argument
45 _SET_ORIENTATION(fp, 1);
46 wcio = WCIO_GET(fp);
63 int ch = __sgetc(fp);
81 fgetwc(FILE *fp) argument
85 FLOCKFILE(fp);
86 r = __fgetwc_unlock(fp);
87 FUNLOCKFILE(fp);
H A Dgetline.c34 getline(char **__restrict buf, size_t *__restrict buflen, FILE *__restrict fp) argument
36 return getdelim(buf, buflen, '\n', fp);
H A Dputwc.c41 putwc(wchar_t wc, FILE *fp) argument
44 return fputwc(wc, fp);
H A Dgetdelim.c46 int sep, FILE *__restrict fp)
52 FLOCKFILE(fp);
63 _SET_ORIENTATION(fp, -1);
67 if (fp->_r <= 0 && __srefill(fp)) {
68 if (__sferror(fp))
75 p = memchr(fp->_p, sep, (size_t)fp->_r);
77 len = fp->_r;
79 len = (p - fp
45 getdelim(char **__restrict buf, size_t *__restrict buflen, int sep, FILE *__restrict fp) argument
[all...]
/bionic/tests/
H A Dmntent_test.cpp22 FILE* fp = setmntent("/no/mnt/tab/on/android", "r"); local
23 ASSERT_TRUE(fp == NULL);
26 ASSERT_TRUE(getmntent(fp) == NULL);
30 ASSERT_TRUE(getmntent_r(fp, &mbuf, cbuf, sizeof(cbuf)) == NULL);
33 ASSERT_EQ(1, endmntent(fp));
H A Dstdio_test.cpp41 FILE* fp = fopen("/dev/null", "w"); local
42 ASSERT_TRUE(fp != NULL);
43 flockfile(fp);
44 feof(fp);
45 funlockfile(fp);
46 fclose(fp);
50 FILE* fp = tmpfile(); local
51 ASSERT_TRUE(fp != NULL);
53 int fd = fileno(fp);
61 rc = fprintf(fp, "hell
93 FILE* fp = tmpfile(); local
128 FILE* fp = tmpfile(); local
153 FILE* fp = tmpfile(); local
195 FILE* fp = tmpfile(); local
472 FILE* fp; local
494 FILE* fp = popen("cat /proc/version", "r"); local
506 FILE* fp = fopen("/proc/version", "r"); local
517 FILE* fp = fopen("/proc/version", "r"); local
536 FILE* fp = fopen("/proc/version", "r"); local
578 FILE* fp = tmpfile(); local
648 FILE* fp = fdopen(tf.fd, "w+"); local
701 FILE* fp = fopen("/dev/zero", "r"); local
[all...]
/bionic/libc/stdio/
H A Dfread.c43 fread(void *buf, size_t size, size_t count, FILE *fp) argument
56 fp->_flags |= __SERR;
65 FLOCKFILE(fp);
66 _SET_ORIENTATION(fp, -1);
67 if (fp->_r < 0)
68 fp->_r = 0;
75 if ((fp->_flags & __SNBF) != 0) {
78 while (resid > 0 && (r = (*fp->_read)(fp->_cookie, p, resid)) > 0) {
82 FUNLOCKFILE(fp);
[all...]
H A Dwcio.h52 #define WCIO_GET(fp) \
53 (_EXT(fp) ? &(_EXT(fp)->_wcio) : (struct wchar_io_data *)0)
55 #define _SET_ORIENTATION(fp, mode) \
57 struct wchar_io_data *_wcio = WCIO_GET(fp); \
65 #define WCIO_FREE(fp) \
67 struct wchar_io_data *_wcio = WCIO_GET(fp); \
74 #define WCIO_FREEUB(fp) \
76 struct wchar_io_data *_wcio = WCIO_GET(fp); \
82 #define WCIO_INIT(fp) \
[all...]
/bionic/libc/upstream-freebsd/android/include/
H A Dlibc_private.h23 #define ORIENT(fp, o) /* Only needed for wide-character stream support. */
/bionic/libc/upstream-freebsd/lib/libc/stdio/
H A Dfopen.c54 FILE *fp; local
60 if ((fp = __sfp()) == NULL)
63 fp->_flags = 0; /* release */
74 fp->_flags = 0; /* release */
79 fp->_file = f;
80 fp->_flags = flags;
81 fp->_cookie = fp;
82 fp->_read = __sread;
83 fp
[all...]

Completed in 1593 milliseconds

1234