1 # 7.20 General utilities <stdlib.h>
3 # deprecated cimports for backwards compatibility:
4 from libc.string cimport const_char, const_void
7 cdef extern from "stdlib.h" nogil:
9 # 7.20.1 Numeric conversion functions
10 int atoi (const char *string)
11 long atol (const char *string)
12 long long atoll (const char *string)
13 double atof (const char *string)
14 long strtol (const char *string, char **tailptr, int base)
15 unsigned long int strtoul (const char *string, char **tailptr, int base)
16 long long int strtoll (const char *string, char **tailptr, int base)
17 unsigned long long int strtoull (const char *string, char **tailptr, int base)
18 float strtof (const char *string, char **tailptr)
19 double strtod (const char *string, char **tailptr)
20 long double strtold (const char *string, char **tailptr)
22 # 7.20.2 Pseudo-random sequence generation functions
25 void srand (unsigned int seed)
27 # 7.20.3 Memory management functions
28 void *calloc (size_t count, size_t eltsize)
30 void *malloc (size_t size)
31 void *realloc (void *ptr, size_t newsize)
33 # 7.20.4 Communication with the environment
36 void exit (int status)
37 void _exit (int status)
38 int atexit (void (*function) ())
40 char *getenv (const char *name)
41 int system (const char *command)
43 #7.20.5 Searching and sorting utilities
44 void *bsearch (const void *key, const void *array,
45 size_t count, size_t size,
46 int (*compare)(const void *, const void *))
47 void qsort (void *array, size_t count, size_t size,
48 int (*compare)(const void *, const void *))
50 # 7.20.6 Integer arithmetic functions
52 long int labs (long int number)
53 long long int llabs (long long int number)
54 ctypedef struct div_t:
57 div_t div (int numerator, int denominator)
58 ctypedef struct ldiv_t:
61 ldiv_t ldiv (long int numerator, long int denominator)
62 ctypedef struct lldiv_t:
65 lldiv_t lldiv (long long int numerator, long long int denominator)
68 # 7.20.7 Multibyte/wide character conversion functions
71 # 7.20.8 Multibyte/wide string conversion functions