/illumos-gate/usr/src/lib/libc/port/stdio/ |
H A D | fseek.c | 50 fseek(FILE *iop, long offset, int ptrname) argument 55 FLOCKFILE(lk, iop); 56 iop->_flag &= ~_IOEOF; 58 if (!(iop->_flag & _IOREAD) && !(iop->_flag & (_IOWRT | _IORW))) { 64 if (iop->_flag & _IOREAD) { 65 if (ptrname == 1 && iop->_base && !(iop->_flag&_IONBF)) { 66 offset -= iop->_cnt; 68 } else if (iop [all...] |
H A D | ftell.c | 53 ftell(FILE *iop) argument 59 FLOCKFILE(lk, iop); 60 if (iop->_cnt < 0) 61 iop->_cnt = 0; 62 if (iop->_flag & _IOREAD) 63 adjust = (ptrdiff_t)-iop->_cnt; 64 else if (iop->_flag & (_IOWRT | _IORW)) { 66 if (((iop->_flag & (_IOWRT | _IONBF)) == _IOWRT) && 67 (iop->_base != 0)) 68 adjust = iop [all...] |
H A D | getc.c | 48 getc(FILE *iop) argument 53 FLOCKFILE(lk, iop); 55 _SET_ORIENTATION_BYTE(iop); 57 c = (--iop->_cnt < 0) ? __filbuf(iop) : *iop->_ptr++; 64 getc_unlocked(FILE *iop) argument 66 return ((--iop->_cnt < 0) ? __filbuf(iop) : *iop [all...] |
H A D | putc.c | 48 putc(int ch, FILE *iop) argument 53 FLOCKFILE(lk, iop); 55 _SET_ORIENTATION_BYTE(iop); 57 if (--iop->_cnt < 0) 58 ret = __flsbuf((unsigned char) ch, iop); 60 (*iop->_ptr++) = (unsigned char)ch; 69 putc_unlocked(int ch, FILE *iop) argument 71 if (--iop->_cnt < 0) 72 return (__flsbuf((unsigned char) ch, iop)); 74 return (*iop [all...] |
H A D | _filbuf.c | 54 _filbuf(FILE *iop) argument 65 if (!(iop->_flag & _IOREAD)) /* check, correct permissions */ 67 if (iop->_flag & _IORW) 68 iop->_flag |= _IOREAD; /* change direction */ 76 if (iop->_base == 0) { 77 if ((endbuf = _findbuf(iop)) == 0) /* get buffer and */ 82 endbuf = _bufend(iop); 88 if (iop->_flag & (_IONBF | _IOLBF)) 99 if ((flag = iop->_flag) & _IOEOF) { 103 * therefore iop [all...] |
H A D | _findbuf.c | 52 _findbuf(FILE *iop) argument 54 int fd = GET_FD(iop); 62 if (iop->_flag & _IONBF) /* need a small buffer, at least */ 70 iop->_flag |= _IOMYBUF; 90 iop->_flag |= _IOMYBUF; 96 iop->_base = buf + PUSHBACK; /* bytes for pushback */ 97 iop->_ptr = buf + PUSHBACK; 98 endbuf = iop->_base + size; 99 _setbufend(iop, endbuf); 100 if (!(iop [all...] |
H A D | fdopen.c | 58 /* iop doesn't need locking since this function is creating it */ 59 FILE *iop; local 67 if ((iop = _findiop()) == 0) { 74 iop->_flag = 0; /* release iop */ 91 iop->_flag = flag; 94 iop->_file = fd; 97 SET_FILE(iop, fd); 98 } else if (_file_set(iop, fd, type) != 0) { 100 iop [all...] |
H A D | fgets.c | 46 fgets(char *buf, int size, FILE *iop) argument 54 FLOCKFILE(lk, iop); 56 _SET_ORIENTATION_BYTE(iop); 58 if (!(iop->_flag & (_IOREAD | _IORW))) { 64 if (iop->_base == NULL) { 65 if ((bufend = _findbuf(iop)) == NULL) { 71 bufend = _bufend(iop); 76 if (iop->_cnt <= 0) { 77 if (__filbuf(iop) != EOF) { 78 iop [all...] |
H A D | flockf.c | 55 _flockget(FILE *iop) argument 57 rmutex_t *rl = IOB_LCK(iop); 65 ftrylockfile(FILE *iop) argument 67 rmutex_t *rl = IOB_LCK(iop); 75 flockfile(FILE *iop) argument 77 rmutex_t *rl = IOB_LCK(iop); 84 funlockfile(FILE *iop) argument 86 rmutex_t *rl = IOB_LCK(iop); 93 __fsetlocking(FILE *iop, int type) argument 97 ret = GET_IONOLOCK(iop) [all...] |
H A D | fread.c | 47 fread(void *ptr, size_t size, size_t count, FILE *iop) argument 54 FLOCKFILE(lk, iop); 56 _SET_ORIENTATION_BYTE(iop); 59 if (!(iop->_flag & (_IOREAD | _IORW))) { 60 iop->_flag |= _IOERR; 66 if (iop->_flag & _IOEOF) { 80 if (iop->_cnt < s) { 81 if (iop->_cnt > 0) { 82 (void) memcpy((void*)dptr, iop->_ptr, 83 iop [all...] |
H A D | fseeko.c | 57 fseeko64(FILE *iop, off64_t offset, int ptrname) argument 62 FLOCKFILE(lk, iop); 63 iop->_flag &= ~_IOEOF; 65 if (!(iop->_flag & _IOREAD) && !(iop->_flag & (_IOWRT | _IORW))) { 71 if (iop->_flag & _IOREAD) { 72 if (ptrname == 1 && iop->_base && !(iop->_flag&_IONBF)) { 73 offset -= iop->_cnt; 75 } else if (iop 93 fseeko(FILE *iop, off_t offset, int ptrname) argument [all...] |
H A D | ftello.c | 61 ftello64(FILE *iop) argument 67 FLOCKFILE(lk, iop); 68 if (iop->_cnt < 0) 69 iop->_cnt = 0; 70 if (iop->_flag & _IOREAD) 71 adjust = (ptrdiff_t)-iop->_cnt; 72 else if (iop->_flag & (_IOWRT | _IORW)) { 74 if (((iop->_flag & (_IOWRT | _IONBF)) == _IOWRT) && 75 (iop->_base != 0)) 76 adjust = iop 92 ftello(FILE *iop) argument [all...] |
H A D | setbuf.c | 44 setbuf(FILE *iop, char *abuf) argument 47 int fno = GET_FD(iop); /* file number */ 52 FLOCKFILE(lk, iop); 53 if ((iop->_base != 0) && (iop->_flag & _IOMYBUF)) 54 free((char *)iop->_base - PUSHBACK); 55 iop->_flag &= ~(_IOMYBUF | _IONBF | _IOLBF); 57 iop->_flag |= _IONBF; 69 iop->_flag |= _IOMYBUF; 74 iop [all...] |
H A D | setvbuf.c | 43 setvbuf(FILE *iop, char *abuf, int type, size_t size) argument 48 int sflag = iop->_flag & _IOMYBUF; 50 int fd = GET_FD(iop); 52 FLOCKFILE(lk, iop); 53 iop->_flag &= ~(_IOMYBUF | _IONBF | _IOLBF); 57 iop->_flag |= _IONBF; /* file is unbuffered */ 70 iop->_flag |= _IOMYBUF; 79 iop->_flag |= type; /* buffer file */ 91 iop->_flag |= _IOMYBUF; 104 if (iop [all...] |
H A D | _endopen.c | 52 * open UNIX file name, associate with iop 56 _endopen(const char *name, const char *type, FILE *iop, int largefile) argument 61 if (iop == NULL) 123 iop->_file = fd; 124 iop->_flag = (iop->_flag & ~0377) | fflag; 127 SET_FILE(iop, fd); 128 } else if (_file_set(iop, fd, type) != 0) { 133 iop->_flag = fflag; 143 return (iop); [all...] |
/illumos-gate/usr/src/lib/libbc/libc/stdio/4.2/ |
H A D | fopen.c | 48 freopen(char *file, char *mode, FILE *iop) argument 50 (void) fclose(iop); /* doesn't matter if this fails */ 51 return (_endopen(file, mode, iop)); 55 _endopen(char *file, char *mode, FILE *iop) argument 59 if (iop == NULL || file == NULL || file[0] == '\0') 77 iop->_cnt = 0; 78 iop->_file = fd; 79 iop->_flag = plus ? _IORW : (mode[0] == 'r') ? _IOREAD : _IOWRT; 86 iop->_base = iop [all...] |
/illumos-gate/usr/src/lib/libbc/libc/stdio/common/ |
H A D | fread.c | 47 fread(char *ptr, int size, int count, FILE *iop) argument 59 if (iop->_cnt <= 0) { /* empty buffer */ 60 if (_filbuf(iop) == EOF) 62 iop->_ptr--; 63 iop->_cnt++; 65 n = MIN(nleft, iop->_cnt); 66 ptr = memcpy(ptr, (char *) iop->_ptr, n) + n; 67 iop->_cnt -= n; 68 iop->_ptr += n; 69 _BUFSYNC(iop); [all...] |
H A D | findiop.c | 38 #define active(iop) ((iop)->_flag & (_IOREAD|_IOWRT|_IORW)) 57 FILE **iov, *iop; local 61 for(iop = _iob; iop < _iob + NSTATIC; iop++) 62 if(!active(iop)) 63 return(iop);
|
H A D | fputs.c | 47 fputs(char *ptr, FILE *iop) argument 54 if (_WRTCHK(iop)) { 55 iop->_flag |= _IOERR; 61 bufend = iop->_base + iop->_bufsiz; 63 if ((iop->_flag & _IONBF) == 0) { 64 if (iop->_flag & _IOLBF) { 66 while ((n = bufend - (cptr = iop->_ptr)) <= 0) 68 if (_xflsbuf(iop) == EOF) 81 iop [all...] |
/illumos-gate/usr/src/lib/libbc/libc/stdio/sys5/ |
H A D | fopen.c | 42 freopen(char *file, char *mode, FILE *iop) argument 44 (void) fclose(iop); /* doesn't matter if this fails */ 45 return (_endopen(file, mode, iop)); 49 _endopen(char *file, char *mode, FILE *iop) argument 53 if (iop == NULL || file == NULL || file[0] == '\0') 71 iop->_cnt = 0; 72 iop->_file = fd; 73 iop->_flag = plus ? _IORW : (mode[0] == 'r') ? _IOREAD : _IOWRT; 84 iop->_base = iop [all...] |
/illumos-gate/usr/src/lib/libc/port/locale/ |
H A D | ungetwc.c | 38 * associated with an input stream "iop". That character, c, 55 __ungetwc_impl(wint_t wc, FILE *iop, int orient) argument 62 FLOCKFILE(lk, iop); 64 if (orient && GET_NO_MODE(iop)) { 65 _setorientation(iop, _WC_MODE); 67 if ((wc == WEOF) || ((iop->_flag & _IOREAD) == 0)) { 78 if (iop->_ptr <= iop->_base) { 79 if (iop->_base == NULL) { 83 if (iop 103 __ungetwc_xpg5(wint_t wc, FILE *iop) argument 109 ungetwc(wint_t wc, FILE *iop) argument [all...] |
/illumos-gate/usr/src/lib/libc/port/print/ |
H A D | fprintf.c | 52 fprintf(FILE *iop, const char *format, ...) argument 61 FLOCKFILE(lk, iop); 63 _SET_ORIENTATION_BYTE(iop); 65 if (!(iop->_flag & _IOWRT)) { 67 if (iop->_flag & _IORW) { 69 iop->_flag |= _IOWRT; 77 count = _ndoprnt(format, ap, iop, 0); 80 if (FERROR(iop) || count == EOF) { 108 _fprintf_c89(FILE *iop, const char *format, ...) argument 114 count = _vfprintf_c89(iop, forma [all...] |
H A D | vwprintf.c | 106 _vfwprintf_c89(FILE *iop, const wchar_t *format, va_list ap) argument 108 vfwprintf(FILE *iop, const wchar_t *format, va_list ap) 114 FLOCKFILE(lk, iop); 116 if (GET_NO_MODE(iop)) 117 _setorientation(iop, _WC_MODE); 119 if (!(iop->_flag & _IOWRT)) { 121 if (iop->_flag & _IORW) { 123 iop->_flag |= _IOWRT; 132 count = _wndoprnt(format, ap, iop, _F_INTMAX32); 134 count = _wndoprnt(format, ap, iop, [all...] |
H A D | wprintf.c | 102 fwprintf(FILE *iop, const wchar_t *format, ...) argument 110 FLOCKFILE(lk, iop); 112 if (GET_NO_MODE(iop)) 113 _setorientation(iop, _WC_MODE); 115 if (!(iop->_flag & _IOWRT)) { 117 if (iop->_flag & _IORW) { 119 iop->_flag |= _IOWRT; 128 count = _wndoprnt(format, ap, iop, 0); 130 if (FERROR(iop) || count == EOF) { 190 _fwprintf_c89(FILE *iop, cons argument [all...] |
/illumos-gate/usr/src/ucblib/libucb/port/gen/ |
H A D | setbuffer.c | 50 setbuffer(FILE *iop, char *abuf, int asize) argument 53 int fno = fileno(iop); /* file number */ 57 if (iop->_base != 0 && iop->_flag & _IOMYBUF) 58 free((char *)iop->_base - PUSHBACK); 59 iop->_flag &= ~(_IOMYBUF | _IONBF | _IOLBF); 61 iop->_flag |= _IONBF; 71 iop->_flag |= _IOMYBUF; 81 iop->_base = temp; 82 _setbufend(iop, tem 92 setlinebuf(FILE *iop) argument [all...] |