Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include
File: stdlib.h
/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
[0] Fix | Delete
This file is part of the GNU C Library.
[1] Fix | Delete
[2] Fix | Delete
The GNU C Library is free software; you can redistribute it and/or
[3] Fix | Delete
modify it under the terms of the GNU Lesser General Public
[4] Fix | Delete
License as published by the Free Software Foundation; either
[5] Fix | Delete
version 2.1 of the License, or (at your option) any later version.
[6] Fix | Delete
[7] Fix | Delete
The GNU C Library is distributed in the hope that it will be useful,
[8] Fix | Delete
but WITHOUT ANY WARRANTY; without even the implied warranty of
[9] Fix | Delete
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
[10] Fix | Delete
Lesser General Public License for more details.
[11] Fix | Delete
[12] Fix | Delete
You should have received a copy of the GNU Lesser General Public
[13] Fix | Delete
License along with the GNU C Library; if not, see
[14] Fix | Delete
<http://www.gnu.org/licenses/>. */
[15] Fix | Delete
[16] Fix | Delete
/*
[17] Fix | Delete
* ISO C99 Standard: 7.20 General utilities <stdlib.h>
[18] Fix | Delete
*/
[19] Fix | Delete
[20] Fix | Delete
#ifndef _STDLIB_H
[21] Fix | Delete
[22] Fix | Delete
#define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION
[23] Fix | Delete
#include <bits/libc-header-start.h>
[24] Fix | Delete
[25] Fix | Delete
/* Get size_t, wchar_t and NULL from <stddef.h>. */
[26] Fix | Delete
#define __need_size_t
[27] Fix | Delete
#define __need_wchar_t
[28] Fix | Delete
#define __need_NULL
[29] Fix | Delete
#include <stddef.h>
[30] Fix | Delete
[31] Fix | Delete
__BEGIN_DECLS
[32] Fix | Delete
[33] Fix | Delete
#define _STDLIB_H 1
[34] Fix | Delete
[35] Fix | Delete
#if (defined __USE_XOPEN || defined __USE_XOPEN2K8) && !defined _SYS_WAIT_H
[36] Fix | Delete
/* XPG requires a few symbols from <sys/wait.h> being defined. */
[37] Fix | Delete
# include <bits/waitflags.h>
[38] Fix | Delete
# include <bits/waitstatus.h>
[39] Fix | Delete
[40] Fix | Delete
/* Define the macros <sys/wait.h> also would define this way. */
[41] Fix | Delete
# define WEXITSTATUS(status) __WEXITSTATUS (status)
[42] Fix | Delete
# define WTERMSIG(status) __WTERMSIG (status)
[43] Fix | Delete
# define WSTOPSIG(status) __WSTOPSIG (status)
[44] Fix | Delete
# define WIFEXITED(status) __WIFEXITED (status)
[45] Fix | Delete
# define WIFSIGNALED(status) __WIFSIGNALED (status)
[46] Fix | Delete
# define WIFSTOPPED(status) __WIFSTOPPED (status)
[47] Fix | Delete
# ifdef __WIFCONTINUED
[48] Fix | Delete
# define WIFCONTINUED(status) __WIFCONTINUED (status)
[49] Fix | Delete
# endif
[50] Fix | Delete
#endif /* X/Open or XPG7 and <sys/wait.h> not included. */
[51] Fix | Delete
[52] Fix | Delete
/* _FloatN API tests for enablement. */
[53] Fix | Delete
#include <bits/floatn.h>
[54] Fix | Delete
[55] Fix | Delete
/* Returned by `div'. */
[56] Fix | Delete
typedef struct
[57] Fix | Delete
{
[58] Fix | Delete
int quot; /* Quotient. */
[59] Fix | Delete
int rem; /* Remainder. */
[60] Fix | Delete
} div_t;
[61] Fix | Delete
[62] Fix | Delete
/* Returned by `ldiv'. */
[63] Fix | Delete
#ifndef __ldiv_t_defined
[64] Fix | Delete
typedef struct
[65] Fix | Delete
{
[66] Fix | Delete
long int quot; /* Quotient. */
[67] Fix | Delete
long int rem; /* Remainder. */
[68] Fix | Delete
} ldiv_t;
[69] Fix | Delete
# define __ldiv_t_defined 1
[70] Fix | Delete
#endif
[71] Fix | Delete
[72] Fix | Delete
#if defined __USE_ISOC99 && !defined __lldiv_t_defined
[73] Fix | Delete
/* Returned by `lldiv'. */
[74] Fix | Delete
__extension__ typedef struct
[75] Fix | Delete
{
[76] Fix | Delete
long long int quot; /* Quotient. */
[77] Fix | Delete
long long int rem; /* Remainder. */
[78] Fix | Delete
} lldiv_t;
[79] Fix | Delete
# define __lldiv_t_defined 1
[80] Fix | Delete
#endif
[81] Fix | Delete
[82] Fix | Delete
[83] Fix | Delete
/* The largest number rand will return (same as INT_MAX). */
[84] Fix | Delete
#define RAND_MAX 2147483647
[85] Fix | Delete
[86] Fix | Delete
[87] Fix | Delete
/* We define these the same for all machines.
[88] Fix | Delete
Changes from this to the outside world should be done in `_exit'. */
[89] Fix | Delete
#define EXIT_FAILURE 1 /* Failing exit status. */
[90] Fix | Delete
#define EXIT_SUCCESS 0 /* Successful exit status. */
[91] Fix | Delete
[92] Fix | Delete
[93] Fix | Delete
/* Maximum length of a multibyte character in the current locale. */
[94] Fix | Delete
#define MB_CUR_MAX (__ctype_get_mb_cur_max ())
[95] Fix | Delete
extern size_t __ctype_get_mb_cur_max (void) __THROW __wur;
[96] Fix | Delete
[97] Fix | Delete
[98] Fix | Delete
/* Convert a string to a floating-point number. */
[99] Fix | Delete
extern double atof (const char *__nptr)
[100] Fix | Delete
__THROW __attribute_pure__ __nonnull ((1)) __wur;
[101] Fix | Delete
/* Convert a string to an integer. */
[102] Fix | Delete
extern int atoi (const char *__nptr)
[103] Fix | Delete
__THROW __attribute_pure__ __nonnull ((1)) __wur;
[104] Fix | Delete
/* Convert a string to a long integer. */
[105] Fix | Delete
extern long int atol (const char *__nptr)
[106] Fix | Delete
__THROW __attribute_pure__ __nonnull ((1)) __wur;
[107] Fix | Delete
[108] Fix | Delete
#ifdef __USE_ISOC99
[109] Fix | Delete
/* Convert a string to a long long integer. */
[110] Fix | Delete
__extension__ extern long long int atoll (const char *__nptr)
[111] Fix | Delete
__THROW __attribute_pure__ __nonnull ((1)) __wur;
[112] Fix | Delete
#endif
[113] Fix | Delete
[114] Fix | Delete
/* Convert a string to a floating-point number. */
[115] Fix | Delete
extern double strtod (const char *__restrict __nptr,
[116] Fix | Delete
char **__restrict __endptr)
[117] Fix | Delete
__THROW __nonnull ((1));
[118] Fix | Delete
[119] Fix | Delete
#ifdef __USE_ISOC99
[120] Fix | Delete
/* Likewise for `float' and `long double' sizes of floating-point numbers. */
[121] Fix | Delete
extern float strtof (const char *__restrict __nptr,
[122] Fix | Delete
char **__restrict __endptr) __THROW __nonnull ((1));
[123] Fix | Delete
[124] Fix | Delete
extern long double strtold (const char *__restrict __nptr,
[125] Fix | Delete
char **__restrict __endptr)
[126] Fix | Delete
__THROW __nonnull ((1));
[127] Fix | Delete
#endif
[128] Fix | Delete
[129] Fix | Delete
/* Likewise for '_FloatN' and '_FloatNx'. */
[130] Fix | Delete
[131] Fix | Delete
#if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)
[132] Fix | Delete
extern _Float16 strtof16 (const char *__restrict __nptr,
[133] Fix | Delete
char **__restrict __endptr)
[134] Fix | Delete
__THROW __nonnull ((1));
[135] Fix | Delete
#endif
[136] Fix | Delete
[137] Fix | Delete
#if __HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)
[138] Fix | Delete
extern _Float32 strtof32 (const char *__restrict __nptr,
[139] Fix | Delete
char **__restrict __endptr)
[140] Fix | Delete
__THROW __nonnull ((1));
[141] Fix | Delete
#endif
[142] Fix | Delete
[143] Fix | Delete
#if __HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)
[144] Fix | Delete
extern _Float64 strtof64 (const char *__restrict __nptr,
[145] Fix | Delete
char **__restrict __endptr)
[146] Fix | Delete
__THROW __nonnull ((1));
[147] Fix | Delete
#endif
[148] Fix | Delete
[149] Fix | Delete
#if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
[150] Fix | Delete
extern _Float128 strtof128 (const char *__restrict __nptr,
[151] Fix | Delete
char **__restrict __endptr)
[152] Fix | Delete
__THROW __nonnull ((1));
[153] Fix | Delete
#endif
[154] Fix | Delete
[155] Fix | Delete
#if __HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)
[156] Fix | Delete
extern _Float32x strtof32x (const char *__restrict __nptr,
[157] Fix | Delete
char **__restrict __endptr)
[158] Fix | Delete
__THROW __nonnull ((1));
[159] Fix | Delete
#endif
[160] Fix | Delete
[161] Fix | Delete
#if __HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)
[162] Fix | Delete
extern _Float64x strtof64x (const char *__restrict __nptr,
[163] Fix | Delete
char **__restrict __endptr)
[164] Fix | Delete
__THROW __nonnull ((1));
[165] Fix | Delete
#endif
[166] Fix | Delete
[167] Fix | Delete
#if __HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)
[168] Fix | Delete
extern _Float128x strtof128x (const char *__restrict __nptr,
[169] Fix | Delete
char **__restrict __endptr)
[170] Fix | Delete
__THROW __nonnull ((1));
[171] Fix | Delete
#endif
[172] Fix | Delete
[173] Fix | Delete
/* Convert a string to a long integer. */
[174] Fix | Delete
extern long int strtol (const char *__restrict __nptr,
[175] Fix | Delete
char **__restrict __endptr, int __base)
[176] Fix | Delete
__THROW __nonnull ((1));
[177] Fix | Delete
/* Convert a string to an unsigned long integer. */
[178] Fix | Delete
extern unsigned long int strtoul (const char *__restrict __nptr,
[179] Fix | Delete
char **__restrict __endptr, int __base)
[180] Fix | Delete
__THROW __nonnull ((1));
[181] Fix | Delete
[182] Fix | Delete
#ifdef __USE_MISC
[183] Fix | Delete
/* Convert a string to a quadword integer. */
[184] Fix | Delete
__extension__
[185] Fix | Delete
extern long long int strtoq (const char *__restrict __nptr,
[186] Fix | Delete
char **__restrict __endptr, int __base)
[187] Fix | Delete
__THROW __nonnull ((1));
[188] Fix | Delete
/* Convert a string to an unsigned quadword integer. */
[189] Fix | Delete
__extension__
[190] Fix | Delete
extern unsigned long long int strtouq (const char *__restrict __nptr,
[191] Fix | Delete
char **__restrict __endptr, int __base)
[192] Fix | Delete
__THROW __nonnull ((1));
[193] Fix | Delete
#endif /* Use misc. */
[194] Fix | Delete
[195] Fix | Delete
#ifdef __USE_ISOC99
[196] Fix | Delete
/* Convert a string to a quadword integer. */
[197] Fix | Delete
__extension__
[198] Fix | Delete
extern long long int strtoll (const char *__restrict __nptr,
[199] Fix | Delete
char **__restrict __endptr, int __base)
[200] Fix | Delete
__THROW __nonnull ((1));
[201] Fix | Delete
/* Convert a string to an unsigned quadword integer. */
[202] Fix | Delete
__extension__
[203] Fix | Delete
extern unsigned long long int strtoull (const char *__restrict __nptr,
[204] Fix | Delete
char **__restrict __endptr, int __base)
[205] Fix | Delete
__THROW __nonnull ((1));
[206] Fix | Delete
#endif /* ISO C99 or use MISC. */
[207] Fix | Delete
[208] Fix | Delete
/* Convert a floating-point number to a string. */
[209] Fix | Delete
#if __GLIBC_USE (IEC_60559_BFP_EXT)
[210] Fix | Delete
extern int strfromd (char *__dest, size_t __size, const char *__format,
[211] Fix | Delete
double __f)
[212] Fix | Delete
__THROW __nonnull ((3));
[213] Fix | Delete
[214] Fix | Delete
extern int strfromf (char *__dest, size_t __size, const char *__format,
[215] Fix | Delete
float __f)
[216] Fix | Delete
__THROW __nonnull ((3));
[217] Fix | Delete
[218] Fix | Delete
extern int strfroml (char *__dest, size_t __size, const char *__format,
[219] Fix | Delete
long double __f)
[220] Fix | Delete
__THROW __nonnull ((3));
[221] Fix | Delete
#endif
[222] Fix | Delete
[223] Fix | Delete
#if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)
[224] Fix | Delete
extern int strfromf16 (char *__dest, size_t __size, const char * __format,
[225] Fix | Delete
_Float16 __f)
[226] Fix | Delete
__THROW __nonnull ((3));
[227] Fix | Delete
#endif
[228] Fix | Delete
[229] Fix | Delete
#if __HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)
[230] Fix | Delete
extern int strfromf32 (char *__dest, size_t __size, const char * __format,
[231] Fix | Delete
_Float32 __f)
[232] Fix | Delete
__THROW __nonnull ((3));
[233] Fix | Delete
#endif
[234] Fix | Delete
[235] Fix | Delete
#if __HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)
[236] Fix | Delete
extern int strfromf64 (char *__dest, size_t __size, const char * __format,
[237] Fix | Delete
_Float64 __f)
[238] Fix | Delete
__THROW __nonnull ((3));
[239] Fix | Delete
#endif
[240] Fix | Delete
[241] Fix | Delete
#if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
[242] Fix | Delete
extern int strfromf128 (char *__dest, size_t __size, const char * __format,
[243] Fix | Delete
_Float128 __f)
[244] Fix | Delete
__THROW __nonnull ((3));
[245] Fix | Delete
#endif
[246] Fix | Delete
[247] Fix | Delete
#if __HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)
[248] Fix | Delete
extern int strfromf32x (char *__dest, size_t __size, const char * __format,
[249] Fix | Delete
_Float32x __f)
[250] Fix | Delete
__THROW __nonnull ((3));
[251] Fix | Delete
#endif
[252] Fix | Delete
[253] Fix | Delete
#if __HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)
[254] Fix | Delete
extern int strfromf64x (char *__dest, size_t __size, const char * __format,
[255] Fix | Delete
_Float64x __f)
[256] Fix | Delete
__THROW __nonnull ((3));
[257] Fix | Delete
#endif
[258] Fix | Delete
[259] Fix | Delete
#if __HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)
[260] Fix | Delete
extern int strfromf128x (char *__dest, size_t __size, const char * __format,
[261] Fix | Delete
_Float128x __f)
[262] Fix | Delete
__THROW __nonnull ((3));
[263] Fix | Delete
#endif
[264] Fix | Delete
[265] Fix | Delete
[266] Fix | Delete
#ifdef __USE_GNU
[267] Fix | Delete
/* Parallel versions of the functions above which take the locale to
[268] Fix | Delete
use as an additional parameter. These are GNU extensions inspired
[269] Fix | Delete
by the POSIX.1-2008 extended locale API. */
[270] Fix | Delete
# include <bits/types/locale_t.h>
[271] Fix | Delete
[272] Fix | Delete
extern long int strtol_l (const char *__restrict __nptr,
[273] Fix | Delete
char **__restrict __endptr, int __base,
[274] Fix | Delete
locale_t __loc) __THROW __nonnull ((1, 4));
[275] Fix | Delete
[276] Fix | Delete
extern unsigned long int strtoul_l (const char *__restrict __nptr,
[277] Fix | Delete
char **__restrict __endptr,
[278] Fix | Delete
int __base, locale_t __loc)
[279] Fix | Delete
__THROW __nonnull ((1, 4));
[280] Fix | Delete
[281] Fix | Delete
__extension__
[282] Fix | Delete
extern long long int strtoll_l (const char *__restrict __nptr,
[283] Fix | Delete
char **__restrict __endptr, int __base,
[284] Fix | Delete
locale_t __loc)
[285] Fix | Delete
__THROW __nonnull ((1, 4));
[286] Fix | Delete
[287] Fix | Delete
__extension__
[288] Fix | Delete
extern unsigned long long int strtoull_l (const char *__restrict __nptr,
[289] Fix | Delete
char **__restrict __endptr,
[290] Fix | Delete
int __base, locale_t __loc)
[291] Fix | Delete
__THROW __nonnull ((1, 4));
[292] Fix | Delete
[293] Fix | Delete
extern double strtod_l (const char *__restrict __nptr,
[294] Fix | Delete
char **__restrict __endptr, locale_t __loc)
[295] Fix | Delete
__THROW __nonnull ((1, 3));
[296] Fix | Delete
[297] Fix | Delete
extern float strtof_l (const char *__restrict __nptr,
[298] Fix | Delete
char **__restrict __endptr, locale_t __loc)
[299] Fix | Delete
__THROW __nonnull ((1, 3));
[300] Fix | Delete
[301] Fix | Delete
extern long double strtold_l (const char *__restrict __nptr,
[302] Fix | Delete
char **__restrict __endptr,
[303] Fix | Delete
locale_t __loc)
[304] Fix | Delete
__THROW __nonnull ((1, 3));
[305] Fix | Delete
[306] Fix | Delete
# if __HAVE_FLOAT16
[307] Fix | Delete
extern _Float16 strtof16_l (const char *__restrict __nptr,
[308] Fix | Delete
char **__restrict __endptr,
[309] Fix | Delete
locale_t __loc)
[310] Fix | Delete
__THROW __nonnull ((1, 3));
[311] Fix | Delete
# endif
[312] Fix | Delete
[313] Fix | Delete
# if __HAVE_FLOAT32
[314] Fix | Delete
extern _Float32 strtof32_l (const char *__restrict __nptr,
[315] Fix | Delete
char **__restrict __endptr,
[316] Fix | Delete
locale_t __loc)
[317] Fix | Delete
__THROW __nonnull ((1, 3));
[318] Fix | Delete
# endif
[319] Fix | Delete
[320] Fix | Delete
# if __HAVE_FLOAT64
[321] Fix | Delete
extern _Float64 strtof64_l (const char *__restrict __nptr,
[322] Fix | Delete
char **__restrict __endptr,
[323] Fix | Delete
locale_t __loc)
[324] Fix | Delete
__THROW __nonnull ((1, 3));
[325] Fix | Delete
# endif
[326] Fix | Delete
[327] Fix | Delete
# if __HAVE_FLOAT128
[328] Fix | Delete
extern _Float128 strtof128_l (const char *__restrict __nptr,
[329] Fix | Delete
char **__restrict __endptr,
[330] Fix | Delete
locale_t __loc)
[331] Fix | Delete
__THROW __nonnull ((1, 3));
[332] Fix | Delete
# endif
[333] Fix | Delete
[334] Fix | Delete
# if __HAVE_FLOAT32X
[335] Fix | Delete
extern _Float32x strtof32x_l (const char *__restrict __nptr,
[336] Fix | Delete
char **__restrict __endptr,
[337] Fix | Delete
locale_t __loc)
[338] Fix | Delete
__THROW __nonnull ((1, 3));
[339] Fix | Delete
# endif
[340] Fix | Delete
[341] Fix | Delete
# if __HAVE_FLOAT64X
[342] Fix | Delete
extern _Float64x strtof64x_l (const char *__restrict __nptr,
[343] Fix | Delete
char **__restrict __endptr,
[344] Fix | Delete
locale_t __loc)
[345] Fix | Delete
__THROW __nonnull ((1, 3));
[346] Fix | Delete
# endif
[347] Fix | Delete
[348] Fix | Delete
# if __HAVE_FLOAT128X
[349] Fix | Delete
extern _Float128x strtof128x_l (const char *__restrict __nptr,
[350] Fix | Delete
char **__restrict __endptr,
[351] Fix | Delete
locale_t __loc)
[352] Fix | Delete
__THROW __nonnull ((1, 3));
[353] Fix | Delete
# endif
[354] Fix | Delete
#endif /* GNU */
[355] Fix | Delete
[356] Fix | Delete
[357] Fix | Delete
#ifdef __USE_EXTERN_INLINES
[358] Fix | Delete
__extern_inline int
[359] Fix | Delete
__NTH (atoi (const char *__nptr))
[360] Fix | Delete
{
[361] Fix | Delete
return (int) strtol (__nptr, (char **) NULL, 10);
[362] Fix | Delete
}
[363] Fix | Delete
__extern_inline long int
[364] Fix | Delete
__NTH (atol (const char *__nptr))
[365] Fix | Delete
{
[366] Fix | Delete
return strtol (__nptr, (char **) NULL, 10);
[367] Fix | Delete
}
[368] Fix | Delete
[369] Fix | Delete
# ifdef __USE_ISOC99
[370] Fix | Delete
__extension__ __extern_inline long long int
[371] Fix | Delete
__NTH (atoll (const char *__nptr))
[372] Fix | Delete
{
[373] Fix | Delete
return strtoll (__nptr, (char **) NULL, 10);
[374] Fix | Delete
}
[375] Fix | Delete
# endif
[376] Fix | Delete
#endif /* Optimizing and Inlining. */
[377] Fix | Delete
[378] Fix | Delete
[379] Fix | Delete
#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
[380] Fix | Delete
/* Convert N to base 64 using the digits "./0-9A-Za-z", least-significant
[381] Fix | Delete
digit first. Returns a pointer to static storage overwritten by the
[382] Fix | Delete
next call. */
[383] Fix | Delete
extern char *l64a (long int __n) __THROW __wur;
[384] Fix | Delete
[385] Fix | Delete
/* Read a number from a string S in base 64 as above. */
[386] Fix | Delete
extern long int a64l (const char *__s)
[387] Fix | Delete
__THROW __attribute_pure__ __nonnull ((1)) __wur;
[388] Fix | Delete
[389] Fix | Delete
#endif /* Use misc || extended X/Open. */
[390] Fix | Delete
[391] Fix | Delete
#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
[392] Fix | Delete
# include <sys/types.h> /* we need int32_t... */
[393] Fix | Delete
[394] Fix | Delete
/* These are the functions that actually do things. The `random', `srandom',
[395] Fix | Delete
`initstate' and `setstate' functions are those from BSD Unices.
[396] Fix | Delete
The `rand' and `srand' functions are required by the ANSI standard.
[397] Fix | Delete
We provide both interfaces to the same random number generator. */
[398] Fix | Delete
/* Return a random long integer between 0 and RAND_MAX inclusive. */
[399] Fix | Delete
extern long int random (void) __THROW;
[400] Fix | Delete
[401] Fix | Delete
/* Seed the random number generator with the given number. */
[402] Fix | Delete
extern void srandom (unsigned int __seed) __THROW;
[403] Fix | Delete
[404] Fix | Delete
/* Initialize the random number generator to use state buffer STATEBUF,
[405] Fix | Delete
of length STATELEN, and seed it with SEED. Optimal lengths are 8, 16,
[406] Fix | Delete
32, 64, 128 and 256, the bigger the better; values less than 8 will
[407] Fix | Delete
cause an error and values greater than 256 will be rounded down. */
[408] Fix | Delete
extern char *initstate (unsigned int __seed, char *__statebuf,
[409] Fix | Delete
size_t __statelen) __THROW __nonnull ((2));
[410] Fix | Delete
[411] Fix | Delete
/* Switch the random number generator to state buffer STATEBUF,
[412] Fix | Delete
which should have been previously initialized by `initstate'. */
[413] Fix | Delete
extern char *setstate (char *__statebuf) __THROW __nonnull ((1));
[414] Fix | Delete
[415] Fix | Delete
[416] Fix | Delete
# ifdef __USE_MISC
[417] Fix | Delete
/* Reentrant versions of the `random' family of functions.
[418] Fix | Delete
These functions all use the following data structure to contain
[419] Fix | Delete
state, rather than global state variables. */
[420] Fix | Delete
[421] Fix | Delete
struct random_data
[422] Fix | Delete
{
[423] Fix | Delete
int32_t *fptr; /* Front pointer. */
[424] Fix | Delete
int32_t *rptr; /* Rear pointer. */
[425] Fix | Delete
int32_t *state; /* Array of state values. */
[426] Fix | Delete
int rand_type; /* Type of random number generator. */
[427] Fix | Delete
int rand_deg; /* Degree of random number generator. */
[428] Fix | Delete
int rand_sep; /* Distance between front and rear. */
[429] Fix | Delete
int32_t *end_ptr; /* Pointer behind state table. */
[430] Fix | Delete
};
[431] Fix | Delete
[432] Fix | Delete
extern int random_r (struct random_data *__restrict __buf,
[433] Fix | Delete
int32_t *__restrict __result) __THROW __nonnull ((1, 2));
[434] Fix | Delete
[435] Fix | Delete
extern int srandom_r (unsigned int __seed, struct random_data *__buf)
[436] Fix | Delete
__THROW __nonnull ((2));
[437] Fix | Delete
[438] Fix | Delete
extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
[439] Fix | Delete
size_t __statelen,
[440] Fix | Delete
struct random_data *__restrict __buf)
[441] Fix | Delete
__THROW __nonnull ((2, 4));
[442] Fix | Delete
[443] Fix | Delete
extern int setstate_r (char *__restrict __statebuf,
[444] Fix | Delete
struct random_data *__restrict __buf)
[445] Fix | Delete
__THROW __nonnull ((1, 2));
[446] Fix | Delete
# endif /* Use misc. */
[447] Fix | Delete
#endif /* Use extended X/Open || misc. */
[448] Fix | Delete
[449] Fix | Delete
[450] Fix | Delete
/* Return a random integer between 0 and RAND_MAX inclusive. */
[451] Fix | Delete
extern int rand (void) __THROW;
[452] Fix | Delete
/* Seed the random number generator with the given number. */
[453] Fix | Delete
extern void srand (unsigned int __seed) __THROW;
[454] Fix | Delete
[455] Fix | Delete
#ifdef __USE_POSIX199506
[456] Fix | Delete
/* Reentrant interface according to POSIX.1. */
[457] Fix | Delete
extern int rand_r (unsigned int *__seed) __THROW;
[458] Fix | Delete
#endif
[459] Fix | Delete
[460] Fix | Delete
[461] Fix | Delete
#if defined __USE_MISC || defined __USE_XOPEN
[462] Fix | Delete
/* System V style 48-bit random number generator functions. */
[463] Fix | Delete
[464] Fix | Delete
/* Return non-negative, double-precision floating-point value in [0.0,1.0). */
[465] Fix | Delete
extern double drand48 (void) __THROW;
[466] Fix | Delete
extern double erand48 (unsigned short int __xsubi[3]) __THROW __nonnull ((1));
[467] Fix | Delete
[468] Fix | Delete
/* Return non-negative, long integer in [0,2^31). */
[469] Fix | Delete
extern long int lrand48 (void) __THROW;
[470] Fix | Delete
extern long int nrand48 (unsigned short int __xsubi[3])
[471] Fix | Delete
__THROW __nonnull ((1));
[472] Fix | Delete
[473] Fix | Delete
/* Return signed, long integers in [-2^31,2^31). */
[474] Fix | Delete
extern long int mrand48 (void) __THROW;
[475] Fix | Delete
extern long int jrand48 (unsigned short int __xsubi[3])
[476] Fix | Delete
__THROW __nonnull ((1));
[477] Fix | Delete
[478] Fix | Delete
/* Seed random number generator. */
[479] Fix | Delete
extern void srand48 (long int __seedval) __THROW;
[480] Fix | Delete
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
[481] Fix | Delete
__THROW __nonnull ((1));
[482] Fix | Delete
extern void lcong48 (unsigned short int __param[7]) __THROW __nonnull ((1));
[483] Fix | Delete
[484] Fix | Delete
# ifdef __USE_MISC
[485] Fix | Delete
/* Data structure for communication with thread safe versions. This
[486] Fix | Delete
type is to be regarded as opaque. It's only exported because users
[487] Fix | Delete
have to allocate objects of this type. */
[488] Fix | Delete
struct drand48_data
[489] Fix | Delete
{
[490] Fix | Delete
unsigned short int __x[3]; /* Current state. */
[491] Fix | Delete
unsigned short int __old_x[3]; /* Old state. */
[492] Fix | Delete
unsigned short int __c; /* Additive const. in congruential formula. */
[493] Fix | Delete
unsigned short int __init; /* Flag for initializing. */
[494] Fix | Delete
__extension__ unsigned long long int __a; /* Factor in congruential
[495] Fix | Delete
formula. */
[496] Fix | Delete
};
[497] Fix | Delete
[498] Fix | Delete
/* Return non-negative, double-precision floating-point value in [0.0,1.0). */
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function