2014-02-12 21:47:13 +00:00
|
|
|
|
|
|
|
#ifndef __STDLIB_H__
|
|
|
|
#define __STDLIB_H__
|
|
|
|
|
2015-01-03 00:13:53 +00:00
|
|
|
#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);
|
2023-08-23 01:53:26 +00:00
|
|
|
_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);
|
2015-01-03 00:13:53 +00:00
|
|
|
void *malloc(size_t sz);
|
|
|
|
void free(void *buf);
|
|
|
|
|
2023-08-20 23:05:08 +00:00
|
|
|
int atoi(const char *nptr);
|
2024-10-21 10:56:44 +00:00
|
|
|
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__ */
|
|
|
|
|