xref: /utopia/UTPA2-700.0.x/projects/tools/lint/mips-linux-gnu_include/stdio_ext.h (revision 53ee8cc121a030b8d368113ac3e966b4705770ef)
1*53ee8cc1Swenshuai.xi /* Functions to access FILE structure internals.
2*53ee8cc1Swenshuai.xi    Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
3*53ee8cc1Swenshuai.xi    This file is part of the GNU C Library.
4*53ee8cc1Swenshuai.xi 
5*53ee8cc1Swenshuai.xi    The GNU C Library is free software; you can redistribute it and/or
6*53ee8cc1Swenshuai.xi    modify it under the terms of the GNU Lesser General Public
7*53ee8cc1Swenshuai.xi    License as published by the Free Software Foundation; either
8*53ee8cc1Swenshuai.xi    version 2.1 of the License, or (at your option) any later version.
9*53ee8cc1Swenshuai.xi 
10*53ee8cc1Swenshuai.xi    The GNU C Library is distributed in the hope that it will be useful,
11*53ee8cc1Swenshuai.xi    but WITHOUT ANY WARRANTY; without even the implied warranty of
12*53ee8cc1Swenshuai.xi    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13*53ee8cc1Swenshuai.xi    Lesser General Public License for more details.
14*53ee8cc1Swenshuai.xi 
15*53ee8cc1Swenshuai.xi    You should have received a copy of the GNU Lesser General Public
16*53ee8cc1Swenshuai.xi    License along with the GNU C Library; if not, write to the Free
17*53ee8cc1Swenshuai.xi    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18*53ee8cc1Swenshuai.xi    02111-1307 USA.  */
19*53ee8cc1Swenshuai.xi 
20*53ee8cc1Swenshuai.xi /* This header contains the same definitions as the header of the same name
21*53ee8cc1Swenshuai.xi    on Sun's Solaris OS.  */
22*53ee8cc1Swenshuai.xi 
23*53ee8cc1Swenshuai.xi #ifndef _STDIO_EXT_H
24*53ee8cc1Swenshuai.xi #define _STDIO_EXT_H	1
25*53ee8cc1Swenshuai.xi 
26*53ee8cc1Swenshuai.xi #include <stdio.h>
27*53ee8cc1Swenshuai.xi 
28*53ee8cc1Swenshuai.xi enum
29*53ee8cc1Swenshuai.xi {
30*53ee8cc1Swenshuai.xi   /* Query current state of the locking status.  */
31*53ee8cc1Swenshuai.xi   FSETLOCKING_QUERY = 0,
32*53ee8cc1Swenshuai.xi #define FSETLOCKING_QUERY	FSETLOCKING_QUERY
33*53ee8cc1Swenshuai.xi   /* The library protects all uses of the stream functions, except for
34*53ee8cc1Swenshuai.xi      uses of the *_unlocked functions, by calls equivalent to flockfile().  */
35*53ee8cc1Swenshuai.xi   FSETLOCKING_INTERNAL,
36*53ee8cc1Swenshuai.xi #define FSETLOCKING_INTERNAL	FSETLOCKING_INTERNAL
37*53ee8cc1Swenshuai.xi   /* The user will take care of locking.  */
38*53ee8cc1Swenshuai.xi   FSETLOCKING_BYCALLER
39*53ee8cc1Swenshuai.xi #define FSETLOCKING_BYCALLER	FSETLOCKING_BYCALLER
40*53ee8cc1Swenshuai.xi };
41*53ee8cc1Swenshuai.xi 
42*53ee8cc1Swenshuai.xi 
43*53ee8cc1Swenshuai.xi __BEGIN_DECLS
44*53ee8cc1Swenshuai.xi 
45*53ee8cc1Swenshuai.xi /* Return the size of the buffer of FP in bytes currently in use by
46*53ee8cc1Swenshuai.xi    the given stream.  */
47*53ee8cc1Swenshuai.xi extern size_t __fbufsize (FILE *__fp) __THROW;
48*53ee8cc1Swenshuai.xi 
49*53ee8cc1Swenshuai.xi 
50*53ee8cc1Swenshuai.xi /* Return non-zero value iff the stream FP is opened readonly, or if the
51*53ee8cc1Swenshuai.xi    last operation on the stream was a read operation.  */
52*53ee8cc1Swenshuai.xi extern int __freading (FILE *__fp) __THROW;
53*53ee8cc1Swenshuai.xi 
54*53ee8cc1Swenshuai.xi /* Return non-zero value iff the stream FP is opened write-only or
55*53ee8cc1Swenshuai.xi    append-only, or if the last operation on the stream was a write
56*53ee8cc1Swenshuai.xi    operation.  */
57*53ee8cc1Swenshuai.xi extern int __fwriting (FILE *__fp) __THROW;
58*53ee8cc1Swenshuai.xi 
59*53ee8cc1Swenshuai.xi 
60*53ee8cc1Swenshuai.xi /* Return non-zero value iff stream FP is not opened write-only or
61*53ee8cc1Swenshuai.xi    append-only.  */
62*53ee8cc1Swenshuai.xi extern int __freadable (FILE *__fp) __THROW;
63*53ee8cc1Swenshuai.xi 
64*53ee8cc1Swenshuai.xi /* Return non-zero value iff stream FP is not opened read-only.  */
65*53ee8cc1Swenshuai.xi extern int __fwritable (FILE *__fp) __THROW;
66*53ee8cc1Swenshuai.xi 
67*53ee8cc1Swenshuai.xi 
68*53ee8cc1Swenshuai.xi /* Return non-zero value iff the stream FP is line-buffered.  */
69*53ee8cc1Swenshuai.xi extern int __flbf (FILE *__fp) __THROW;
70*53ee8cc1Swenshuai.xi 
71*53ee8cc1Swenshuai.xi 
72*53ee8cc1Swenshuai.xi /* Discard all pending buffered I/O on the stream FP.  */
73*53ee8cc1Swenshuai.xi extern void __fpurge (FILE *__fp) __THROW;
74*53ee8cc1Swenshuai.xi 
75*53ee8cc1Swenshuai.xi /* Return amount of output in bytes pending on a stream FP.  */
76*53ee8cc1Swenshuai.xi extern size_t __fpending (FILE *__fp) __THROW;
77*53ee8cc1Swenshuai.xi 
78*53ee8cc1Swenshuai.xi /* Flush all line-buffered files.  */
79*53ee8cc1Swenshuai.xi extern void _flushlbf (void);
80*53ee8cc1Swenshuai.xi 
81*53ee8cc1Swenshuai.xi 
82*53ee8cc1Swenshuai.xi /* Set locking status of stream FP to TYPE.  */
83*53ee8cc1Swenshuai.xi extern int __fsetlocking (FILE *__fp, int __type) __THROW;
84*53ee8cc1Swenshuai.xi 
85*53ee8cc1Swenshuai.xi __END_DECLS
86*53ee8cc1Swenshuai.xi 
87*53ee8cc1Swenshuai.xi #endif	/* stdio_ext.h */
88