xref: /haiku/src/system/libroot/posix/glibc/include/stdlib.h (revision 5af32e752606778be5dd7379f319fe43cb3f6b8c)
1*5af32e75SAxel Dörfler #ifndef _STDLIB_H
2*5af32e75SAxel Dörfler 
3*5af32e75SAxel Dörfler #ifdef __need_malloc_and_calloc
4*5af32e75SAxel Dörfler #define __Need_M_And_C
5*5af32e75SAxel Dörfler #endif
6*5af32e75SAxel Dörfler 
7*5af32e75SAxel Dörfler #include <stdlib/stdlib.h>
8*5af32e75SAxel Dörfler 
9*5af32e75SAxel Dörfler /* Now define the internal interfaces.  */
10*5af32e75SAxel Dörfler #ifndef __Need_M_And_C
11*5af32e75SAxel Dörfler extern long int __random (void);
12*5af32e75SAxel Dörfler extern void __srandom (unsigned int __seed);
13*5af32e75SAxel Dörfler extern char *__initstate (unsigned int __seed, char *__statebuf,
14*5af32e75SAxel Dörfler 			  size_t __statelen);
15*5af32e75SAxel Dörfler extern char *__setstate (char *__statebuf);
16*5af32e75SAxel Dörfler extern int __random_r (struct random_data *__buf, int32_t *__result);
17*5af32e75SAxel Dörfler extern int __srandom_r (unsigned int __seed, struct random_data *__buf);
18*5af32e75SAxel Dörfler extern int __initstate_r (unsigned int __seed, char *__statebuf,
19*5af32e75SAxel Dörfler 			  size_t __statelen, struct random_data *__buf);
20*5af32e75SAxel Dörfler extern int __setstate_r (char *__statebuf, struct random_data *__buf);
21*5af32e75SAxel Dörfler extern int __rand_r (unsigned int *__seed);
22*5af32e75SAxel Dörfler extern int __erand48_r (unsigned short int __xsubi[3],
23*5af32e75SAxel Dörfler 			struct drand48_data *__buffer, double *__result);
24*5af32e75SAxel Dörfler extern int __nrand48_r (unsigned short int __xsubi[3],
25*5af32e75SAxel Dörfler 			struct drand48_data *__buffer,
26*5af32e75SAxel Dörfler 			long int *__result);
27*5af32e75SAxel Dörfler extern int __jrand48_r (unsigned short int __xsubi[3],
28*5af32e75SAxel Dörfler 			struct drand48_data *__buffer,
29*5af32e75SAxel Dörfler 			long int *__result);
30*5af32e75SAxel Dörfler extern int __srand48_r (long int __seedval,
31*5af32e75SAxel Dörfler 			struct drand48_data *__buffer);
32*5af32e75SAxel Dörfler extern int __seed48_r (unsigned short int __seed16v[3],
33*5af32e75SAxel Dörfler 		       struct drand48_data *__buffer);
34*5af32e75SAxel Dörfler extern int __lcong48_r (unsigned short int __param[7],
35*5af32e75SAxel Dörfler 			struct drand48_data *__buffer);
36*5af32e75SAxel Dörfler 
37*5af32e75SAxel Dörfler /* Internal function to compute next state of the generator.  */
38*5af32e75SAxel Dörfler extern int __drand48_iterate (unsigned short int __xsubi[3],
39*5af32e75SAxel Dörfler 			      struct drand48_data *__buffer);
40*5af32e75SAxel Dörfler 
41*5af32e75SAxel Dörfler extern int __setenv (__const char *__name, __const char *__value,
42*5af32e75SAxel Dörfler 		     int __replace);
43*5af32e75SAxel Dörfler extern int __unsetenv (__const char *__name);
44*5af32e75SAxel Dörfler extern int __clearenv (void);
45*5af32e75SAxel Dörfler extern char *__canonicalize_file_name (__const char *__name);
46*5af32e75SAxel Dörfler extern char *__realpath (__const char *__name, char *__resolved);
47*5af32e75SAxel Dörfler extern int __ptsname_r (int __fd, char *__buf, size_t __buflen);
48*5af32e75SAxel Dörfler extern int __getpt (void);
49*5af32e75SAxel Dörfler extern int __posix_openpt (int __oflag);
50*5af32e75SAxel Dörfler 
51*5af32e75SAxel Dörfler extern int __add_to_environ (const char *name, const char *value,
52*5af32e75SAxel Dörfler 			     const char *combines, int replace);
53*5af32e75SAxel Dörfler 
54*5af32e75SAxel Dörfler extern void _quicksort (void *const pbase, size_t total_elems,
55*5af32e75SAxel Dörfler 			size_t size, __compar_fn_t cmp);
56*5af32e75SAxel Dörfler 
57*5af32e75SAxel Dörfler extern int __on_exit (void (*__func) (int __status, void *__arg), void *__arg);
58*5af32e75SAxel Dörfler 
59*5af32e75SAxel Dörfler extern int __cxa_atexit (void (*func) (void *), void *arg, void *d);
60*5af32e75SAxel Dörfler 
61*5af32e75SAxel Dörfler extern void __cxa_finalize (void *d);
62*5af32e75SAxel Dörfler 
63*5af32e75SAxel Dörfler extern int __posix_memalign (void **memptr, size_t alignment, size_t size)
64*5af32e75SAxel Dörfler      __attribute_malloc__;
65*5af32e75SAxel Dörfler 
66*5af32e75SAxel Dörfler extern int __libc_system (const char *line);
67*5af32e75SAxel Dörfler 
68*5af32e75SAxel Dörfler #endif
69*5af32e75SAxel Dörfler #undef __Need_M_And_C
70*5af32e75SAxel Dörfler 
71*5af32e75SAxel Dörfler #endif  /* include/stdlib.h */
72