diff options
Diffstat (limited to 'include/lib/libc')
-rw-r--r-- | include/lib/libc/stdbool.h | 6 | ||||
-rw-r--r-- | include/lib/libc/stdio.h | 1 | ||||
-rw-r--r-- | include/lib/libc/stdlib.h | 9 | ||||
-rw-r--r-- | include/lib/libc/string.h | 4 |
4 files changed, 15 insertions, 5 deletions
diff --git a/include/lib/libc/stdbool.h b/include/lib/libc/stdbool.h index e39aef7d3..b58334cd0 100644 --- a/include/lib/libc/stdbool.h +++ b/include/lib/libc/stdbool.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2018-2020, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -9,8 +9,8 @@ #define bool _Bool -#define true 1 -#define false 0 +#define true (0 < 1) +#define false (0 > 1) #define __bool_true_false_are_defined 1 diff --git a/include/lib/libc/stdio.h b/include/lib/libc/stdio.h index 2d9e6557b..ba13683e6 100644 --- a/include/lib/libc/stdio.h +++ b/include/lib/libc/stdio.h @@ -22,6 +22,7 @@ int snprintf(char *s, size_t n, const char *fmt, ...) __printflike(3, 4); #ifdef STDARG_H int vprintf(const char *fmt, va_list args); +int vsnprintf(char *s, size_t n, const char *fmt, va_list args); #endif int putchar(int c); diff --git a/include/lib/libc/stdlib.h b/include/lib/libc/stdlib.h index 24e7bae2f..4641e566e 100644 --- a/include/lib/libc/stdlib.h +++ b/include/lib/libc/stdlib.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2017 Roberto E. Vargas Caballero + * Copyright (c) 2012-2021 Roberto E. Vargas Caballero * * SPDX-License-Identifier: BSD-3-Clause */ @@ -18,8 +18,15 @@ #define _ATEXIT_MAX 1 +#define isspace(x) (((x) == ' ') || ((x) == '\r') || ((x) == '\n') || \ + ((x) == '\t') || ((x) == '\b')) + extern void abort(void); extern int atexit(void (*func)(void)); extern void exit(int status); +long strtol(const char *nptr, char **endptr, int base); +unsigned long strtoul(const char *nptr, char **endptr, int base); +long long strtoll(const char *nptr, char **endptr, int base); +unsigned long long strtoull(const char *nptr, char **endptr, int base); #endif /* STDLIB_H */ diff --git a/include/lib/libc/string.h b/include/lib/libc/string.h index 71774b0c8..989448318 100644 --- a/include/lib/libc/string.h +++ b/include/lib/libc/string.h @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ /* - * Portions copyright (c) 2018-2019, ARM Limited and Contributors. + * Portions copyright (c) 2018-2020, ARM Limited and Contributors. * All rights reserved. */ @@ -26,5 +26,7 @@ size_t strlen(const char *s); size_t strnlen(const char *s, size_t maxlen); char *strrchr(const char *p, int ch); size_t strlcpy(char * dst, const char * src, size_t dsize); +size_t strlcat(char * dst, const char * src, size_t dsize); +char *strtok_r(char *s, const char *delim, char **last); #endif /* STRING_H */ |