2014-12-22 12:35:05 +01:00
|
|
|
/*
|
|
|
|
* c_stdlib.h
|
|
|
|
*
|
|
|
|
* Definitions for common types, variables, and functions.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _C_STDLIB_H_
|
|
|
|
#define _C_STDLIB_H_
|
|
|
|
|
|
|
|
#include "c_stddef.h"
|
|
|
|
#include "mem.h"
|
|
|
|
|
2016-01-24 00:01:39 +01:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
2014-12-22 12:35:05 +01:00
|
|
|
#define EXIT_FAILURE 1
|
|
|
|
#define EXIT_SUCCESS 0
|
|
|
|
|
|
|
|
#define __INT_MAX__ 2147483647
|
|
|
|
#undef __RAND_MAX
|
|
|
|
#if __INT_MAX__ == 32767
|
|
|
|
#define __RAND_MAX 32767
|
|
|
|
#else
|
|
|
|
#define __RAND_MAX 0x7fffffff
|
|
|
|
#endif
|
|
|
|
#define RAND_MAX __RAND_MAX
|
|
|
|
|
|
|
|
#ifndef mem_realloc
|
|
|
|
#define mem_realloc pvPortRealloc
|
|
|
|
#endif
|
|
|
|
#ifndef os_realloc
|
|
|
|
#define os_realloc(p, s) mem_realloc((p), (s))
|
|
|
|
#endif
|
|
|
|
|
2015-03-29 18:24:09 +02:00
|
|
|
#define c_free os_free
|
|
|
|
#define c_malloc os_malloc
|
|
|
|
#define c_zalloc os_zalloc
|
2014-12-22 12:35:05 +01:00
|
|
|
#define c_realloc os_realloc
|
|
|
|
|
|
|
|
#define c_abs abs
|
|
|
|
#define c_atoi atoi
|
2015-01-25 21:15:54 +01:00
|
|
|
//#define c_strtod strtod
|
2014-12-22 12:35:05 +01:00
|
|
|
#define c_strtol strtol
|
|
|
|
#define c_strtoul strtoul
|
|
|
|
|
|
|
|
// int c_abs(int);
|
|
|
|
|
|
|
|
// void c_exit(int);
|
|
|
|
|
|
|
|
// c_getenv() get env "LUA_INIT" string for lua initialization.
|
|
|
|
const char *c_getenv(const char *__string);
|
|
|
|
|
2015-03-29 18:24:09 +02:00
|
|
|
// void *c_malloc(size_t __size);
|
|
|
|
// void *c_zalloc(size_t __size);
|
|
|
|
// void c_free(void *);
|
2014-12-22 12:35:05 +01:00
|
|
|
|
|
|
|
// int c_rand(void);
|
|
|
|
// void c_srand(unsigned int __seed);
|
|
|
|
|
|
|
|
// int c_atoi(const char *__nptr);
|
2015-01-25 21:15:54 +01:00
|
|
|
double c_strtod(const char *__n, char **__end_PTR);
|
2014-12-22 12:35:05 +01:00
|
|
|
// // long c_strtol(const char *__n, char **__end_PTR, int __base);
|
|
|
|
// unsigned long c_strtoul(const char *__n, char **__end_PTR, int __base);
|
|
|
|
// // long long c_strtoll(const char *__n, char **__end_PTR, int __base);
|
|
|
|
|
|
|
|
#endif /* _C_STDLIB_H_ */
|