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

1234

/bionic/libc/upstream-openbsd/lib/libc/stdio/
H A Dclrerr.c39 clearerr(FILE *fp) argument
41 FLOCKFILE(fp);
42 __sclearerr(fp);
43 FUNLOCKFILE(fp);
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 Dgetwc.c41 getwc(FILE *fp) argument
44 return fgetwc(fp);
H A Drewind.c38 rewind(FILE *fp) argument
40 (void) fseek(fp, 0L, SEEK_SET);
41 clearerr(fp);
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 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 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 Dfeof.c43 feof(FILE *fp) argument
47 FLOCKFILE(fp);
48 ret = __sfeof(fp);
49 FUNLOCKFILE(fp);
H A Dferror.c43 ferror(FILE *fp) argument
47 FLOCKFILE(fp);
48 ret = __sferror(fp);
49 FUNLOCKFILE(fp);
H A Dfgetpos.c40 fgetpos(FILE *fp, fpos_t *pos) argument
42 return((*pos = ftello(fp)) == (fpos_t)-1);
H A Dfileno.c43 fileno(FILE *fp) argument
47 FLOCKFILE(fp);
48 ret = __sfileno(fp);
49 FUNLOCKFILE(fp);
H A Dfputc.c38 fputc(int c, FILE *fp) argument
40 return (putc(c, 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 Dfwide.c37 fwide(FILE *fp, int mode) argument
52 FLOCKFILE(fp);
53 wcio = WCIO_GET(fp);
61 FUNLOCKFILE(fp);
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 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 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 Dsetbuf.c38 setbuf(FILE *fp, char *buf) argument
40 (void) setvbuf(fp, buf, buf ? _IOFBF : _IONBF, BUFSIZ);
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.c39 fprintf(FILE *fp, const char *fmt, ...) argument
45 ret = vfprintf(fp, fmt, ap);
H A Dfscanf.c39 fscanf(FILE *fp, const char *fmt, ...) argument
45 ret = vfscanf(fp, fmt, ap);
/bionic/libc/bionic/
H A Dflockfile.cpp38 void flockfile(FILE* fp) { argument
43 if (fp != NULL) {
44 pthread_mutex_lock(&_FLOCK(fp));
48 int ftrylockfile(FILE* fp) { argument
55 if (fp == NULL) {
59 return pthread_mutex_trylock(&_FLOCK(fp));
62 void funlockfile(FILE* fp) { argument
67 if (fp != NULL) {
68 pthread_mutex_unlock(&_FLOCK(fp));
/bionic/tests/
H A Dstdio_ext_test.cpp35 FILE* fp = fopen("/proc/version", "r"); local
38 ASSERT_EQ(0U, __fbufsize(fp));
42 fgets(buf, sizeof(buf), fp);
43 ASSERT_EQ(1024U, __fbufsize(fp));
45 ASSERT_EQ(0, setvbuf(fp, buf, _IOFBF, 1));
46 ASSERT_EQ(1U, __fbufsize(fp));
48 ASSERT_EQ(0, setvbuf(fp, buf, _IOFBF, 8));
49 ASSERT_EQ(8U, __fbufsize(fp));
51 fclose(fp);
55 FILE* fp local
68 FILE* fp = fopen("/dev/null", "w"); local
80 FILE* fp = tmpfile(); local
102 FILE* fp = fopen("/dev/null", "w"); local
118 FILE* fp = fopen("/dev/null", "r"); local
135 FILE* fp = fopen("/proc/version", "r"); local
[all...]

Completed in 427 milliseconds

1234