1 /* -*-comment-start: "//";comment-end:""-*-
2 * Mes --- Maxwell Equations of Software
3 * Copyright © 2017 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
5 * This file is part of Mes.
7 * Mes is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or (at
10 * your option) any later version.
12 * Mes is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Mes. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef __MES_STDLIB_H
21 #define __MES_STDLIB_H 1
28 #include_next <stdlib.h>
34 typedef unsigned long size_t;
37 int atoi (char const *s);
38 void * calloc (size_t nmemb, size_t size);
40 void free (void *ptr);
41 char* getenv (char const* s);
42 int setenv (char const* s, char const* v, int overwrite_p);
43 void *malloc (size_t);
44 void qsort (void *base, size_t nmemb, size_t size, int (*compar)(void const *, void const *));
45 void *realloc (void *p, size_t size);
46 double strtod (char const *nptr, char **endptr);
47 float strtof (char const *nptr, char **endptr);
48 long double strtold (char const *nptr, char **endptr);
49 long strtol (char const *nptr, char **endptr, int base);
50 long long strtoll (char const *nptr, char **endptr, int base);
51 unsigned long strtoul (char const *nptr, char **endptr, int base);
52 unsigned long long strtoull (char const *nptr, char **endptr, int base);
54 #define EXIT_FAILURE 1
55 #define EXIT_SUCCESS 0
59 typedef int (*comparison_fn_t) (void const *, void const *);
61 typedef void (*comparison_fn_t) ();
64 void * bsearch (void const *key, void const *array, size_t count, size_t size, comparison_fn_t compare);
68 #endif // ! WITH_GLIBC
70 #endif // __MES_STDLIB_H