1 /**
2     Bindings to C standard library core functions.
3 
4     Copyright:
5         Copyright © 2023-2025, Kitsunebi Games
6         Copyright © 2023-2025, Inochi2D Project
7     
8     License:   $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
9     Authors:   Luna Nielsen
10 */
11 module nulib.c.stdlib;
12 
13 extern(C) nothrow @nogc:
14 
15 /**
16     Converts given string to double.
17 
18     Params:
19         str = string to convert.
20     
21     Returns:
22         The floating point value of $(D str) on success,
23         $(D 0.0) on failure.
24 */
25 extern double atof(const(char)* str);
26 
27 /**
28     Converts given string to int.
29 
30     Params:
31         str = string to convert.
32     
33     Returns:
34         The int value of $(D str) on success,
35         $(D 0) on failure.
36 */
37 extern int atoi(const(char)* str);
38 
39 /**
40     Converts given string to long.
41 
42     Params:
43         str = string to convert.
44     
45     Returns:
46         The long value of $(D str) on success,
47         $(D 0) on failure.
48 */
49 extern long atoll(const(char)* str);
50 
51 
52 /// These two were added to Bionic in Lollipop.
53 int     rand() @trusted;
54 
55 ///
56 void    srand(uint seed) @trusted;
57 
58 ///
59 noreturn abort() @safe;
60 
61 ///
62 noreturn exit(int status);
63 
64 ///
65 int     atexit(void function() func);
66 
67 ///
68 noreturn _Exit(int status);
69 
70 ///
71 char*   getenv(scope const char* name);
72 
73 ///
74 int     system(scope const char* string);