source: mainline/uspace/lib/c/include/stdlib.h@ 9bfa8c8

Last change on this file since 9bfa8c8 was d7f7a4a, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 3 years ago

Replace some license headers with SPDX identifier

Headers are replaced using tools/transorm-copyright.sh only
when it can be matched verbatim with the license header used
throughout most of the codebase.

  • Property mode set to 100644
File size: 1.9 KB
Line 
1/*
2 * SPDX-FileCopyrightText: 2005 Martin Decky
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7/** @addtogroup libc
8 * @{
9 */
10/** @file
11 */
12
13#ifndef _LIBC_STDLIB_H_
14#define _LIBC_STDLIB_H_
15
16#include <_bits/size_t.h>
17#include <_bits/wchar_t.h>
18#include <_bits/uchar.h>
19#include <_bits/decls.h>
20#include <bsearch.h>
21#include <malloc.h>
22#include <qsort.h>
23
24#define EXIT_SUCCESS 0
25#define EXIT_FAILURE 1
26
27#define RAND_MAX 714025
28
29#define MB_CUR_MAX 4
30
31__C_DECLS_BEGIN;
32
33/** Type returned by the div function */
34typedef struct {
35 /** Quotient */
36 int quot;
37 /** Remainder */
38 int rem;
39} div_t;
40
41/** Type returned by the ldiv function */
42typedef struct {
43 /** Quotient */
44 long quot;
45 /** Remainder */
46 long rem;
47} ldiv_t;
48
49/** Type returned by the lldiv function */
50typedef struct {
51 /** Quotient */
52 long long quot;
53 /** Remainder */
54 long long rem;
55} lldiv_t;
56
57extern long double strtold(const char *, char **);
58
59extern int rand(void);
60extern void srand(unsigned int);
61
62extern void abort(void) __attribute__((noreturn));
63extern int atexit(void (*)(void));
64extern void exit(int) __attribute__((noreturn));
65extern void _Exit(int) __attribute__((noreturn));
66extern int at_quick_exit(void (*)(void));
67extern void quick_exit(int);
68
69extern char *getenv(const char *);
70extern int system(const char *);
71
72extern int abs(int);
73extern long labs(long);
74extern long long llabs(long long);
75
76extern int atoi(const char *);
77extern long atol(const char *);
78extern long long atoll(const char *);
79
80extern long strtol(const char *__restrict__, char **__restrict__, int);
81extern long long strtoll(const char *__restrict__, char **__restrict__, int);
82extern unsigned long strtoul(const char *__restrict__, char **__restrict__, int);
83extern unsigned long long strtoull(const char *__restrict__, char **__restrict__, int);
84
85extern div_t div(int, int);
86extern ldiv_t ldiv(long, long);
87extern lldiv_t lldiv(long long, long long);
88
89__C_DECLS_END;
90
91#endif
92
93/** @}
94 */
Note: See TracBrowser for help on using the repository browser.