-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstdlib.h
80 lines (58 loc) · 1.5 KB
/
stdlib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
* NCSOCK & NESCA4
* Сделано от души 2023.
* Copyright (c) [2023] [lomaster]
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef NOTGNU_STDLIB_H
#define NOTGNU_STDLIB_H
#include "ngusyst/cdefs.h"
#include "stdnoreturn.h"
#include "ngusyst/random.h"
#include "ctype.h"
#include "limits.h"
#include "string.h"
#include "ngusyst/malloc.h" /* for malloc and other */
#include "stddef.h" /* for size_t */
typedef struct
{
int quot, rem;
} div_t;
typedef struct
{
long int quot, rem;
} ldiv_t;
__BEGIN_DECLS
extern void exit(int code);
extern void abort(void);
int atoi(const char* s);
long atol(const char* s);
double atof(const char* s);
int rand(void);
void srand(unsigned seed);
char* getenv(const char* name);
int _system(const char* command); /* TODO */
noreturn void __exit(int code);
noreturn void __abort(void);
#define abs(x) \
((x) < 0 ? -(x) : (x))
#define labs(j) \
((j) < 0 ? -(j) : (j))
div_t div(int num, int denom);
ldiv_t ldiv(long num, long denom);
void*
bsearch(const void *key, const void *base0, size_t nmemb, size_t size,
int (*compar)(const void *, const void *));
int
heapsort(void *vbase, size_t nmemb, size_t size, int (*compar)
(const void *, const void *));
void
qsort(void *base, size_t nitems, size_t size, int (*compar)
(const void *, const void*));
double strtod(const char* str, char** endptr);
unsigned long
strtoul(const char* nptr, char** endptr, int base);
long
strtol(const char* nptr, char** endptr, int base);
__END_DECLS
#endif