Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/bits
File: stdio2.h
/* Checking macros for stdio functions.
[0] Fix | Delete
Copyright (C) 2004-2018 Free Software Foundation, Inc.
[1] Fix | Delete
This file is part of the GNU C Library.
[2] Fix | Delete
[3] Fix | Delete
The GNU C Library is free software; you can redistribute it and/or
[4] Fix | Delete
modify it under the terms of the GNU Lesser General Public
[5] Fix | Delete
License as published by the Free Software Foundation; either
[6] Fix | Delete
version 2.1 of the License, or (at your option) any later version.
[7] Fix | Delete
[8] Fix | Delete
The GNU C Library is distributed in the hope that it will be useful,
[9] Fix | Delete
but WITHOUT ANY WARRANTY; without even the implied warranty of
[10] Fix | Delete
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
[11] Fix | Delete
Lesser General Public License for more details.
[12] Fix | Delete
[13] Fix | Delete
You should have received a copy of the GNU Lesser General Public
[14] Fix | Delete
License along with the GNU C Library; if not, see
[15] Fix | Delete
<http://www.gnu.org/licenses/>. */
[16] Fix | Delete
[17] Fix | Delete
#ifndef _BITS_STDIO2_H
[18] Fix | Delete
#define _BITS_STDIO2_H 1
[19] Fix | Delete
[20] Fix | Delete
#ifndef _STDIO_H
[21] Fix | Delete
# error "Never include <bits/stdio2.h> directly; use <stdio.h> instead."
[22] Fix | Delete
#endif
[23] Fix | Delete
[24] Fix | Delete
extern int __sprintf_chk (char *__restrict __s, int __flag, size_t __slen,
[25] Fix | Delete
const char *__restrict __format, ...) __THROW;
[26] Fix | Delete
extern int __vsprintf_chk (char *__restrict __s, int __flag, size_t __slen,
[27] Fix | Delete
const char *__restrict __format,
[28] Fix | Delete
__gnuc_va_list __ap) __THROW;
[29] Fix | Delete
[30] Fix | Delete
#ifdef __va_arg_pack
[31] Fix | Delete
__fortify_function int
[32] Fix | Delete
__NTH (sprintf (char *__restrict __s, const char *__restrict __fmt, ...))
[33] Fix | Delete
{
[34] Fix | Delete
return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
[35] Fix | Delete
__glibc_objsize (__s), __fmt,
[36] Fix | Delete
__va_arg_pack ());
[37] Fix | Delete
}
[38] Fix | Delete
#elif !defined __cplusplus
[39] Fix | Delete
# define sprintf(str, ...) \
[40] Fix | Delete
__builtin___sprintf_chk (str, __USE_FORTIFY_LEVEL - 1, \
[41] Fix | Delete
__glibc_objsize (str), __VA_ARGS__)
[42] Fix | Delete
#endif
[43] Fix | Delete
[44] Fix | Delete
__fortify_function int
[45] Fix | Delete
__NTH (vsprintf (char *__restrict __s, const char *__restrict __fmt,
[46] Fix | Delete
__gnuc_va_list __ap))
[47] Fix | Delete
{
[48] Fix | Delete
return __builtin___vsprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
[49] Fix | Delete
__glibc_objsize (__s), __fmt, __ap);
[50] Fix | Delete
}
[51] Fix | Delete
[52] Fix | Delete
#if defined __USE_ISOC99 || defined __USE_UNIX98
[53] Fix | Delete
[54] Fix | Delete
extern int __snprintf_chk (char *__restrict __s, size_t __n, int __flag,
[55] Fix | Delete
size_t __slen, const char *__restrict __format,
[56] Fix | Delete
...) __THROW;
[57] Fix | Delete
extern int __vsnprintf_chk (char *__restrict __s, size_t __n, int __flag,
[58] Fix | Delete
size_t __slen, const char *__restrict __format,
[59] Fix | Delete
__gnuc_va_list __ap) __THROW;
[60] Fix | Delete
[61] Fix | Delete
# ifdef __va_arg_pack
[62] Fix | Delete
__fortify_function int
[63] Fix | Delete
__NTH (snprintf (char *__restrict __s, size_t __n,
[64] Fix | Delete
const char *__restrict __fmt, ...))
[65] Fix | Delete
{
[66] Fix | Delete
return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
[67] Fix | Delete
__glibc_objsize (__s), __fmt,
[68] Fix | Delete
__va_arg_pack ());
[69] Fix | Delete
}
[70] Fix | Delete
# elif !defined __cplusplus
[71] Fix | Delete
# define snprintf(str, len, ...) \
[72] Fix | Delete
__builtin___snprintf_chk (str, len, __USE_FORTIFY_LEVEL - 1, \
[73] Fix | Delete
__glibc_objsize (str), __VA_ARGS__)
[74] Fix | Delete
# endif
[75] Fix | Delete
[76] Fix | Delete
__fortify_function int
[77] Fix | Delete
__NTH (vsnprintf (char *__restrict __s, size_t __n,
[78] Fix | Delete
const char *__restrict __fmt, __gnuc_va_list __ap))
[79] Fix | Delete
{
[80] Fix | Delete
return __builtin___vsnprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
[81] Fix | Delete
__glibc_objsize (__s), __fmt, __ap);
[82] Fix | Delete
}
[83] Fix | Delete
[84] Fix | Delete
#endif
[85] Fix | Delete
[86] Fix | Delete
#if __USE_FORTIFY_LEVEL > 1
[87] Fix | Delete
[88] Fix | Delete
extern int __fprintf_chk (FILE *__restrict __stream, int __flag,
[89] Fix | Delete
const char *__restrict __format, ...);
[90] Fix | Delete
extern int __printf_chk (int __flag, const char *__restrict __format, ...);
[91] Fix | Delete
extern int __vfprintf_chk (FILE *__restrict __stream, int __flag,
[92] Fix | Delete
const char *__restrict __format, __gnuc_va_list __ap);
[93] Fix | Delete
extern int __vprintf_chk (int __flag, const char *__restrict __format,
[94] Fix | Delete
__gnuc_va_list __ap);
[95] Fix | Delete
[96] Fix | Delete
# ifdef __va_arg_pack
[97] Fix | Delete
__fortify_function int
[98] Fix | Delete
fprintf (FILE *__restrict __stream, const char *__restrict __fmt, ...)
[99] Fix | Delete
{
[100] Fix | Delete
return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
[101] Fix | Delete
__va_arg_pack ());
[102] Fix | Delete
}
[103] Fix | Delete
[104] Fix | Delete
__fortify_function int
[105] Fix | Delete
printf (const char *__restrict __fmt, ...)
[106] Fix | Delete
{
[107] Fix | Delete
return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
[108] Fix | Delete
}
[109] Fix | Delete
# elif !defined __cplusplus
[110] Fix | Delete
# define printf(...) \
[111] Fix | Delete
__printf_chk (__USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
[112] Fix | Delete
# define fprintf(stream, ...) \
[113] Fix | Delete
__fprintf_chk (stream, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
[114] Fix | Delete
# endif
[115] Fix | Delete
[116] Fix | Delete
__fortify_function int
[117] Fix | Delete
vprintf (const char *__restrict __fmt, __gnuc_va_list __ap)
[118] Fix | Delete
{
[119] Fix | Delete
#ifdef __USE_EXTERN_INLINES
[120] Fix | Delete
return __vfprintf_chk (stdout, __USE_FORTIFY_LEVEL - 1, __fmt, __ap);
[121] Fix | Delete
#else
[122] Fix | Delete
return __vprintf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __ap);
[123] Fix | Delete
#endif
[124] Fix | Delete
}
[125] Fix | Delete
[126] Fix | Delete
__fortify_function int
[127] Fix | Delete
vfprintf (FILE *__restrict __stream,
[128] Fix | Delete
const char *__restrict __fmt, __gnuc_va_list __ap)
[129] Fix | Delete
{
[130] Fix | Delete
return __vfprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt, __ap);
[131] Fix | Delete
}
[132] Fix | Delete
[133] Fix | Delete
# ifdef __USE_XOPEN2K8
[134] Fix | Delete
extern int __dprintf_chk (int __fd, int __flag, const char *__restrict __fmt,
[135] Fix | Delete
...) __attribute__ ((__format__ (__printf__, 3, 4)));
[136] Fix | Delete
extern int __vdprintf_chk (int __fd, int __flag,
[137] Fix | Delete
const char *__restrict __fmt, __gnuc_va_list __arg)
[138] Fix | Delete
__attribute__ ((__format__ (__printf__, 3, 0)));
[139] Fix | Delete
[140] Fix | Delete
# ifdef __va_arg_pack
[141] Fix | Delete
__fortify_function int
[142] Fix | Delete
dprintf (int __fd, const char *__restrict __fmt, ...)
[143] Fix | Delete
{
[144] Fix | Delete
return __dprintf_chk (__fd, __USE_FORTIFY_LEVEL - 1, __fmt,
[145] Fix | Delete
__va_arg_pack ());
[146] Fix | Delete
}
[147] Fix | Delete
# elif !defined __cplusplus
[148] Fix | Delete
# define dprintf(fd, ...) \
[149] Fix | Delete
__dprintf_chk (fd, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
[150] Fix | Delete
# endif
[151] Fix | Delete
[152] Fix | Delete
__fortify_function int
[153] Fix | Delete
vdprintf (int __fd, const char *__restrict __fmt, __gnuc_va_list __ap)
[154] Fix | Delete
{
[155] Fix | Delete
return __vdprintf_chk (__fd, __USE_FORTIFY_LEVEL - 1, __fmt, __ap);
[156] Fix | Delete
}
[157] Fix | Delete
# endif
[158] Fix | Delete
[159] Fix | Delete
# ifdef __USE_GNU
[160] Fix | Delete
[161] Fix | Delete
extern int __asprintf_chk (char **__restrict __ptr, int __flag,
[162] Fix | Delete
const char *__restrict __fmt, ...)
[163] Fix | Delete
__THROW __attribute__ ((__format__ (__printf__, 3, 4))) __wur;
[164] Fix | Delete
extern int __vasprintf_chk (char **__restrict __ptr, int __flag,
[165] Fix | Delete
const char *__restrict __fmt, __gnuc_va_list __arg)
[166] Fix | Delete
__THROW __attribute__ ((__format__ (__printf__, 3, 0))) __wur;
[167] Fix | Delete
extern int __obstack_printf_chk (struct obstack *__restrict __obstack,
[168] Fix | Delete
int __flag, const char *__restrict __format,
[169] Fix | Delete
...)
[170] Fix | Delete
__THROW __attribute__ ((__format__ (__printf__, 3, 4)));
[171] Fix | Delete
extern int __obstack_vprintf_chk (struct obstack *__restrict __obstack,
[172] Fix | Delete
int __flag,
[173] Fix | Delete
const char *__restrict __format,
[174] Fix | Delete
__gnuc_va_list __args)
[175] Fix | Delete
__THROW __attribute__ ((__format__ (__printf__, 3, 0)));
[176] Fix | Delete
[177] Fix | Delete
# ifdef __va_arg_pack
[178] Fix | Delete
__fortify_function int
[179] Fix | Delete
__NTH (asprintf (char **__restrict __ptr, const char *__restrict __fmt, ...))
[180] Fix | Delete
{
[181] Fix | Delete
return __asprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt,
[182] Fix | Delete
__va_arg_pack ());
[183] Fix | Delete
}
[184] Fix | Delete
[185] Fix | Delete
__fortify_function int
[186] Fix | Delete
__NTH (__asprintf (char **__restrict __ptr, const char *__restrict __fmt,
[187] Fix | Delete
...))
[188] Fix | Delete
{
[189] Fix | Delete
return __asprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt,
[190] Fix | Delete
__va_arg_pack ());
[191] Fix | Delete
}
[192] Fix | Delete
[193] Fix | Delete
__fortify_function int
[194] Fix | Delete
__NTH (obstack_printf (struct obstack *__restrict __obstack,
[195] Fix | Delete
const char *__restrict __fmt, ...))
[196] Fix | Delete
{
[197] Fix | Delete
return __obstack_printf_chk (__obstack, __USE_FORTIFY_LEVEL - 1, __fmt,
[198] Fix | Delete
__va_arg_pack ());
[199] Fix | Delete
}
[200] Fix | Delete
# elif !defined __cplusplus
[201] Fix | Delete
# define asprintf(ptr, ...) \
[202] Fix | Delete
__asprintf_chk (ptr, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
[203] Fix | Delete
# define __asprintf(ptr, ...) \
[204] Fix | Delete
__asprintf_chk (ptr, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
[205] Fix | Delete
# define obstack_printf(obstack, ...) \
[206] Fix | Delete
__obstack_printf_chk (obstack, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
[207] Fix | Delete
# endif
[208] Fix | Delete
[209] Fix | Delete
__fortify_function int
[210] Fix | Delete
__NTH (vasprintf (char **__restrict __ptr, const char *__restrict __fmt,
[211] Fix | Delete
__gnuc_va_list __ap))
[212] Fix | Delete
{
[213] Fix | Delete
return __vasprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt, __ap);
[214] Fix | Delete
}
[215] Fix | Delete
[216] Fix | Delete
__fortify_function int
[217] Fix | Delete
__NTH (obstack_vprintf (struct obstack *__restrict __obstack,
[218] Fix | Delete
const char *__restrict __fmt, __gnuc_va_list __ap))
[219] Fix | Delete
{
[220] Fix | Delete
return __obstack_vprintf_chk (__obstack, __USE_FORTIFY_LEVEL - 1, __fmt,
[221] Fix | Delete
__ap);
[222] Fix | Delete
}
[223] Fix | Delete
[224] Fix | Delete
# endif
[225] Fix | Delete
[226] Fix | Delete
#endif
[227] Fix | Delete
[228] Fix | Delete
#if __GLIBC_USE (DEPRECATED_GETS)
[229] Fix | Delete
extern char *__gets_chk (char *__str, size_t) __wur;
[230] Fix | Delete
extern char *__REDIRECT (__gets_warn, (char *__str), gets)
[231] Fix | Delete
__wur __warnattr ("please use fgets or getline instead, gets can't "
[232] Fix | Delete
"specify buffer size");
[233] Fix | Delete
[234] Fix | Delete
__fortify_function __wur char *
[235] Fix | Delete
gets (char *__str)
[236] Fix | Delete
{
[237] Fix | Delete
if (__glibc_objsize (__str) != (size_t) -1)
[238] Fix | Delete
return __gets_chk (__str, __glibc_objsize (__str));
[239] Fix | Delete
return __gets_warn (__str);
[240] Fix | Delete
}
[241] Fix | Delete
#endif
[242] Fix | Delete
[243] Fix | Delete
extern char *__fgets_chk (char *__restrict __s, size_t __size, int __n,
[244] Fix | Delete
FILE *__restrict __stream) __wur;
[245] Fix | Delete
extern char *__REDIRECT (__fgets_alias,
[246] Fix | Delete
(char *__restrict __s, int __n,
[247] Fix | Delete
FILE *__restrict __stream), fgets) __wur;
[248] Fix | Delete
extern char *__REDIRECT (__fgets_chk_warn,
[249] Fix | Delete
(char *__restrict __s, size_t __size, int __n,
[250] Fix | Delete
FILE *__restrict __stream), __fgets_chk)
[251] Fix | Delete
__wur __warnattr ("fgets called with bigger size than length "
[252] Fix | Delete
"of destination buffer");
[253] Fix | Delete
[254] Fix | Delete
__fortify_function __wur char *
[255] Fix | Delete
fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
[256] Fix | Delete
{
[257] Fix | Delete
size_t sz = __glibc_objsize (__s);
[258] Fix | Delete
if (__glibc_safe_or_unknown_len (__n, sizeof (char), sz))
[259] Fix | Delete
return __fgets_alias (__s, __n, __stream);
[260] Fix | Delete
if (__glibc_unsafe_len (__n, sizeof (char), sz))
[261] Fix | Delete
return __fgets_chk_warn (__s, sz, __n, __stream);
[262] Fix | Delete
return __fgets_chk (__s, sz, __n, __stream);
[263] Fix | Delete
}
[264] Fix | Delete
[265] Fix | Delete
extern size_t __fread_chk (void *__restrict __ptr, size_t __ptrlen,
[266] Fix | Delete
size_t __size, size_t __n,
[267] Fix | Delete
FILE *__restrict __stream) __wur;
[268] Fix | Delete
extern size_t __REDIRECT (__fread_alias,
[269] Fix | Delete
(void *__restrict __ptr, size_t __size,
[270] Fix | Delete
size_t __n, FILE *__restrict __stream),
[271] Fix | Delete
fread) __wur;
[272] Fix | Delete
extern size_t __REDIRECT (__fread_chk_warn,
[273] Fix | Delete
(void *__restrict __ptr, size_t __ptrlen,
[274] Fix | Delete
size_t __size, size_t __n,
[275] Fix | Delete
FILE *__restrict __stream),
[276] Fix | Delete
__fread_chk)
[277] Fix | Delete
__wur __warnattr ("fread called with bigger size * nmemb than length "
[278] Fix | Delete
"of destination buffer");
[279] Fix | Delete
[280] Fix | Delete
__fortify_function __wur size_t
[281] Fix | Delete
fread (void *__restrict __ptr, size_t __size, size_t __n,
[282] Fix | Delete
FILE *__restrict __stream)
[283] Fix | Delete
{
[284] Fix | Delete
size_t sz = __glibc_objsize0 (__ptr);
[285] Fix | Delete
if (__glibc_safe_or_unknown_len (__n, __size, sz))
[286] Fix | Delete
return __fread_alias (__ptr, __size, __n, __stream);
[287] Fix | Delete
if (__glibc_unsafe_len (__n, __size, sz))
[288] Fix | Delete
return __fread_chk_warn (__ptr, sz, __size, __n, __stream);
[289] Fix | Delete
return __fread_chk (__ptr, sz, __size, __n, __stream);
[290] Fix | Delete
}
[291] Fix | Delete
[292] Fix | Delete
#ifdef __USE_GNU
[293] Fix | Delete
extern char *__fgets_unlocked_chk (char *__restrict __s, size_t __size,
[294] Fix | Delete
int __n, FILE *__restrict __stream) __wur;
[295] Fix | Delete
extern char *__REDIRECT (__fgets_unlocked_alias,
[296] Fix | Delete
(char *__restrict __s, int __n,
[297] Fix | Delete
FILE *__restrict __stream), fgets_unlocked) __wur;
[298] Fix | Delete
extern char *__REDIRECT (__fgets_unlocked_chk_warn,
[299] Fix | Delete
(char *__restrict __s, size_t __size, int __n,
[300] Fix | Delete
FILE *__restrict __stream), __fgets_unlocked_chk)
[301] Fix | Delete
__wur __warnattr ("fgets_unlocked called with bigger size than length "
[302] Fix | Delete
"of destination buffer");
[303] Fix | Delete
[304] Fix | Delete
__fortify_function __wur char *
[305] Fix | Delete
fgets_unlocked (char *__restrict __s, int __n, FILE *__restrict __stream)
[306] Fix | Delete
{
[307] Fix | Delete
size_t sz = __glibc_objsize (__s);
[308] Fix | Delete
if (__glibc_safe_or_unknown_len (__n, sizeof (char), sz))
[309] Fix | Delete
return __fgets_unlocked_alias (__s, __n, __stream);
[310] Fix | Delete
if (__glibc_unsafe_len (__n, sizeof (char), sz))
[311] Fix | Delete
return __fgets_unlocked_chk_warn (__s, sz, __n, __stream);
[312] Fix | Delete
return __fgets_unlocked_chk (__s, sz, __n, __stream);
[313] Fix | Delete
}
[314] Fix | Delete
#endif
[315] Fix | Delete
[316] Fix | Delete
#ifdef __USE_MISC
[317] Fix | Delete
# undef fread_unlocked
[318] Fix | Delete
extern size_t __fread_unlocked_chk (void *__restrict __ptr, size_t __ptrlen,
[319] Fix | Delete
size_t __size, size_t __n,
[320] Fix | Delete
FILE *__restrict __stream) __wur;
[321] Fix | Delete
extern size_t __REDIRECT (__fread_unlocked_alias,
[322] Fix | Delete
(void *__restrict __ptr, size_t __size,
[323] Fix | Delete
size_t __n, FILE *__restrict __stream),
[324] Fix | Delete
fread_unlocked) __wur;
[325] Fix | Delete
extern size_t __REDIRECT (__fread_unlocked_chk_warn,
[326] Fix | Delete
(void *__restrict __ptr, size_t __ptrlen,
[327] Fix | Delete
size_t __size, size_t __n,
[328] Fix | Delete
FILE *__restrict __stream),
[329] Fix | Delete
__fread_unlocked_chk)
[330] Fix | Delete
__wur __warnattr ("fread_unlocked called with bigger size * nmemb than "
[331] Fix | Delete
"length of destination buffer");
[332] Fix | Delete
[333] Fix | Delete
__fortify_function __wur size_t
[334] Fix | Delete
fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n,
[335] Fix | Delete
FILE *__restrict __stream)
[336] Fix | Delete
{
[337] Fix | Delete
size_t sz = __glibc_objsize0 (__ptr);
[338] Fix | Delete
if (__glibc_safe_or_unknown_len (__n, __size, sz))
[339] Fix | Delete
{
[340] Fix | Delete
# ifdef __USE_EXTERN_INLINES
[341] Fix | Delete
if (__builtin_constant_p (__size)
[342] Fix | Delete
&& __builtin_constant_p (__n)
[343] Fix | Delete
&& (__size | __n) < (((size_t) 1) << (8 * sizeof (size_t) / 2))
[344] Fix | Delete
&& __size * __n <= 8)
[345] Fix | Delete
{
[346] Fix | Delete
size_t __cnt = __size * __n;
[347] Fix | Delete
char *__cptr = (char *) __ptr;
[348] Fix | Delete
if (__cnt == 0)
[349] Fix | Delete
return 0;
[350] Fix | Delete
[351] Fix | Delete
for (; __cnt > 0; --__cnt)
[352] Fix | Delete
{
[353] Fix | Delete
int __c = getc_unlocked (__stream);
[354] Fix | Delete
if (__c == EOF)
[355] Fix | Delete
break;
[356] Fix | Delete
*__cptr++ = __c;
[357] Fix | Delete
}
[358] Fix | Delete
return (__cptr - (char *) __ptr) / __size;
[359] Fix | Delete
}
[360] Fix | Delete
# endif
[361] Fix | Delete
return __fread_unlocked_alias (__ptr, __size, __n, __stream);
[362] Fix | Delete
}
[363] Fix | Delete
if (__glibc_unsafe_len (__n, __size, sz))
[364] Fix | Delete
return __fread_unlocked_chk_warn (__ptr, sz, __size, __n, __stream);
[365] Fix | Delete
return __fread_unlocked_chk (__ptr, sz, __size, __n, __stream);
[366] Fix | Delete
[367] Fix | Delete
}
[368] Fix | Delete
#endif
[369] Fix | Delete
[370] Fix | Delete
#endif /* bits/stdio2.h. */
[371] Fix | Delete
[372] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function