Subversion Repositories Kolibri OS

Rev

Rev 6443 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
647 andrew_pro 1
#ifndef stdlib_h
2
#define stdlib_h
3
#include "kolibrisys.h"
4
 
696 andrew_pro 5
#define	RAND_MAX	65535
6433 siemargl 6
#ifndef NULL
7
# define NULL ((void*)0)
8
#endif
696 andrew_pro 9
 
215 victor 10
#define abs(i) (((i)<0)?(-(i)):(i))
6433 siemargl 11
#define labs(li) abs(li)
215 victor 12
 
13
extern int atoib(char *s,int b);
14
extern int atoi(char *s);
6443 siemargl 15
extern char *itoab(unsigned int n,char* s,int  b);
16
extern char *__itoa(int n,char* s);
611 andrew_pro 17
 
647 andrew_pro 18
extern void* stdcall malloc(dword size);
19
extern void  stdcall free(void *pointer);
20
extern void* stdcall realloc(void* pointer,dword size);
696 andrew_pro 21
 
22
extern int rand (void);
23
extern void srand (unsigned int seed);
24
 
6424 siemargl 25
double strtod (const char* str, char** endptr);
26
long double strtold (const char* str, char** endptr);
27
float strtof (const char* str, char** endptr);
6443 siemargl 28
long int strtol (const char* str, char** endptr, int base);
29
#define strtoul(s, ep, b) ((unsigned long int)strtol(s, ep, b))
6424 siemargl 30
 
6433 siemargl 31
void* calloc (size_t num, size_t size);
6424 siemargl 32
 
7172 siemargl 33
void exit (int status); /* close console if was initialized, also stay window [finished] when status is error < 0 */
6433 siemargl 34
#define abort() exit(-1)
35
 
36
typedef struct {
37
  int quot;
38
  int rem;
39
} div_t;
40
 
41
typedef div_t ldiv_t;
42
 
43
div_t div (int numer, int denom);
44
#define ldiv(a, b) div(a, b)
45
#define atol(a) atoi(a)
6443 siemargl 46
#define atof(a) strtod(a, NULL)
6433 siemargl 47
 
6443 siemargl 48
 
49
 
6433 siemargl 50
#endif