Home
last modified time | relevance | path

Searched refs:iop (Results 1 – 25 of 144) sorted by relevance

123456

/titanic_50/usr/src/lib/libc/inc/
H A Dstdiom.h61 #define SET_IONOLOCK(iop) ((iop)->_flag |= _IONOLOCK) argument
62 #define CLEAR_IONOLOCK(iop) ((iop)->_flag &= ~_IONOLOCK) argument
63 #define GET_IONOLOCK(iop) ((iop)->_flag & _IONOLOCK) argument
64 #define SET_BYTE_MODE(iop) ((iop)->_flag |= _BYTE_MODE_FLAG) argument
65 #define CLEAR_BYTE_MODE(iop) ((iop)->_flag &= ~_BYTE_MODE_FLAG) argument
66 #define GET_BYTE_MODE(iop) ((iop)->_flag & _BYTE_MODE_FLAG) argument
67 #define SET_WC_MODE(iop) ((iop)->_flag |= _WC_MODE_FLAG) argument
68 #define CLEAR_WC_MODE(iop) ((iop)->_flag &= ~_WC_MODE_FLAG) argument
69 #define GET_WC_MODE(iop) ((iop)->_flag & _WC_MODE_FLAG) argument
70 #define GET_NO_MODE(iop) (!((iop)->_flag & \ argument
[all …]
/titanic_50/usr/src/lib/libbc/libc/stdio/4.2/
H A Dflsbuf.c69 fclose(FILE *iop) in fclose() argument
73 if(iop == NULL) in fclose()
75 if(iop->_flag & (_IOREAD | _IOWRT | _IORW) in fclose()
76 && (iop->_flag & _IOSTRG) == 0) { in fclose()
77 rtn = (iop->_flag & _IONBF)? 0: fflush(iop); in fclose()
78 if(close(fileno(iop)) < 0) in fclose()
81 if(iop->_flag & _IOMYBUF) { in fclose()
82 free((char*)iop->_base); in fclose()
83 iop->_base = NULL; in fclose()
85 iop->_flag = 0; in fclose()
[all …]
H A Dfilbuf.c41 __filbuf(FILE *iop) in __filbuf() argument
43 return (_filbuf(iop)); in __filbuf()
47 _filbuf(FILE *iop) in _filbuf() argument
50 if ( !(iop->_flag & _IOREAD) ) in _filbuf()
51 if (iop->_flag & _IORW) in _filbuf()
52 iop->_flag |= _IOREAD; in _filbuf()
56 if (iop->_flag&(_IOSTRG|_IOEOF)) in _filbuf()
59 if (iop->_base == NULL) /* get buffer if we don't have one */ in _filbuf()
60 _findbuf(iop); in _filbuf()
62 if (iop == stdin) { in _filbuf()
[all …]
H A Dvfprintf.c39 vfprintf(FILE *iop, char *format, va_list ap) in vfprintf() argument
44 if (!(iop->_flag & _IOWRT)) { in vfprintf()
46 if (iop->_flag & _IORW) { in vfprintf()
48 iop->_flag |= _IOWRT; in vfprintf()
54 if (iop->_flag & _IONBF) { in vfprintf()
55 iop->_flag &= ~_IONBF; in vfprintf()
56 iop->_ptr = iop->_base = localbuf; in vfprintf()
57 iop->_bufsiz = BUFSIZ; in vfprintf()
58 count = _doprnt(format, ap, iop); in vfprintf()
59 fflush(iop); in vfprintf()
[all …]
H A Dfprintf.c39 fprintf(FILE *iop, char *format, ...) in fprintf() argument
45 if (!(iop->_flag & _IOWRT)) { in fprintf()
47 if (iop->_flag & _IORW) { in fprintf()
49 iop->_flag |= _IOWRT; in fprintf()
56 if (iop->_flag & _IONBF) { in fprintf()
57 iop->_flag &= ~_IONBF; in fprintf()
58 iop->_ptr = iop->_base = localbuf; in fprintf()
59 iop->_bufsiz = BUFSIZ; in fprintf()
60 count = _doprnt(format, ap, iop); in fprintf()
61 fflush(iop); in fprintf()
[all …]
/titanic_50/usr/src/lib/libbc/libc/stdio/sys5/
H A Dflsbuf.c67 fclose(FILE *iop) in fclose() argument
71 if(iop == NULL) in fclose()
73 if(iop->_flag & (_IOREAD | _IOWRT | _IORW) in fclose()
74 && (iop->_flag & _IOSTRG) == 0) { in fclose()
75 rtn = (iop->_flag & _IONBF)? 0: fflush(iop); in fclose()
76 if(close(fileno(iop)) < 0) in fclose()
79 if(iop->_flag & _IOMYBUF) { in fclose()
80 free((char*)iop->_base); in fclose()
81 iop->_base = NULL; in fclose()
83 iop->_flag = 0; in fclose()
[all …]
H A Dfilbuf.c41 __filbuf(FILE *iop) in __filbuf() argument
43 return (_filbuf(iop)); in __filbuf()
47 _filbuf(FILE *iop) in _filbuf() argument
49 if ( !(iop->_flag & _IOREAD) ) in _filbuf()
50 if (iop->_flag & _IORW) in _filbuf()
51 iop->_flag |= _IOREAD; in _filbuf()
55 if (iop->_flag&_IOSTRG) in _filbuf()
58 if (iop->_base == NULL) /* get buffer if we don't have one */ in _filbuf()
59 _findbuf(iop); in _filbuf()
64 if (iop->_flag & (_IOLBF | _IONBF)) in _filbuf()
[all …]
H A Dvfprintf.c39 vfprintf(FILE *iop, char *format, va_list ap) in vfprintf() argument
44 if (!(iop->_flag & _IOWRT)) { in vfprintf()
46 if (iop->_flag & _IORW) { in vfprintf()
48 iop->_flag |= _IOWRT; in vfprintf()
54 if (iop->_flag & _IONBF) { in vfprintf()
55 iop->_flag &= ~_IONBF; in vfprintf()
56 iop->_ptr = iop->_base = localbuf; in vfprintf()
57 iop->_bufsiz = BUFSIZ; in vfprintf()
58 count = _doprnt(format, ap, iop); in vfprintf()
59 fflush(iop); in vfprintf()
[all …]
H A Dfprintf.c39 fprintf(FILE *iop, char *format, ...) in fprintf() argument
45 if (!(iop->_flag & _IOWRT)) { in fprintf()
47 if (iop->_flag & _IORW) { in fprintf()
49 iop->_flag |= _IOWRT; in fprintf()
56 if (iop->_flag & _IONBF) { in fprintf()
57 iop->_flag &= ~_IONBF; in fprintf()
58 iop->_ptr = iop->_base = localbuf; in fprintf()
59 iop->_bufsiz = BUFSIZ; in fprintf()
60 count = _doprnt(format, ap, iop); in fprintf()
61 fflush(iop); in fprintf()
[all …]
H A Dsetbuf.c41 setbuf(iop, buf) in setbuf() argument
42 register FILE *iop; in setbuf()
45 register int fno = fileno(iop); /* file number */
47 if(iop->_base != NULL && iop->_flag & _IOMYBUF)
48 free((char*)iop->_base);
49 iop->_flag &= ~(_IOMYBUF | _IONBF | _IOLBF);
50 if((iop->_base = (unsigned char*)buf) == NULL) {
51 iop->_flag |= _IONBF; /* file unbuffered except in fastio */
53 iop->_base = _smbuf[fno];
54 iop->_bufsiz = _SBFSIZ;
[all …]
/titanic_50/usr/src/lib/libc/port/stdio/
H A Dflush.c387 isseekable(FILE *iop) in isseekable() argument
394 if (fstat64(GET_FD(iop), &fstatbuf) != 0) { in isseekable()
400 SET_SEEKABLE(iop); in isseekable()
413 CLEAR_SEEKABLE(iop); in isseekable()
415 SET_SEEKABLE(iop); in isseekable()
423 _setbufend(FILE *iop, Uchar *end) /* set the end pointer for this iop */ in _setbufend() argument
425 iop->_end = end; in _setbufend()
427 isseekable(iop); in _setbufend()
433 _realbufend(FILE *iop) /* get the end pointer for this iop */ in _realbufend() argument
435 return (iop->_end); in _realbufend()
[all …]
H A Dfwrite.c46 _fwrite_unlocked(const void *ptr, size_t size, size_t count, FILE *iop);
49 fwrite(const void *ptr, size_t size, size_t count, FILE *iop) in fwrite() argument
54 FLOCKFILE(lk, iop); in fwrite()
56 _SET_ORIENTATION_BYTE(iop); in fwrite()
58 retval = _fwrite_unlocked(ptr, size, count, iop); in fwrite()
65 _fwrite_unlocked(const void *ptr, size_t size, size_t count, FILE *iop) in _fwrite_unlocked() argument
71 if (_WRTCHK(iop)) in _fwrite_unlocked()
84 if (iop->_flag & _IOLBF) { in _fwrite_unlocked()
85 bufend = _bufend(iop); in _fwrite_unlocked()
86 iop->_cnt = iop->_base - iop->_ptr; in _fwrite_unlocked()
[all …]
H A Dfopen.c63 FILE *iop; in fopen() local
66 iop = _findiop(); in fopen()
71 rc = _endopen(name, type, iop, LARGE_OPEN); in fopen()
73 if (rc == NULL && iop != NULL) in fopen()
74 iop->_flag = 0; /* release iop */ in fopen()
80 _freopen_null(const char *type, FILE *iop) in _freopen_null() argument
86 if (iop == NULL || iop->_flag == 0) { in _freopen_null()
91 if (!(iop->_flag & _IONBF) && (iop->_flag & (_IOWRT | _IOREAD | _IORW))) in _freopen_null()
92 (void) _fflush_u(iop); in _freopen_null()
94 if (iop->_flag & _IOMYBUF) { in _freopen_null()
[all …]
H A D_filbuf.c54 _filbuf(FILE *iop) in _filbuf() argument
65 if (!(iop->_flag & _IOREAD)) /* check, correct permissions */ in _filbuf()
67 if (iop->_flag & _IORW) in _filbuf()
68 iop->_flag |= _IOREAD; /* change direction */ in _filbuf()
76 if (iop->_base == 0) { in _filbuf()
77 if ((endbuf = _findbuf(iop)) == 0) /* get buffer and */ in _filbuf()
82 endbuf = _bufend(iop); in _filbuf()
88 if (iop->_flag & (_IONBF | _IOLBF)) in _filbuf()
99 if ((flag = iop->_flag) & _IOEOF) { in _filbuf()
108 iop->_cnt = 0; in _filbuf()
[all …]
H A Dungetc.c41 int _ungetc_unlocked(int c, FILE *iop);
44 ungetc(int c, FILE *iop) in ungetc() argument
46 FLOCKRETURN(iop, _ungetc_unlocked(c, iop)) in ungetc()
55 _ungetc_unlocked(int c, FILE *iop) in _ungetc_unlocked() argument
59 if (iop->_ptr <= iop->_base) { in _ungetc_unlocked()
60 if (iop->_base == 0) { in _ungetc_unlocked()
61 if (_findbuf(iop) == 0) in _ungetc_unlocked()
63 } else if (iop->_ptr <= iop->_base - PUSHBACK) in _ungetc_unlocked()
66 if ((iop->_flag & _IOREAD) == 0) /* basically a no-op on write stream */ in _ungetc_unlocked()
67 ++iop->_ptr; in _ungetc_unlocked()
[all …]
H A Dfseeko.c57 fseeko64(FILE *iop, off64_t offset, int ptrname) in fseeko64() argument
62 FLOCKFILE(lk, iop); in fseeko64()
63 iop->_flag &= ~_IOEOF; in fseeko64()
65 if (!(iop->_flag & _IOREAD) && !(iop->_flag & (_IOWRT | _IORW))) { in fseeko64()
71 if (iop->_flag & _IOREAD) { in fseeko64()
72 if (ptrname == 1 && iop->_base && !(iop->_flag&_IONBF)) { in fseeko64()
73 offset -= iop->_cnt; in fseeko64()
75 } else if (iop->_flag & (_IOWRT | _IORW)) { in fseeko64()
76 if (_fflush_u(iop) == EOF) { in fseeko64()
81 iop->_cnt = 0; in fseeko64()
[all …]
H A D_flsbuf.c45 _flsbuf(int ch, FILE *iop) /* flush (write) buffer, save ch, */ in _flsbuf() argument
52 switch (iop->_flag & (_IOFBF | _IOLBF | _IONBF | in _flsbuf()
56 if (iop->_base != 0 && iop->_ptr > iop->_base) in _flsbuf()
60 if (iop->_ptr >= _bufend(iop)) in _flsbuf()
67 if ((*iop->_ptr++ = (unsigned char)ch) == '\n') in _flsbuf()
68 (void) _xflsbuf(iop); in _flsbuf()
69 iop->_cnt = 0; in _flsbuf()
72 iop->_cnt = 0; in _flsbuf()
74 if (write(GET_FD(iop), (char *)&uch, 1) != 1) { in _flsbuf()
76 iop->_flag |= _IOERR; in _flsbuf()
[all …]
H A Dfseek.c50 fseek(FILE *iop, long offset, int ptrname) in fseek() argument
55 FLOCKFILE(lk, iop); in fseek()
56 iop->_flag &= ~_IOEOF; in fseek()
58 if (!(iop->_flag & _IOREAD) && !(iop->_flag & (_IOWRT | _IORW))) { in fseek()
64 if (iop->_flag & _IOREAD) { in fseek()
65 if (ptrname == 1 && iop->_base && !(iop->_flag&_IONBF)) { in fseek()
66 offset -= iop->_cnt; in fseek()
68 } else if (iop->_flag & (_IOWRT | _IORW)) { in fseek()
69 if (_fflush_u(iop) == EOF) { in fseek()
74 iop->_cnt = 0; in fseek()
[all …]
/titanic_50/usr/src/lib/libbc/libc/stdio/common/
H A Dfseek.c42 fseek(iop, offset, ptrname) in fseek() argument
43 register FILE *iop; in fseek()
50 iop->_flag &= ~_IOEOF;
51 if(iop->_flag & _IOREAD) {
52 if(ptrname < 2 && iop->_base && !(iop->_flag&_IONBF)) {
53 c = iop->_cnt;
56 long curpos = lseek(fileno(iop), 0L, 1);
65 if(!(iop->_flag&_IORW) && c > 0 && p <= c &&
66 p >= iop->_base - iop->_ptr) {
67 iop->_ptr += (int)p;
[all …]
H A Dsetbuffer.c46 setbuffer(FILE *iop, char *buf, int size) in setbuffer() argument
48 int fno = fileno(iop); /* file number */ in setbuffer()
50 if (iop->_base != NULL && iop->_flag&_IOMYBUF) in setbuffer()
51 free((char *)iop->_base); in setbuffer()
52 iop->_flag &= ~(_IOMYBUF|_IONBF|_IOLBF); in setbuffer()
53 if ((iop->_base = (unsigned char *)buf) == NULL) { in setbuffer()
54 iop->_flag |= _IONBF; /* file unbuffered except in fastio */ in setbuffer()
56 iop->_base = _smbuf[fno]; in setbuffer()
57 iop->_bufsiz = _SBFSIZ; in setbuffer()
62 iop->_bufsiz = size; in setbuffer()
[all …]
H A Dfwrite.c49 fwrite(ptr, size, count, iop) in fwrite() argument
52 register FILE *iop;
59 if (size <= 0 || count <= 0 || _WRTCHK(iop))
62 bufend = iop->_base + iop->_bufsiz;
67 prev_ptr = iop->_ptr;
68 if (iop->_base >= iop->_ptr) { /*this covers the unbuffered case, too*/
69 if (((iop->_flag & _IONBF) != 0) || (nleft >= BUFSIZ)) {
70 if ((n=write(fileno(iop),ptr,nleft)) != nleft)
72 iop->_flag |= _IOERR;
82 while ((n = bufend - (cptr = iop->_ptr)) <= 0) /* full buf */
[all …]
H A Dstdiom.h33 #define _BUFSYNC(iop) if ((iop->_base + iop->_bufsiz) - iop->_ptr < \ argument
34 ( iop->_cnt < 0 ? 0 : iop->_cnt ) ) \
35 _bufsync(iop)
36 #define _WRTCHK(iop) ((((iop->_flag & (_IOWRT | _IOEOF)) != _IOWRT) \ argument
37 || (iop->_base == NULL) \
38 || (iop->_ptr == iop->_base && iop->_cnt == 0 \
39 && !(iop->_flag & (_IONBF | _IOLBF)))) \
40 ? _wrtchk(iop) : 0 )
/titanic_50/usr/src/ucblib/libucb/port/stdio/
H A Dfopen.c55 _endopen(const char *file, const char *mode, FILE *iop, int largefile) in _endopen() argument
59 if (iop == NULL || file == NULL || file[0] == '\0') in _endopen()
83 iop->_cnt = 0; in _endopen()
85 iop->_file = fd; in _endopen()
88 SET_FILE(iop, fd); in _endopen()
89 } else if (_file_set(iop, fd, mode) != 0) { in _endopen()
95 iop->_flag = plus ? _IORW : (mode[0] == 'r') ? _IOREAD : _IOWRT; in _endopen()
102 iop->_base = iop->_ptr = NULL; in _endopen()
108 return (iop); in _endopen()
114 FILE *iop; in fopen() local
[all …]
/titanic_50/usr/src/lib/libc/port/locale/
H A Dungetwc.c55 __ungetwc_impl(wint_t wc, FILE *iop, int orient) in __ungetwc_impl() argument
62 FLOCKFILE(lk, iop); in __ungetwc_impl()
64 if (orient && GET_NO_MODE(iop)) { in __ungetwc_impl()
65 _setorientation(iop, _WC_MODE); in __ungetwc_impl()
67 if ((wc == WEOF) || ((iop->_flag & _IOREAD) == 0)) { in __ungetwc_impl()
78 if (iop->_ptr <= iop->_base) { in __ungetwc_impl()
79 if (iop->_base == NULL) { in __ungetwc_impl()
83 if (iop->_ptr == iop->_base && iop->_cnt == 0) { in __ungetwc_impl()
84 ++iop->_ptr; in __ungetwc_impl()
85 } else if ((iop->_ptr - n) < (iop->_base - PUSHBACK)) { in __ungetwc_impl()
[all …]
/titanic_50/usr/src/ucblib/libucb/inc/
H A Dstdiom.h76 #define _bufend(iop) _realbufend(iop) argument
77 #define setbufend(iop, end) _setbufend(iop, end) argument
85 extern Uchar *_realbufend(FILE *iop);
86 extern void _setbufend(FILE *iop, Uchar *end);
87 extern int _wrtchk(FILE *iop);
92 extern void _bufsync(FILE *iop, Uchar *bufend);
93 extern int _xflsbuf(FILE *iop);
98 extern Uchar *_findbuf(FILE *iop);
102 #define SET_FILE(iop, fd) (iop)->_magic = (fd); (iop)->__extendedfd = 0 argument
117 #define _WRTCHK(iop) ((((iop->_flag & (_IOWRT | _IOEOF)) != _IOWRT) || \ argument
[all …]

123456