blob: 219a333e76e7abdf7679c5e093063dbbc9ebb3a5 [file] [log] [blame]
Imre Kisf55f2aa2024-05-28 15:55:19 +02001/*
2 * Copyright (c) 2012-2021 Roberto E. Vargas Caballero
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6/*
Imre Kis0619e152024-05-28 16:03:09 +02007 * Portions copyright (c) 2018-2024, Arm Limited and Contributors.
Imre Kisf55f2aa2024-05-28 15:55:19 +02008 * All rights reserved.
9 */
10
11#ifndef STDLIB_H
12#define STDLIB_H
13
14#include <stddef.h>
15
16#define EXIT_FAILURE 1
17#define EXIT_SUCCESS 0
18
19#define _ATEXIT_MAX 1
20
21#define isspace(x) (((x) == ' ') || ((x) == '\r') || ((x) == '\n') || \
22 ((x) == '\t') || ((x) == '\b'))
23
24extern void abort(void);
25extern int atexit(void (*func)(void));
26extern void exit(int status);
27
28long strtol(const char *nptr, char **endptr, int base);
29unsigned long strtoul(const char *nptr, char **endptr, int base);
30long long strtoll(const char *nptr, char **endptr, int base);
31unsigned long long strtoull(const char *nptr, char **endptr, int base);
Imre Kis0619e152024-05-28 16:03:09 +020032
33/*
34 * The declaration of these functions is part of libc but they are implemented
35 * in the allocator.
36 */
37void *malloc(size_t size);
38void free(void *ptr);
39void *calloc(size_t nmemb, size_t size);
40void *realloc(void *ptr, size_t size);
41
Imre Kisf55f2aa2024-05-28 15:55:19 +020042#endif /* STDLIB_H */