metal-cos/include/stdlib.h

50 lines
841 B
C
Raw Permalink Normal View History

2014-02-12 21:47:13 +00:00
#ifndef __STDLIB_H__
#define __STDLIB_H__
#include <sys/types.h>
2014-02-12 21:47:13 +00:00
#ifndef NULL
#define NULL ((void *)0)
#endif
2014-07-28 00:09:31 +00:00
int atexit(void (*function)(void));
void exit(int status);
_Noreturn void abort(void);
2014-07-28 00:09:31 +00:00
2023-08-20 02:14:06 +00:00
void *calloc(size_t num, size_t sz);
void *malloc(size_t sz);
void free(void *buf);
2023-08-20 23:05:08 +00:00
int atoi(const char *nptr);
unsigned long strtoul(const char *nptr, char **endptr, int base);
static inline int isdigit(char c)
{
return (c >= '0') && (c <= '9');
}
static inline int isupper(char c)
{
return (c >= 'A') && (c <= 'Z');
}
static inline int islower(char c)
{
return (c >= 'a') && (c <= 'z');
}
static inline int isalpha(char c)
{
return (isupper(c)) || (islower(c));
}
static inline int isspace(char C) {
return C == ' ' || C == '\f' || C == '\n' || C == '\r' || C == '\t' ||
C == '\v';
}
2023-08-20 23:05:08 +00:00
2014-02-12 21:47:13 +00:00
#endif /* __STDLIB_H__ */