This source file includes following definitions.
- fbufmode
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #include <config.h>
18
19
20 #include "fbufmode.h"
21
22 #if HAVE___FLBF
23 # if HAVE_STDIO_EXT_H
24 # include <stdio_ext.h>
25 # endif
26 #endif
27
28 #include "stdio-impl.h"
29
30 int
31 fbufmode (FILE *fp)
32 {
33
34
35
36 #if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
37
38 # if HAVE___FLBF
39 if (__flbf (fp))
40 return _IOLBF;
41 # else
42 if (fp->_flags & _IO_LINE_BUF)
43 return _IOLBF;
44 # endif
45 if (fp->_flags & _IO_UNBUFFERED)
46 return _IONBF;
47 return _IOFBF;
48 #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
49
50 if (fp_->_flags & __SLBF)
51 return _IOLBF;
52 if (fp_->_flags & __SNBF)
53 return _IONBF;
54 return _IOFBF;
55 #elif defined __EMX__
56 return fp->_flags & (_IOLBF | _IONBF | _IOFBF);
57 #elif defined __minix
58 return fp->_flags & (_IOLBF | _IONBF | _IOFBF);
59 #elif defined _IOERR
60 # if defined WINDOWS_OPAQUE_FILE
61 if (fp_->_flag & 0x100)
62 return _IOFBF;
63 else
64 return _IONBF;
65 # else
66 # if HAVE___FLBF
67 if (__flbf (fp))
68 return _IOLBF;
69 # else
70 if (fp_->_flag & _IOLBF)
71 return _IOLBF;
72 # endif
73 if (fp_->_flag & _IONBF)
74 return _IONBF;
75 return _IOFBF;
76 # endif
77 #elif defined __UCLIBC__
78 if (fp->__modeflags & __FLAG_LBF)
79 return _IOLBF;
80 if (fp->__modeflags & __FLAG_NBF)
81 return _IONBF;
82 return _IOFBF;
83 #elif defined __QNX__
84 if (fp->_Mode & 0x400 )
85 return _IOLBF;
86 if (fp->_Mode & 0x800 )
87 return _IONBF;
88 return _IOFBF;
89 #elif defined __MINT__
90 if (fp->__linebuf)
91 return _IOLBF;
92 return (fp->__bufsize > 0 ? _IOFBF : _IONBF);
93 #elif HAVE___FLBF && HAVE___FBUFSIZE
94 if (__flbf (fp))
95 return _IOLBF;
96 return (__fbufsize (fp) > 0 ? _IOFBF : _IONBF);
97 #elif defined EPLAN9
98 if (fp->flags & 2 )
99 return _IOLBF;
100 if (fp->bufl)
101 return _IOFBF;
102 return _IONBF;
103 #else
104 # error "Please port gnulib fbufmode.c to your platform! Look at the setvbuf implementation."
105 #endif
106 }