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