50 lines
841 B
C
50 lines
841 B
C
|
|
#ifndef __STDLIB_H__
|
|
#define __STDLIB_H__
|
|
|
|
#include <sys/types.h>
|
|
|
|
#ifndef NULL
|
|
#define NULL ((void *)0)
|
|
#endif
|
|
|
|
int atexit(void (*function)(void));
|
|
void exit(int status);
|
|
_Noreturn void abort(void);
|
|
|
|
void *calloc(size_t num, size_t sz);
|
|
void *malloc(size_t sz);
|
|
void free(void *buf);
|
|
|
|
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';
|
|
}
|
|
|
|
|
|
#endif /* __STDLIB_H__ */
|
|
|