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

12345678910

/barrelfish-2018-10-04/lib/libc/stdio/
H A Drefill.c51 lflush(FILE *fp) argument
55 if ((fp->_flags & (__SLBF|__SWR)) == (__SLBF|__SWR)) {
56 FLOCKFILE(fp);
57 ret = __sflush(fp);
58 FUNLOCKFILE(fp);
68 __srefill(FILE *fp) argument
75 ORIENT(fp, -1);
77 fp->_r = 0; /* largely a convenience for callers */
80 if (fp->_flags & __SEOF)
84 if ((fp
[all...]
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 Dungetc.c50 * Expand the ungetc buffer `in place'. That is, adjust fp->_p when
56 __submore(FILE *fp) argument
61 if (fp->_ub._base == fp->_ubuf) {
67 fp->_ub._base = p;
68 fp->_ub._size = BUFSIZ;
69 p += BUFSIZ - sizeof(fp->_ubuf);
70 for (i = sizeof(fp->_ubuf); --i >= 0;)
71 p[i] = fp->_ubuf[i];
72 fp
91 ungetc(int c, FILE *fp) argument
108 __ungetc(int c, FILE *fp) argument
[all...]
H A Dfflush.c49 * Flush a single file, or (if fp is NULL) all files.
53 fflush(FILE *fp) argument
57 if (fp == NULL)
59 FLOCKFILE(fp);
75 if ((fp->_flags & (__SWR | __SRW)) == 0)
78 retval = __sflush(fp);
79 FUNLOCKFILE(fp);
84 * Flush a single file, or (if fp is NULL) all files.
88 __fflush(FILE *fp) argument
92 if (fp
102 __sflush(FILE *fp) argument
142 sflush_locked(FILE *fp) argument
[all...]
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 Dfreopen.c59 FILE * __restrict fp)
66 (void) fclose(fp);
71 FLOCKFILE(fp);
83 if (fp->_flags == 0) {
84 FUNLOCKFILE(fp);
88 if ((dflags = _fcntl(fp->_file, F_GETFL)) < 0) {
90 fclose(fp);
91 FUNLOCKFILE(fp);
98 fclose(fp);
99 FUNLOCKFILE(fp);
58 freopen(const char * __restrict file, const char * __restrict mode, FILE * __restrict fp) argument
[all...]
H A Drget.c48 __srget(FILE *fp) argument
50 if (__srefill(fp) == 0) {
51 fp->_r--;
52 return (*fp->_p++);
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 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 Dfwide.c39 fwide(FILE *fp, int mode) argument
43 FLOCKFILE(fp);
45 if (mode != 0 && fp->_orientation == 0)
46 fp->_orientation = mode > 0 ? 1 : -1;
47 m = fp->_orientation;
48 FUNLOCKFILE(fp);
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 Dstdio.c55 FILE *fp = cookie; local
57 return(_read(fp->_file, buf, (size_t)n));
63 FILE *fp = cookie; local
65 return (_write(fp->_file, buf, (size_t)n));
71 FILE *fp = cookie; local
73 return (lseek(fp->_file, (off_t)offset, whence));
87 _sread(FILE *fp, char *buf, int n) argument
91 ret = (*fp->_read)(fp->_cookie, buf, n);
93 if (fp
105 _swrite(FILE *fp, char const *buf, int n) argument
132 _sseek(FILE *fp, fpos_t offset, int whence) argument
[all...]
H A Dfclose.c51 cleanfile(FILE *fp, bool c) argument
55 r = fp->_flags & __SWR ? __sflush(fp) : 0;
57 if (fp->_close != NULL && (*fp->_close)(fp->_cookie) < 0)
61 if (fp->_flags & __SMBF)
62 free((char *)fp->_bf._base);
63 if (HASUB(fp))
64 FREEUB(fp);
88 fdclose(FILE *fp, int *fdp) argument
124 fclose(FILE *fp) argument
[all...]
H A Dftell.c52 ftell(FILE *fp) argument
56 rv = ftello(fp);
68 ftello(FILE *fp) argument
73 FLOCKFILE(fp);
74 ret = _ftello(fp, &rv);
75 FUNLOCKFILE(fp);
86 _ftello(FILE *fp, fpos_t *offset) argument
91 if (fp->_seek == NULL) {
100 if (!(fp->_flags & __SRD) && (fp
[all...]
H A Dfgetln.c57 __slbexpand(FILE *fp, size_t newsize) argument
64 if (fp->_lb._size >= newsize)
70 if ((p = realloc(fp->_lb._base, newsize)) == NULL)
72 fp->_lb._base = p;
73 fp->_lb._size = newsize;
85 fgetln(FILE *fp, size_t *lenp) argument
91 FLOCKFILE(fp);
92 ORIENT(fp, -1);
94 if (fp->_r <= 0 && __srefill(fp)) {
[all...]
H A Dwbuf.c51 __swbuf(int c, FILE *fp) argument
62 fp->_w = fp->_lbfsize;
63 if (prepwrite(fp) != 0) {
69 ORIENT(fp, -1);
80 n = fp->_p - fp->_bf._base;
81 if (n >= fp->_bf._size) {
82 if (__fflush(fp))
86 fp
[all...]
H A D_flock_stub.c62 _flockfile(FILE *fp) argument
66 if (fp->_fl_owner == curthread)
67 fp->_fl_count++;
73 _pthread_mutex_lock(&fp->_fl_mutex);
74 fp->_fl_owner = curthread;
75 fp->_fl_count = 1;
83 _flockfile_debug_stub(FILE *fp, char *fname, int lineno) argument
85 _flockfile(fp);
89 _ftrylockfile(FILE *fp) argument
94 if (fp
110 _funlockfile(FILE *fp) argument
[all...]
H A Dfgetws.c46 fgetws_l(wchar_t * __restrict ws, int n, FILE * __restrict fp, locale_t locale) argument
56 FLOCKFILE(fp);
57 ORIENT(fp, 1);
60 fp->_flags |= __SERR;
69 if (fp->_r <= 0 && __srefill(fp))
75 src = fp->_p;
76 nl = memchr(fp->_p, '\n', fp->_r);
78 nl != NULL ? (nl - fp
125 fgetws(wchar_t * __restrict ws, int n, FILE * __restrict fp) argument
[all...]
H A Dsetvbuf.c51 setvbuf(FILE * __restrict fp, char * __restrict buf, int mode, size_t size) argument
66 FLOCKFILE(fp);
74 (void)__sflush(fp);
75 if (HASUB(fp))
76 FREEUB(fp);
77 fp->_r = fp->_lbfsize = 0;
78 flags = fp->_flags;
80 free((void *)fp->_bf._base);
92 flags |= __swhatbuf(fp,
[all...]
H A Dfgetwc.c50 fgetwc_l(FILE *fp, locale_t locale) argument
55 FLOCKFILE(fp);
56 ORIENT(fp, 1);
57 r = __fgetwc(fp, locale);
58 FUNLOCKFILE(fp);
64 fgetwc(FILE *fp) argument
66 return fgetwc_l(fp, __get_locale());
72 * wide streams, this should always be fp->_mbstate. On return, *nread
76 __fgetwc_mbs(FILE *fp, mbstate_t *mbs, int *nread, locale_t locale) argument
83 if (fp
[all...]
H A Drewind.c47 rewind(FILE *fp) argument
55 FLOCKFILE(fp);
56 if (_fseeko(fp, (off_t)0, SEEK_SET, 1) == 0)
58 clearerr_unlocked(fp); /* POSIX: clear stdio error regardless */
59 FUNLOCKFILE(fp);
/barrelfish-2018-10-04/lib/tzcode/zic/
H A Dscheck.c27 register const char * fp; local
39 fp = format;
41 while ((*tp++ = c = *fp++) != '\0') {
44 if (*fp == '%') {
45 *tp++ = *fp++;
49 if (*fp == '*')
50 ++fp;
51 while (is_digit(*fp))
52 *tp++ = *fp++;
53 if (*fp
[all...]
/barrelfish-2018-10-04/lib/libc/tests/stdio/
H A Dopen_memstream2_test.c57 FILE *fp; local
60 fp = open_memstream(&buf, &len);
61 ATF_REQUIRE_MSG(fp != NULL, "open_memstream failed");
63 fprintf(fp, "hello my world");
64 fflush(fp);
66 eob = ftello(fp);
67 rewind(fp);
68 fprintf(fp, "good-bye");
69 fseeko(fp, eob, SEEK_SET);
70 fclose(fp);
81 FILE *fp; local
154 FILE *fp; local
[all...]

Completed in 70 milliseconds

12345678910