/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2014 Garrett D'Amore <garrett@damore.org>
*/
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
/*
* User-visible pieces of the ANSI C standard I/O package.
*/
#ifndef _STDIO_H
#define _STDIO_H
#include <sys/feature_tests.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Do all of our 'redefine_extname' processing before
* declarations of the associated functions are seen.
* This is necessary to keep gcc happy.
*/
#if defined(__PRAGMA_REDEFINE_EXTNAME)
/* large file compilation environment setup */
#if defined(_LARGEFILE_SOURCE)
#endif /* _LARGEFILE_SOURCE */
#endif /* !defined(_LP64) && _FILE_OFFSET_BITS == 64 */
/* In the LP64 compilation environment, all APIs are already large file */
#if defined(_LP64) && defined(_LARGEFILE64_SOURCE)
#if defined(_LARGEFILE_SOURCE)
#endif /* _LARGEFILE_SOURCE */
#endif /* defined(_LP64) && defined(_LARGEFILE64_SOURCE) */
#endif /* __PRAGMA_REDEFINE_EXTNAME */
#ifdef __cplusplus
}
#endif
#include <iso/stdio_iso.h>
/*
* If feature test macros are set that enable interfaces that use types
*
* Note that in asking for the interfaces associated with this feature test
* macro one also asks for definitions of the POSIX types.
*/
/*
* Allow global visibility for symbols defined in
* C++ "std" namespace in <iso/stdio_iso.h>.
*/
#if __cplusplus >= 199711L
#ifndef _LP64
#endif /* _LP64 */
#endif /* __cplusplus >= 199711L */
/*
* This header needs to be included here because it relies on the global
* visibility of FILE and size_t in the C++ environment.
*/
#include <iso/stdio_c99.h>
#ifdef __cplusplus
extern "C" {
#endif
#if defined(_LARGEFILE_SOURCE) || defined(_XPG5)
#ifndef _OFF_T
#define _OFF_T
typedef long off_t;
#else
typedef __longlong_t off_t;
#endif
#ifdef _LARGEFILE64_SOURCE
#ifdef _LP64
#else
#endif
#endif /* _LARGEFILE64_SOURCE */
#endif /* _OFF_T */
#endif /* _LARGEFILE_SOURCE */
#ifdef _LARGEFILE64_SOURCE
#ifdef _LP64
#else
#endif
#endif /* _LARGEFILE64_SOURCE */
/*
* XPG4 requires that va_list be defined in <stdio.h> "as described in
* not be polluted with this name.
*/
#define _VA_LIST
#endif /* defined(_XPG4 && !defined(_VA_LIST) */
#if defined(__EXTENSIONS__) || !defined(_STRICT_STDC) || \
defined(__XOPEN_OR_POSIX)
/* Marked LEGACY in SUSv2 and removed in SUSv3 */
#if !defined(_XPG6) || defined(__EXTENSIONS__)
#endif
#endif /* defined(__EXTENSIONS__) || !defined(_STRICT_STDC) ... */
#if defined(__EXTENSIONS__) || \
(!defined(_STRICT_STDC) && !defined(_POSIX_C_SOURCE)) || \
defined(_XOPEN_SOURCE)
#endif /* defined(__EXTENSIONS__) || (!defined(_STRICT_STDC) ... */
#ifndef _STDIO_ALLOCATE
#endif
/* large file compilation environment setup */
#if !defined(__PRAGMA_REDEFINE_EXTNAME)
#ifdef _LARGEFILE_SOURCE
#endif
#endif /* !__PRAGMA_REDEFINE_EXTNAME */
#endif /* !_LP64 && _FILE_OFFSET_BITS == 64 */
#ifndef _LP64
extern unsigned char *_bufendtab[];
#endif
/* In the LP64 compilation environment, all APIs are already large file */
#if defined(_LP64) && defined(_LARGEFILE64_SOURCE)
#if !defined(__PRAGMA_REDEFINE_EXTNAME)
#ifdef _LARGEFILE_SOURCE
#endif
#endif /* !__PRAGMA_REDEFINE_EXTNAME */
#endif /* _LP64 && _LARGEFILE64_SOURCE */
#ifndef _SSIZE_T
#define _SSIZE_T
#else
#endif
#endif /* !_SSIZE_T */
#if defined(__EXTENSIONS__) || \
(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
defined(_REENTRANT)
extern char *tmpnam_r(char *);
#endif
#if defined(__EXTENSIONS__) || \
(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
extern int fcloseall(void);
extern int setlinebuf(FILE *);
/* PRINTFLIKE2 */
extern int asprintf(char **, const char *, ...);
/* PRINTFLIKE2 */
#endif
#if defined(__EXTENSIONS__) || \
(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
/* || defined(_XPG7) */
int, FILE *_RESTRICT_KYWD);
#endif /* __EXTENSIONS__ ... */
/*
* The following are known to POSIX and XOPEN, but not to ANSI-C.
*/
#if defined(__EXTENSIONS__) || \
!defined(_STRICT_STDC) || defined(__XOPEN_OR_POSIX)
extern char *ctermid(char *);
#endif /* defined(__EXTENSIONS__) || !defined(_STRICT_STDC) ... */
/*
* The following are known to POSIX.1c, but not to ANSI-C or XOPEN.
*/
#if defined(__EXTENSIONS__) || defined(_REENTRANT) || \
(_POSIX_C_SOURCE - 0 >= 199506L)
extern int ftrylockfile(FILE *);
extern void funlockfile(FILE *);
extern int getc_unlocked(FILE *);
extern int getchar_unlocked(void);
extern int putc_unlocked(int, FILE *);
extern int putchar_unlocked(int);
#endif /* defined(__EXTENSIONS__) || defined(_REENTRANT).. */
/*
* The following are known to XOPEN, but not to ANSI-C or POSIX.
*/
#if defined(__EXTENSIONS__) || !defined(_STRICT_STDC) || \
defined(_XOPEN_SOURCE)
extern char *tempnam(const char *, const char *);
#if !defined(_XOPEN_SOURCE)
extern int getsubopt(char **, char *const *, char **);
#endif /* !defined(_XOPEN_SOURCE) */
/* Marked LEGACY in SUSv2 and removed in SUSv3 */
#if !defined(_XPG6) || defined(__EXTENSIONS__)
extern char *cuserid(char *);
extern int getopt(int, char *const *, const char *);
extern char *optarg;
#endif /* !defined(_XPG6) || defined(__EXTENSIONS__) */
#endif /* defined(__EXTENSIONS__) || !defined(_STRICT_STDC) ... */
/*
* The following are defined as part of the Large File Summit interfaces.
*/
#if defined(_LARGEFILE_SOURCE) || defined(_XPG5)
#endif
/*
* The following are defined as part of the transitional Large File Summit
* interfaces.
*/
!defined(__PRAGMA_REDEFINE_EXTNAME))
#endif
#if !defined(__lint)
#if defined(__EXTENSIONS__) || defined(_REENTRANT) || \
(_POSIX_C_SOURCE - 0 >= 199506L)
#ifndef _LP64
? __filbuf(p) \
: (int)*(p)->_ptr++)
? __flsbuf((x), (p)) \
: (int)(*(p)->_ptr++ = \
(unsigned char) (x)))
#endif /* _LP64 */
#endif /* defined(__EXTENSIONS__) || defined(_REENTRANT).. */
#endif /* !defined(__lint) */
#ifdef __cplusplus
}
#endif
#endif /* _STDIO_H */