1/* Checking macros for stdio functions. Declarations only.
2 Copyright (C) 2004-2022 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
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.
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
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
18
19#ifndef _BITS_STDIO2_DEC_H
20#define _BITS_STDIO2_DEC_H 1
21
22#ifndef _STDIO_H
23# error "Never include <bits/stdio2-decl.h> directly; use <stdio.h> instead."
24#endif
25
26extern int __sprintf_chk (char *__restrict __s, int __flag, size_t __slen,
27 const char *__restrict __format, ...) __THROW
28 __attr_access ((__write_only__, 1, 3));
29extern int __vsprintf_chk (char *__restrict __s, int __flag, size_t __slen,
30 const char *__restrict __format,
31 __gnuc_va_list __ap) __THROW
32 __attr_access ((__write_only__, 1, 3));
33
34#if defined __USE_ISOC99 || defined __USE_UNIX98
35
36extern int __snprintf_chk (char *__restrict __s, size_t __n, int __flag,
37 size_t __slen, const char *__restrict __format,
38 ...) __THROW
39 __attr_access ((__write_only__, 1, 2));
40extern int __vsnprintf_chk (char *__restrict __s, size_t __n, int __flag,
41 size_t __slen, const char *__restrict __format,
42 __gnuc_va_list __ap) __THROW
43 __attr_access ((__write_only__, 1, 2));
44
45#endif
46
47#if __USE_FORTIFY_LEVEL > 1
48
49extern int __fprintf_chk (FILE *__restrict __stream, int __flag,
50 const char *__restrict __format, ...);
51extern int __printf_chk (int __flag, const char *__restrict __format, ...);
52extern int __vfprintf_chk (FILE *__restrict __stream, int __flag,
53 const char *__restrict __format, __gnuc_va_list __ap);
54extern int __vprintf_chk (int __flag, const char *__restrict __format,
55 __gnuc_va_list __ap);
56
57# ifdef __USE_XOPEN2K8
58extern int __dprintf_chk (int __fd, int __flag, const char *__restrict __fmt,
59 ...) __attribute__ ((__format__ (__printf__, 3, 4)));
60extern int __vdprintf_chk (int __fd, int __flag,
61 const char *__restrict __fmt, __gnuc_va_list __arg)
62 __attribute__ ((__format__ (__printf__, 3, 0)));
63# endif
64
65# ifdef __USE_GNU
66
67extern int __asprintf_chk (char **__restrict __ptr, int __flag,
68 const char *__restrict __fmt, ...)
69 __THROW __attribute__ ((__format__ (__printf__, 3, 4))) __wur;
70extern int __vasprintf_chk (char **__restrict __ptr, int __flag,
71 const char *__restrict __fmt, __gnuc_va_list __arg)
72 __THROW __attribute__ ((__format__ (__printf__, 3, 0))) __wur;
73extern int __obstack_printf_chk (struct obstack *__restrict __obstack,
74 int __flag, const char *__restrict __format,
75 ...)
76 __THROW __attribute__ ((__format__ (__printf__, 3, 4)));
77extern int __obstack_vprintf_chk (struct obstack *__restrict __obstack,
78 int __flag,
79 const char *__restrict __format,
80 __gnuc_va_list __args)
81 __THROW __attribute__ ((__format__ (__printf__, 3, 0)));
82
83# endif
84#endif
85
86#if __GLIBC_USE (DEPRECATED_GETS)
87extern char *__gets_chk (char *__str, size_t) __wur;
88#endif
89
90extern char *__fgets_chk (char *__restrict __s, size_t __size, int __n,
91 FILE *__restrict __stream)
92 __wur __attr_access ((__write_only__, 1, 3));
93
94extern size_t __fread_chk (void *__restrict __ptr, size_t __ptrlen,
95 size_t __size, size_t __n,
96 FILE *__restrict __stream) __wur;
97
98#ifdef __USE_GNU
99extern char *__fgets_unlocked_chk (char *__restrict __s, size_t __size,
100 int __n, FILE *__restrict __stream)
101 __wur __attr_access ((__write_only__, 1, 3));
102#endif
103
104#ifdef __USE_MISC
105# undef fread_unlocked
106extern size_t __fread_unlocked_chk (void *__restrict __ptr, size_t __ptrlen,
107 size_t __size, size_t __n,
108 FILE *__restrict __stream) __wur;
109#endif
110
111#endif /* bits/stdio2-decl.h. */
112

source code of glibc/libio/bits/stdio2-decl.h