Statistics
| Branch: | Revision:

root / prex-0.9.0 / usr / include / stdlib.h @ 03e9c04a

History | View | Annotate | Download (4.72 KB)

1
/*-
2
 * Copyright (c) 1990, 1993
3
 *        The Regents of the University of California.  All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * are met:
8
 * 1. Redistributions of source code must retain the above copyright
9
 *    notice, this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above copyright
11
 *    notice, this list of conditions and the following disclaimer in the
12
 *    documentation and/or other materials provided with the distribution.
13
 * 3. Neither the name of the University nor the names of its contributors
14
 *    may be used to endorse or promote products derived from this software
15
 *    without specific prior written permission.
16
 *
17
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27
 * SUCH DAMAGE.
28
 *
29
 *        @(#)stdlib.h        8.5 (Berkeley) 5/19/95
30
 */
31

    
32
#ifndef _STDLIB_H_
33
#define _STDLIB_H_
34

    
35
#if !defined(_SIZE_T)
36
#define _SIZE_T
37
typedef        unsigned int        size_t;                /* size of something in bytes */
38
#endif
39

    
40
#if !defined(_WCHAR_T)
41
#define _WCHAR_T
42
typedef int                wchar_t;
43
#endif
44

    
45
typedef struct {
46
        int quot;                /* quotient */
47
        int rem;                /* remainder */
48
} div_t;
49

    
50
typedef struct {
51
        long quot;                /* quotient */
52
        long rem;                /* remainder */
53
} ldiv_t;
54

    
55
#ifndef NULL
56
#define        NULL        0
57
#endif
58

    
59
#define        EXIT_FAILURE        1
60
#define        EXIT_SUCCESS        0
61

    
62
#define        RAND_MAX        0x7fffffff
63

    
64
extern int __mb_cur_max;
65
#define        MB_CUR_MAX        __mb_cur_max
66

    
67
#include <sys/cdefs.h>
68

    
69
__BEGIN_DECLS
70
void         abort(void) __noreturn;
71
int         abs(int);
72
int         atexit(void (*)(void));
73
double         atof(const char *);
74
int         atoi(const char *);
75
long         atol(const char *);
76
void        *bsearch(const void *, const void *, size_t,
77
            size_t, int (*)(const void *, const void *));
78
void        *calloc(size_t, size_t);
79
div_t         div(int, int);
80
void         exit(int) __noreturn;
81
void         free(void *);
82
char        *getenv(const char *);
83
long         labs(long);
84
ldiv_t         ldiv(long, long);
85
void         mstat(void);
86
void        *malloc(size_t);
87
void         qsort(void *, size_t, size_t,
88
            int (*)(const void *, const void *));
89
int         rand(void);
90
void        *realloc(void *, size_t);
91
void         srand(unsigned);
92
double         strtod(const char *, char **);
93
long         strtol(const char *, char **, int);
94
unsigned long
95
         strtoul(const char *, char **, int);
96
int         system(const char *);
97

    
98
/* These are currently just stubs. */
99
int         mblen(const char *, size_t);
100
size_t         mbstowcs(wchar_t *, const char *, size_t);
101
int         wctomb(char *, wchar_t);
102
int         mbtowc(wchar_t *, const char *, size_t);
103
size_t         wcstombs(char *, const wchar_t *, size_t);
104

    
105
#ifndef _ANSI_SOURCE
106
int         putenv(const char *);
107
int         setenv(const char *, const char *, int);
108
#endif
109

    
110
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
111
#define alloca(x) __builtin_alloca(x)        /* built-in for gcc */
112

    
113
                                        /* getcap(3) functions */
114
char        *getbsize(int *, long *);
115
char        *cgetcap(char *, char *, int);
116
int         cgetclose(void);
117
int         cgetent(char **, char **, char *);
118
int         cgetfirst(char **, char **);
119
int         cgetmatch(char *, char *);
120
int         cgetnext(char **, char **);
121
int         cgetnum(char *, char *, long *);
122
int         cgetset(char *);
123
int         cgetstr(char *, char *, char **);
124
int         cgetustr(char *, char *, char **);
125

    
126
int         daemon(int, int);
127
char        *devname(int, int);
128
int         getloadavg(double [], int);
129

    
130
char        *group_from_gid(unsigned long, int);
131
int         heapsort(void *, size_t, size_t,
132
            int (*)(const void *, const void *));
133
char        *initstate(unsigned long, char *, long);
134
int         mergesort(void *, size_t, size_t,
135
            int (*)(const void *, const void *));
136
int         radixsort(const unsigned char **, int, const unsigned char *,
137
            unsigned);
138
int         sradixsort(const unsigned char **, int, const unsigned char *,
139
            unsigned);
140
long         random(void);
141
char        *realpath(const char *, char resolved_path[]);
142
char        *setstate(char *);
143
void         srandom(unsigned long);
144
char        *user_from_uid(unsigned long, int);
145
#ifndef __STRICT_ANSI__
146
long long
147
         strtoq(const char *, char **, int);
148
unsigned long long
149
         strtouq(const char *, char **, int);
150
#endif
151
void         unsetenv(const char *);
152
#endif
153

    
154
void        *malloc_r(size_t);
155
void         free_r(void *);
156

    
157
const char *getprogname(void);
158

    
159
__END_DECLS
160

    
161
#endif /* _STDLIB_H_ */