Annotation of prex-old/usr/include/stdlib.h, Revision 1.1
1.1 ! nbrk 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: #include <machine/ansi.h>
! 36:
! 37: #ifdef _BSD_SIZE_T_
! 38: typedef _BSD_SIZE_T_ size_t;
! 39: #undef _BSD_SIZE_T_
! 40: #endif
! 41:
! 42: #ifdef _BSD_WCHAR_T_
! 43: #ifndef _ANSI_SOURCE
! 44: typedef _BSD_WCHAR_T_ rune_t;
! 45: #endif
! 46: typedef _BSD_WCHAR_T_ wchar_t;
! 47: #undef _BSD_WCHAR_T_
! 48: #endif
! 49:
! 50: typedef struct {
! 51: int quot; /* quotient */
! 52: int rem; /* remainder */
! 53: } div_t;
! 54:
! 55: typedef struct {
! 56: long quot; /* quotient */
! 57: long rem; /* remainder */
! 58: } ldiv_t;
! 59:
! 60: #ifndef NULL
! 61: #define NULL 0
! 62: #endif
! 63:
! 64: #define EXIT_FAILURE 1
! 65: #define EXIT_SUCCESS 0
! 66:
! 67: #define RAND_MAX 0x7fffffff
! 68:
! 69: extern int __mb_cur_max;
! 70: #define MB_CUR_MAX __mb_cur_max
! 71:
! 72: #include <sys/cdefs.h>
! 73:
! 74: __BEGIN_DECLS
! 75: void abort(void) __noreturn;
! 76: int abs(int);
! 77: int atexit(void (*)(void));
! 78: double atof(const char *);
! 79: int atoi(const char *);
! 80: long atol(const char *);
! 81: void *bsearch(const void *, const void *, size_t,
! 82: size_t, int (*)(const void *, const void *));
! 83: void *calloc(size_t, size_t);
! 84: div_t div(int, int);
! 85: void exit(int) __noreturn;
! 86: void free(void *);
! 87: char *getenv(const char *);
! 88: long labs(long);
! 89: ldiv_t ldiv(long, long);
! 90: void mstat(void);
! 91: void *malloc(size_t);
! 92: void qsort(void *, size_t, size_t,
! 93: int (*)(const void *, const void *));
! 94: int rand(void);
! 95: void *realloc(void *, size_t);
! 96: void srand(unsigned);
! 97: double strtod(const char *, char **);
! 98: long strtol(const char *, char **, int);
! 99: unsigned long
! 100: strtoul(const char *, char **, int);
! 101: int system(const char *);
! 102:
! 103: /* These are currently just stubs. */
! 104: int mblen(const char *, size_t);
! 105: size_t mbstowcs(wchar_t *, const char *, size_t);
! 106: int wctomb(char *, wchar_t);
! 107: int mbtowc(wchar_t *, const char *, size_t);
! 108: size_t wcstombs(char *, const wchar_t *, size_t);
! 109:
! 110: #ifndef _ANSI_SOURCE
! 111: int putenv(const char *);
! 112: int setenv(const char *, const char *, int);
! 113: #endif
! 114:
! 115: #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
! 116: #define alloca(x) __builtin_alloca(x) /* built-in for gcc */
! 117:
! 118: /* getcap(3) functions */
! 119: char *getbsize(int *, long *);
! 120: char *cgetcap(char *, char *, int);
! 121: int cgetclose(void);
! 122: int cgetent(char **, char **, char *);
! 123: int cgetfirst(char **, char **);
! 124: int cgetmatch(char *, char *);
! 125: int cgetnext(char **, char **);
! 126: int cgetnum(char *, char *, long *);
! 127: int cgetset(char *);
! 128: int cgetstr(char *, char *, char **);
! 129: int cgetustr(char *, char *, char **);
! 130:
! 131: int daemon(int, int);
! 132: char *devname(int, int);
! 133: int getloadavg(double [], int);
! 134:
! 135: char *group_from_gid(unsigned long, int);
! 136: int heapsort(void *, size_t, size_t,
! 137: int (*)(const void *, const void *));
! 138: char *initstate(unsigned long, char *, long);
! 139: int mergesort(void *, size_t, size_t,
! 140: int (*)(const void *, const void *));
! 141: int radixsort(const unsigned char **, int, const unsigned char *,
! 142: unsigned);
! 143: int sradixsort(const unsigned char **, int, const unsigned char *,
! 144: unsigned);
! 145: long random(void);
! 146: char *realpath(const char *, char resolved_path[]);
! 147: char *setstate(char *);
! 148: void srandom(unsigned long);
! 149: char *user_from_uid(unsigned long, int);
! 150: #ifndef __STRICT_ANSI__
! 151: long long
! 152: strtoq(const char *, char **, int);
! 153: unsigned long long
! 154: strtouq(const char *, char **, int);
! 155: #endif
! 156: void unsetenv(const char *);
! 157: #endif
! 158:
! 159: void *malloc_r(size_t);
! 160: void free_r(void *);
! 161:
! 162: __END_DECLS
! 163:
! 164: #endif /* _STDLIB_H_ */
CVSweb