toaruos/base/usr/include/stdlib.h

74 lines
2.1 KiB
C
Raw Normal View History

#pragma once
2018-10-12 05:15:40 +03:00
#include <_cheader.h>
#include <stddef.h>
2018-10-12 05:15:40 +03:00
_Begin_C_Header
extern void exit(int status);
extern char * getenv(const char *name);
extern void *malloc(size_t size);
extern void free(void *ptr);
extern void *calloc(size_t nmemb, size_t size);
extern void *realloc(void *ptr, size_t size);
extern void qsort(void *base, size_t nmemb, size_t size, int (*compar)(const void*,const void*));
extern int system(const char * command);
extern int abs(int j);
2018-05-02 13:25:03 +03:00
extern int putenv(char * name);
extern int setenv(const char *name, const char *value, int overwrite);
2018-09-23 05:58:07 +03:00
extern int unsetenv(const char * str);
2018-05-02 13:25:03 +03:00
2018-06-25 06:11:33 +03:00
extern double strtod(const char *nptr, char **endptr);
2018-10-12 04:35:28 +03:00
extern float strtof(const char *nptr, char **endptr);
2018-05-02 13:43:33 +03:00
extern double atof(const char * nptr);
extern int atoi(const char * nptr);
2018-05-09 10:55:10 +03:00
extern long atol(const char * nptr);
extern long int labs(long int j);
2018-06-25 14:15:45 +03:00
extern long int strtol(const char * s, char **endptr, int base);
2018-10-10 03:13:54 +03:00
extern long long int strtoll(const char *nptr, char **endptr, int base);
extern unsigned long int strtoul(const char *nptr, char **endptr, int base);
extern unsigned long long int strtoull(const char *nptr, char **endptr, int base);
2018-05-09 13:43:02 +03:00
extern void srand(unsigned int);
extern int rand(void);
2018-09-15 10:26:45 +03:00
#define ATEXIT_MAX 32
extern int atexit(void (*h)(void));
extern void _handle_atexit(void);
2018-05-09 13:43:02 +03:00
#define RAND_MAX 0x7FFFFFFF
2018-06-10 13:31:18 +03:00
extern void abort(void);
2018-05-09 13:43:02 +03:00
#define EXIT_SUCCESS 0
#define EXIT_FAILURE 1
2018-05-02 13:43:33 +03:00
#define NULL 0
2018-10-10 03:35:09 +03:00
extern void *bsearch(const void *key, const void *base, size_t nmemb, size_t size,
int (*compar)(const void *, const void *));
2018-10-12 04:35:28 +03:00
extern char * mktemp(char *);
2018-11-22 10:27:07 +03:00
extern int mkstemp(char *);
2018-10-10 05:01:30 +03:00
extern size_t mbstowcs(wchar_t *dest, const char *src, size_t n);
extern size_t wcstombs(char * dest, const wchar_t *src, size_t n);
2018-10-12 04:35:28 +03:00
typedef struct { int quot; int rem; } div_t;
typedef struct { long int quot; long int rem; } ldiv_t;
extern div_t div(int numerator, int denominator);
extern ldiv_t ldiv(long numerator, long denominator);
/* These are supposed to be in limits, but gcc screwed us */
#define PATH_MAX 4096
#define NAME_MAX 255
extern char *realpath(const char *path, char *resolved_path);
2018-10-12 05:15:40 +03:00
_End_C_Header