/bionic/libc/stdio/ |
H A D | rget.c | 43 __srget(FILE *fp) argument 45 _SET_ORIENTATION(fp, -1); 46 if (__srefill(fp) == 0) { 47 fp->_r--; 48 return (*fp->_p++);
|
H A D | refill.c | 40 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 D | clrerr.c | 39 clearerr(FILE *fp) argument 41 FLOCKFILE(fp); 42 __sclearerr(fp); 43 FUNLOCKFILE(fp);
|
H A D | wsetup.c | 44 __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 D | fgetc.c | 37 fgetc(FILE *fp) argument 39 return (getc(fp));
|
H A D | fpurge.c | 44 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 D | wbuf.c | 44 __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 D | wcio.h | 43 #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 D | ungetc.c | 41 * 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 D | fclose.c | 40 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 D | ftell.c | 42 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 D | fseek.c | 49 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 D | rewind.c | 38 rewind(FILE *fp) argument 40 (void) fseek(fp, 0L, SEEK_SET); 41 clearerr(fp);
|
H A D | fgetln.c | 47 __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 D | fread.c | 40 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 D | feof.c | 43 feof(FILE *fp) argument 47 FLOCKFILE(fp); 48 ret = __sfeof(fp); 49 FUNLOCKFILE(fp);
|
H A D | fileno.c | 43 fileno(FILE *fp) argument 47 FLOCKFILE(fp); 48 ret = __sfileno(fp); 49 FUNLOCKFILE(fp);
|
H A D | ferror.c | 42 ferror(FILE *fp) argument 44 return (__sferror(fp));
|
H A D | fileext.h | 40 #define _EXT(fp) ((struct __sfileext *)((fp)->_ext._base)) 41 #define _UB(fp) _EXT(fp)->_ub 43 #define _FILEEXT_INIT(fp) \ 45 _UB(fp)._base = NULL; \ 46 _UB(fp)._size = 0; \ 47 WCIO_INIT(fp); \
|
H A D | freopen.c | 49 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 D | getc.c | 43 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 D | funopen.c | 43 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 D | makebuf.c | 49 __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 D | putc.c | 44 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);
|
H A D | setvbuf.c | 43 setvbuf(FILE *fp, char *buf, int mode, size_t size) argument 64 FLOCKFILE(fp); 66 (void)__sflush(fp); 67 if (HASUB(fp)) 68 FREEUB(fp); 69 WCIO_FREE(fp); 70 fp->_r = fp->_lbfsize = 0; 71 flags = fp->_flags; 73 free((void *)fp [all...] |