|
Packit |
6c4009 |
#ifndef _STDIO_H
|
|
Packit |
6c4009 |
# if !defined _ISOMAC && defined _IO_MTSAFE_IO
|
|
Packit |
6c4009 |
# include <stdio-lock.h>
|
|
Packit |
6c4009 |
# endif
|
|
Packit |
6c4009 |
# include <libio/stdio.h>
|
|
Packit |
6c4009 |
# ifndef _ISOMAC
|
|
Packit |
6c4009 |
# define _LIBC_STDIO_H 1
|
|
Packit |
6c4009 |
# include <libio/libio.h>
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Now define the internal interfaces. */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
extern int __fcloseall (void) attribute_hidden;
|
|
Packit |
6c4009 |
extern int __snprintf (char *__restrict __s, size_t __maxlen,
|
|
Packit |
6c4009 |
const char *__restrict __format, ...)
|
|
Packit |
6c4009 |
__attribute__ ((__format__ (__printf__, 3, 4)));
|
|
Packit |
6c4009 |
libc_hidden_proto (__snprintf)
|
|
Packit |
6c4009 |
extern int __vsnprintf (char *__restrict __s, size_t __maxlen,
|
|
Packit |
6c4009 |
const char *__restrict __format, __gnuc_va_list __arg)
|
|
Packit |
6c4009 |
__attribute__ ((__format__ (__printf__, 3, 0)));
|
|
Packit |
6c4009 |
extern int __vfscanf (FILE *__restrict __s,
|
|
Packit |
6c4009 |
const char *__restrict __format,
|
|
Packit |
6c4009 |
__gnuc_va_list __arg)
|
|
Packit |
6c4009 |
__attribute__ ((__format__ (__scanf__, 2, 0)));
|
|
Packit |
6c4009 |
libc_hidden_proto (__vfscanf)
|
|
Packit |
6c4009 |
extern int __vscanf (const char *__restrict __format,
|
|
Packit |
6c4009 |
__gnuc_va_list __arg)
|
|
Packit |
6c4009 |
__attribute__ ((__format__ (__scanf__, 1, 0)));
|
|
Packit |
6c4009 |
extern __ssize_t __getline (char **__lineptr, size_t *__n,
|
|
Packit |
6c4009 |
FILE *__stream) attribute_hidden;
|
|
Packit |
6c4009 |
extern int __vsscanf (const char *__restrict __s,
|
|
Packit |
6c4009 |
const char *__restrict __format,
|
|
Packit |
6c4009 |
__gnuc_va_list __arg)
|
|
Packit |
6c4009 |
__attribute__ ((__format__ (__scanf__, 2, 0)));
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
extern int __sprintf_chk (char *, int, size_t, const char *, ...) __THROW;
|
|
Packit |
6c4009 |
extern int __snprintf_chk (char *, size_t, int, size_t, const char *, ...)
|
|
Packit |
6c4009 |
__THROW;
|
|
Packit |
6c4009 |
extern int __vsprintf_chk (char *, int, size_t, const char *,
|
|
Packit |
6c4009 |
__gnuc_va_list) __THROW;
|
|
Packit |
6c4009 |
extern int __vsnprintf_chk (char *, size_t, int, size_t, const char *,
|
|
Packit |
6c4009 |
__gnuc_va_list) __THROW;
|
|
Packit |
6c4009 |
extern int __printf_chk (int, const char *, ...);
|
|
Packit |
6c4009 |
extern int __fprintf_chk (FILE *, int, const char *, ...);
|
|
Packit |
6c4009 |
extern int __vprintf_chk (int, const char *, __gnuc_va_list);
|
|
Packit |
6c4009 |
extern int __vfprintf_chk (FILE *, int, const char *, __gnuc_va_list);
|
|
Packit |
6c4009 |
extern char *__fgets_unlocked_chk (char *buf, size_t size, int n, FILE *fp);
|
|
Packit |
6c4009 |
extern char *__fgets_chk (char *buf, size_t size, int n, FILE *fp);
|
|
Packit |
6c4009 |
extern int __asprintf_chk (char **, int, const char *, ...) __THROW;
|
|
Packit |
6c4009 |
extern int __vasprintf_chk (char **, int, const char *, __gnuc_va_list) __THROW;
|
|
Packit |
6c4009 |
extern int __dprintf_chk (int, int, const char *, ...);
|
|
Packit |
6c4009 |
extern int __vdprintf_chk (int, int, const char *, __gnuc_va_list);
|
|
Packit |
6c4009 |
extern int __obstack_printf_chk (struct obstack *, int, const char *, ...)
|
|
Packit |
6c4009 |
__THROW;
|
|
Packit |
6c4009 |
extern int __obstack_vprintf_chk (struct obstack *, int, const char *,
|
|
Packit |
6c4009 |
__gnuc_va_list) __THROW;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
extern int __isoc99_fscanf (FILE *__restrict __stream,
|
|
Packit |
6c4009 |
const char *__restrict __format, ...) __wur;
|
|
Packit |
6c4009 |
extern int __isoc99_scanf (const char *__restrict __format, ...) __wur;
|
|
Packit |
6c4009 |
extern int __isoc99_sscanf (const char *__restrict __s,
|
|
Packit |
6c4009 |
const char *__restrict __format, ...) __THROW;
|
|
Packit |
6c4009 |
extern int __isoc99_vfscanf (FILE *__restrict __s,
|
|
Packit |
6c4009 |
const char *__restrict __format,
|
|
Packit |
6c4009 |
__gnuc_va_list __arg) __wur;
|
|
Packit |
6c4009 |
extern int __isoc99_vscanf (const char *__restrict __format,
|
|
Packit |
6c4009 |
__gnuc_va_list __arg) __wur;
|
|
Packit |
6c4009 |
extern int __isoc99_vsscanf (const char *__restrict __s,
|
|
Packit |
6c4009 |
const char *__restrict __format,
|
|
Packit |
6c4009 |
__gnuc_va_list __arg) __THROW;
|
|
Packit |
6c4009 |
libc_hidden_proto (__isoc99_vsscanf)
|
|
Packit |
6c4009 |
libc_hidden_proto (__isoc99_vfscanf)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Prototypes for compatibility functions. */
|
|
Packit |
6c4009 |
extern FILE *__new_tmpfile (void);
|
|
Packit |
6c4009 |
extern FILE *__old_tmpfile (void);
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# define __need_size_t
|
|
Packit |
6c4009 |
# include <stddef.h>
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# include <bits/types/wint_t.h>
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Generate a unique file name (and possibly open it). */
|
|
Packit |
6c4009 |
extern int __path_search (char *__tmpl, size_t __tmpl_len,
|
|
Packit |
6c4009 |
const char *__dir, const char *__pfx,
|
|
Packit |
6c4009 |
int __try_tempdir) attribute_hidden;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
extern int __gen_tempname (char *__tmpl, int __suffixlen, int __flags,
|
|
Packit |
6c4009 |
int __kind) attribute_hidden;
|
|
Packit |
6c4009 |
/* The __kind argument to __gen_tempname may be one of: */
|
|
Packit |
6c4009 |
# define __GT_FILE 0 /* create a file */
|
|
Packit |
6c4009 |
# define __GT_DIR 1 /* create a directory */
|
|
Packit |
6c4009 |
# define __GT_NOCREATE 2 /* just find a name not currently in use */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
enum __libc_message_action
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
do_message = 0, /* Print message. */
|
|
Packit |
6c4009 |
do_abort = 1 << 0, /* Abort. */
|
|
Packit |
6c4009 |
do_backtrace = 1 << 1 /* Backtrace. */
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
|
|
Packit Bot |
f19450 |
/* Print out MESSAGE (which should end with a newline) on the error output
|
|
Packit Bot |
f19450 |
and abort. */
|
|
Packit |
6c4009 |
extern void __libc_fatal (const char *__message)
|
|
Packit |
6c4009 |
__attribute__ ((__noreturn__));
|
|
Packit |
6c4009 |
extern void __libc_message (enum __libc_message_action action,
|
|
Packit |
6c4009 |
const char *__fnt, ...) attribute_hidden;
|
|
Packit |
6c4009 |
extern void __fortify_fail (const char *msg) __attribute__ ((__noreturn__));
|
|
Packit |
6c4009 |
extern void __fortify_fail_abort (_Bool, const char *msg)
|
|
Packit |
6c4009 |
__attribute__ ((__noreturn__)) attribute_hidden;
|
|
Packit |
6c4009 |
libc_hidden_proto (__fortify_fail)
|
|
Packit |
6c4009 |
libc_hidden_proto (__fortify_fail_abort)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Acquire ownership of STREAM. */
|
|
Packit |
6c4009 |
extern void __flockfile (FILE *__stream) attribute_hidden;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Relinquish the ownership granted for STREAM. */
|
|
Packit |
6c4009 |
extern void __funlockfile (FILE *__stream) attribute_hidden;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Try to acquire ownership of STREAM but do not block if it is not
|
|
Packit |
6c4009 |
possible. */
|
|
Packit |
6c4009 |
extern int __ftrylockfile (FILE *__stream);
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
extern int __getc_unlocked (FILE *__fp) attribute_hidden;
|
|
Packit |
6c4009 |
extern wint_t __getwc_unlocked (FILE *__fp);
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
extern int __fxprintf (FILE *__fp, const char *__fmt, ...)
|
|
Packit |
6c4009 |
__attribute__ ((__format__ (__printf__, 2, 3))) attribute_hidden;
|
|
Packit |
6c4009 |
extern int __fxprintf_nocancel (FILE *__fp, const char *__fmt, ...)
|
|
Packit |
6c4009 |
__attribute__ ((__format__ (__printf__, 2, 3))) attribute_hidden;
|
|
Packit |
6c4009 |
|
|
Packit Bot |
0c2104 |
/* Read the next line from FP into BUFFER, of LENGTH bytes. LINE will
|
|
Packit Bot |
0c2104 |
include the line terminator and a NUL terminator. On success,
|
|
Packit Bot |
0c2104 |
return the length of the line, including the line terminator, but
|
|
Packit Bot |
0c2104 |
excluding the NUL termintor. On EOF, return zero and write a NUL
|
|
Packit Bot |
0c2104 |
terminator. On error, return -1 and set errno. If the total byte
|
|
Packit Bot |
0c2104 |
count (line and both terminators) exceeds LENGTH, return -1 and set
|
|
Packit Bot |
0c2104 |
errno to ERANGE (but do not mark the stream as failed).
|
|
Packit Bot |
0c2104 |
|
|
Packit Bot |
0c2104 |
The behavior is undefined if FP is not seekable, or if the stream
|
|
Packit Bot |
0c2104 |
is already in an error state. */
|
|
Packit Bot |
0c2104 |
ssize_t __libc_readline_unlocked (FILE *fp, char *buffer, size_t length);
|
|
Packit Bot |
0c2104 |
libc_hidden_proto (__libc_readline_unlocked);
|
|
Packit Bot |
0c2104 |
|
|
Packit |
6c4009 |
extern const char *const _sys_errlist_internal[] attribute_hidden;
|
|
Packit |
6c4009 |
extern int _sys_nerr_internal attribute_hidden;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
libc_hidden_proto (__asprintf)
|
|
Packit |
6c4009 |
# if IS_IN (libc)
|
|
Packit |
6c4009 |
extern FILE *_IO_new_fopen (const char*, const char*);
|
|
Packit |
6c4009 |
# define fopen(fname, mode) _IO_new_fopen (fname, mode)
|
|
Packit |
6c4009 |
extern FILE *_IO_new_fdopen (int, const char*);
|
|
Packit |
6c4009 |
# define fdopen(fd, mode) _IO_new_fdopen (fd, mode)
|
|
Packit |
6c4009 |
extern int _IO_new_fclose (FILE*);
|
|
Packit |
6c4009 |
# define fclose(fp) _IO_new_fclose (fp)
|
|
Packit |
6c4009 |
extern int _IO_fputs (const char*, FILE*);
|
|
Packit |
6c4009 |
libc_hidden_proto (_IO_fputs)
|
|
Packit |
6c4009 |
/* The compiler may optimize calls to fprintf into calls to fputs.
|
|
Packit |
6c4009 |
Use libc_hidden_proto to ensure that those calls, not redirected by
|
|
Packit |
6c4009 |
the fputs macro, also do not go through the PLT. */
|
|
Packit |
6c4009 |
libc_hidden_proto (fputs)
|
|
Packit |
6c4009 |
# define fputs(str, fp) _IO_fputs (str, fp)
|
|
Packit |
6c4009 |
extern int _IO_new_fsetpos (FILE *, const __fpos_t *);
|
|
Packit |
6c4009 |
# define fsetpos(fp, posp) _IO_new_fsetpos (fp, posp)
|
|
Packit |
6c4009 |
extern int _IO_new_fgetpos (FILE *, __fpos_t *);
|
|
Packit |
6c4009 |
# define fgetpos(fp, posp) _IO_new_fgetpos (fp, posp)
|
|
Packit |
6c4009 |
# endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
libc_hidden_proto (dprintf)
|
|
Packit |
6c4009 |
extern __typeof (dprintf) __dprintf
|
|
Packit |
6c4009 |
__attribute__ ((__format__ (__printf__, 2, 3)));
|
|
Packit |
6c4009 |
libc_hidden_proto (__dprintf)
|
|
Packit |
6c4009 |
libc_hidden_proto (fprintf)
|
|
Packit |
6c4009 |
libc_hidden_proto (vfprintf)
|
|
Packit |
6c4009 |
libc_hidden_proto (sprintf)
|
|
Packit |
6c4009 |
libc_hidden_proto (sscanf)
|
|
Packit |
6c4009 |
libc_hidden_proto (fwrite)
|
|
Packit |
6c4009 |
libc_hidden_proto (perror)
|
|
Packit |
6c4009 |
libc_hidden_proto (remove)
|
|
Packit |
6c4009 |
libc_hidden_proto (rewind)
|
|
Packit |
6c4009 |
libc_hidden_proto (fileno)
|
|
Packit |
6c4009 |
extern __typeof (fileno) __fileno;
|
|
Packit |
6c4009 |
libc_hidden_proto (__fileno)
|
|
Packit |
6c4009 |
libc_hidden_proto (fwrite)
|
|
Packit |
6c4009 |
libc_hidden_proto (fseek)
|
|
Packit |
6c4009 |
extern __typeof (ftello) __ftello;
|
|
Packit |
6c4009 |
libc_hidden_proto (__ftello)
|
|
Packit |
6c4009 |
extern __typeof (fseeko64) __fseeko64;
|
|
Packit |
6c4009 |
libc_hidden_proto (__fseeko64)
|
|
Packit |
6c4009 |
extern __typeof (ftello64) __ftello64;
|
|
Packit |
6c4009 |
libc_hidden_proto (__ftello64)
|
|
Packit |
6c4009 |
libc_hidden_proto (fflush)
|
|
Packit |
6c4009 |
libc_hidden_proto (fflush_unlocked)
|
|
Packit |
6c4009 |
extern __typeof (fflush_unlocked) __fflush_unlocked;
|
|
Packit |
6c4009 |
libc_hidden_proto (__fflush_unlocked)
|
|
Packit |
6c4009 |
extern __typeof (fread_unlocked) __fread_unlocked;
|
|
Packit |
6c4009 |
libc_hidden_proto (__fread_unlocked)
|
|
Packit |
6c4009 |
libc_hidden_proto (fwrite_unlocked)
|
|
Packit |
6c4009 |
libc_hidden_proto (fgets_unlocked)
|
|
Packit |
6c4009 |
extern __typeof (fgets_unlocked) __fgets_unlocked;
|
|
Packit |
6c4009 |
libc_hidden_proto (__fgets_unlocked)
|
|
Packit |
6c4009 |
libc_hidden_proto (fputs_unlocked)
|
|
Packit |
6c4009 |
extern __typeof (fputs_unlocked) __fputs_unlocked;
|
|
Packit |
6c4009 |
libc_hidden_proto (__fputs_unlocked)
|
|
Packit |
6c4009 |
libc_hidden_proto (feof_unlocked)
|
|
Packit |
6c4009 |
extern __typeof (feof_unlocked) __feof_unlocked attribute_hidden;
|
|
Packit |
6c4009 |
libc_hidden_proto (ferror_unlocked)
|
|
Packit |
6c4009 |
extern __typeof (ferror_unlocked) __ferror_unlocked attribute_hidden;
|
|
Packit |
6c4009 |
libc_hidden_proto (getc_unlocked)
|
|
Packit |
6c4009 |
libc_hidden_proto (fputc_unlocked)
|
|
Packit |
6c4009 |
libc_hidden_proto (putc_unlocked)
|
|
Packit |
6c4009 |
extern __typeof (putc_unlocked) __putc_unlocked attribute_hidden;
|
|
Packit |
6c4009 |
libc_hidden_proto (fmemopen)
|
|
Packit |
6c4009 |
/* The prototype needs repeating instead of using __typeof to use
|
|
Packit |
6c4009 |
__THROW in C++ tests. */
|
|
Packit |
6c4009 |
extern FILE *__open_memstream (char **, size_t *) __THROW __wur;
|
|
Packit |
6c4009 |
libc_hidden_proto (__open_memstream)
|
|
Packit |
6c4009 |
libc_hidden_proto (__libc_fatal)
|
|
Packit |
6c4009 |
rtld_hidden_proto (__libc_fatal)
|
|
Packit |
6c4009 |
libc_hidden_proto (__vsprintf_chk)
|
|
Packit |
6c4009 |
libc_hidden_proto (__vsnprintf_chk)
|
|
Packit |
6c4009 |
libc_hidden_proto (__vfprintf_chk)
|
|
Packit |
6c4009 |
libc_hidden_proto (__vasprintf_chk)
|
|
Packit |
6c4009 |
libc_hidden_proto (__vdprintf_chk)
|
|
Packit |
6c4009 |
libc_hidden_proto (__obstack_vprintf_chk)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
extern FILE * __fmemopen (void *buf, size_t len, const char *mode);
|
|
Packit |
6c4009 |
libc_hidden_proto (__fmemopen)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
extern int __gen_tempfd (int flags);
|
|
Packit |
6c4009 |
libc_hidden_proto (__gen_tempfd)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# ifdef __USE_EXTERN_INLINES
|
|
Packit |
6c4009 |
__extern_inline int
|
|
Packit |
6c4009 |
__NTH (__feof_unlocked (FILE *__stream))
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
return __feof_unlocked_body (__stream);
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
__extern_inline int
|
|
Packit |
6c4009 |
__NTH (__ferror_unlocked (FILE *__stream))
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
return __ferror_unlocked_body (__stream);
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
__extern_inline int
|
|
Packit |
6c4009 |
__getc_unlocked (FILE *__fp)
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
return __getc_unlocked_body (__fp);
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
__extern_inline int
|
|
Packit |
6c4009 |
__putc_unlocked (int __c, FILE *__stream)
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
return __putc_unlocked_body (__c, __stream);
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
# endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
extern __typeof (renameat) __renameat;
|
|
Packit |
6c4009 |
libc_hidden_proto (__renameat)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
# endif /* not _ISOMAC */
|
|
Packit |
6c4009 |
#endif /* stdio.h */
|