8939 btxld coverity cleanups
[unleashed.git] / include / stdio_ext.h
blob848c356d01e0e6f8be9921c0228f5195442cb992
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
23 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
28 * Extensions to the stdio package
31 #ifndef _STDIO_EXT_H
32 #define _STDIO_EXT_H
34 #pragma ident "%Z%%M% %I% %E% SMI"
36 #include <stdio.h>
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
43 * Even though the contents of the stdio FILE structure have always been
44 * private to the stdio implementation, over the years some programs have
45 * needed to get information about a stdio stream that was not accessible
46 * through a supported interface. These programs have resorted to accessing
47 * fields of the FILE structure directly, rendering them possibly non-portable
48 * to new implementations of stdio, or more likely, preventing enhancements
49 * to stdio because those programs will break.
51 * In the 64-bit world, the FILE structure is opaque. The routines here
52 * are provided as a way to get the information that used to be retrieved
53 * directly from the FILE structure. They are based on the needs of
54 * existing programs (such as 'mh' and 'emacs'), so they may be extended
55 * as other programs are ported. Though they may still be non-portable to
56 * other operating systems, they will work from each Solaris release to
57 * the next. More portable interfaces are being developed.
60 #define FSETLOCKING_QUERY 0
61 #define FSETLOCKING_INTERNAL 1
62 #define FSETLOCKING_BYCALLER 2
64 extern size_t __fbufsize(FILE *stream);
65 extern int __freading(FILE *stream);
66 extern int __fwriting(FILE *stream);
67 extern int __freadable(FILE *stream);
68 extern int __fwritable(FILE *stream);
69 extern int __flbf(FILE *stream);
70 extern void __fpurge(FILE *stream);
71 extern size_t __fpending(FILE *stream);
72 extern void _flushlbf(void);
73 extern int __fsetlocking(FILE *stream, int type);
74 extern void __fseterr(FILE *stream);
75 extern size_t __freadahead(FILE *stream);
78 * Extended FILE enabling function.
80 #if defined(_LP64) && !defined(__lint)
81 #define enable_extended_FILE_stdio(fd, act) (0)
82 #else
83 extern int enable_extended_FILE_stdio(int, int);
84 #endif
86 #ifdef __cplusplus
88 #endif
90 #endif /* _STDIO_EXT_H */