2007-10-15 11:42:17 +02:00
|
|
|
#ifndef stdlib_h
|
|
|
|
#define stdlib_h
|
|
|
|
#include "kolibrisys.h"
|
|
|
|
|
2008-01-14 20:33:34 +01:00
|
|
|
#define RAND_MAX 65535
|
2016-05-19 14:15:22 +02:00
|
|
|
#ifndef NULL
|
|
|
|
# define NULL ((void*)0)
|
|
|
|
#endif
|
2008-01-14 20:33:34 +01:00
|
|
|
|
2007-10-15 11:42:17 +02:00
|
|
|
#define abs(i) (((i)<0)?(-(i)):(i))
|
2016-05-19 14:15:22 +02:00
|
|
|
#define labs(li) abs(li)
|
2007-10-15 11:42:17 +02:00
|
|
|
|
|
|
|
extern int atoib(char *s,int b);
|
|
|
|
extern int atoi(char *s);
|
2016-04-30 15:50:04 +02:00
|
|
|
extern char *itoab(int n,char* s,int b);
|
|
|
|
extern char *itoa(int n,char* s);
|
2007-10-15 11:42:17 +02:00
|
|
|
|
|
|
|
extern void* stdcall malloc(dword size);
|
|
|
|
extern void stdcall free(void *pointer);
|
|
|
|
extern void* stdcall realloc(void* pointer,dword size);
|
2008-01-14 20:33:34 +01:00
|
|
|
|
|
|
|
extern int rand (void);
|
|
|
|
extern void srand (unsigned int seed);
|
|
|
|
|
2016-05-11 16:53:54 +02:00
|
|
|
double strtod (const char* str, char** endptr);
|
|
|
|
long double strtold (const char* str, char** endptr);
|
|
|
|
float strtof (const char* str, char** endptr);
|
|
|
|
|
2016-05-19 14:15:22 +02:00
|
|
|
void* calloc (size_t num, size_t size);
|
2016-05-11 16:53:54 +02:00
|
|
|
|
|
|
|
#define exit(a) _ksys_exit()
|
2016-05-19 14:15:22 +02:00
|
|
|
#define abort() exit(-1)
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
int quot;
|
|
|
|
int rem;
|
|
|
|
} div_t;
|
|
|
|
|
|
|
|
typedef div_t ldiv_t;
|
|
|
|
|
|
|
|
div_t div (int numer, int denom);
|
|
|
|
#define ldiv(a, b) div(a, b)
|
|
|
|
#define atol(a) atoi(a)
|
|
|
|
|
|
|
|
#endif
|