|
|
1.1 root 1: /* (-lgl
2: * COHERENT Version 3.2
3: * Copyright (c) 1982, 1991 by Mark Williams Company.
4: * All rights reserved. May not be copied without permission.
5: -lgl) */
6: /*
7: * stdlib.h
8: * C general utilities library header.
9: * Draft Proposed ANSI C Standard, Section 4.10, 12/7/88 draft.
10: */
11:
12: #ifndef _STDLIB_H
13: #define _STDLIB_H
14:
15: /* Macros. */
16: #define EXIT_FAILURE 1
17: #define EXIT_SUCCESS 0
18: #define MB_CUR_MAX 1
19: #define RAND_MAX 32767
20:
21: /* Types. */
22: typedef struct { int quot; int rem; } div_t; /* div result type */
23: typedef struct { long quot; long rem; } ldiv_t; /* ldiv result type */
24: #ifndef _SIZE_T
25: #define _SIZE_T
26: typedef unsigned int size_t; /* sizeof result type */
27: #endif
28: #ifndef _WCHAR_T
29: #define _WCHAR_T
30: typedef char wchar_t; /* extended character set type */
31: #endif
32: #define Void char /* Use "Void *" as generic pointer type */
33: #define const /* Ignore type modifier "const" */
34: #ifndef NULL
35: #define NULL ((char *)0) /* null pointer constant */
36: #endif
37:
38: /*
39: * Functions in /lib/libc.a corresponding to ANSI <stdlib.h>.
40: * N.B. The behavior of these functions is not guaranteed to
41: * comply with the ANSI standard;
42: * see the COHERENT documentation for details on each function.
43: */
44: extern void abort( /* void */ );
45: extern int abs( /* int j */ );
46: extern double atof( /* const char *nptr */ );
47: extern int atoi( /* const char *nptr */ );
48: extern long int atol( /* const char *nptr */ );
49: extern Void *bsearch( /* const void *key,
50: const void *base,
51: size_t nmemb,
52: size_t size,
53: int (*compar)(const void *, const void *) */ );
54: extern Void *calloc( /* size_t nmemb, size_t size */ );
55: extern div_t div( /* int numer, int denom */ );
56: extern void exit( /* int status */ );
57: extern void free( /* Void *ptr */ );
58: extern char *getenv( /* const char *name */ );
59: extern long int labs( /* long int j */ );
60: extern ldiv_t ldiv( /* long int numer, long int denom */ );
61: extern Void *malloc( /* size_t size */ );
62: extern void qsort( /* void *base, size_t nmemb, size_t size,
63: int (*compar)(const void *, const void *) */ );
64: extern int rand( /* void */ );
65: extern Void *realloc( /* void *ptr, size_t size */ );
66: extern void srand( /* unsigned int seed */ );
67: extern double strtod( /* const char *nptr, char **endptr */ );
68: extern long int strtol( /* const char *nptr, char **endptr, int base */ );
69: extern unsigned long strtoul( /* const char *nptr, char **endptr, int base */ );
70: extern int system( /* const char *string */ );
71:
72: #if 0
73: /*
74: * Functions in ANSI <stdlib.h> not currently implemented in COHERENT libc.a.
75: */
76: extern int atexit( /* void (*func)(void) */ );
77: extern int mblen( /* const char *s, size_t n */ );
78: extern int mbtowc( /* wchar_t *pwc, const char *s, size_t n */ );
79: extern size_t mbstowcs(/* wchar_t *pwcs, const char *s, size_t n */ );
80: extern size_t wcstombs(/* char *s, const wchar_t *pwcs, size_t n */ );
81: extern int wctomb( /* char *s, wchar_t wchar */ );
82: #endif
83:
84: /* Internal function. */
85: extern double _pow10 ();
86:
87: #endif
88:
89: /* end of stdlib.h */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.