/* Copyright 1989, 1990, 1992 Digital Equipment Corporation All rights reserved. This software is furnished under a license and may be used and copied only in accordance with the terms of such license and with the inclusion of the above copyright notice. This software and any copies shall not be provided to any other person. No title to or ownership of the software is hereby transferred. The information in this software is subject to change without notice. DIGITAL assumes no responsibility for the use, functionality or reliability of its software on equipment which is not supplied by DIGITAL. stdlib.h Standard Library Definitions */ #ifndef __STDLIB_H #define __STDLIB_H /* Type definitions: */ #ifndef __DEFINED_SIZE_T #define __DEFINED_SIZE_T typedef unsigned int size_t; #endif #ifndef __DEFINED_WCHAR_T #define __DEFINED_WCHAR_T typedef unsigned char wchar_t; #endif typedef struct { int __quot, __rem; } div_t; typedef struct { long int __quot, __rem; } ldiv_t; /* Macro definitions: */ #ifndef __DEFINED_NULL_MACRO #define __DEFINED_NULL_MACRO #define NULL ((void *) 0) #endif #if defined(__VMS_HOST) || defined(__RSX_HOST) || defined(__RSTS_HOST) #define EXIT_FAILURE ( 2 ) #elif defined(__RT11_HOST) #define EXIT_FAILURE ( 4 ) #else #error Host for PDP-11 C undefined. #endif #define EXIT_SUCCESS ( 1 ) #define RAND_MAX ( 32767 ) #define MB_CUR_MAX ( 1 ) #ifndef __STDC__ #define __asr50 C$ASR5 #define __alr50 C$ASL5 #define __sr50a C$S5TA #define __lr50a C$L5TA #define atof C$ATOF #define atoi C$ATOI #define atol C$ATOL #define strtod C$STOD #define strtol C$STOL #define strtoul C$STUL #define rand C$RAND #define srand C$SRND #define calloc C$CLLC #define free C$FREE #define malloc C$MLLC #define realloc C$RLLC #define abort C$ABRT #define atexit C$ATEX #define exit C$EXIT #define getenv C$GENV #define system C$SYTM #define bsearch C$BSCH #define qsort C$QSRT #define abs C$ABS #define div C$DIV #define labs C$LABS #define ldiv C$LDIV #define mblen C$MBLN #define mbtowc C$MBWC #define wctomb C$WCMB #define mbstowcs C$MBSC #define wcstombs C$WCSB #endif /* Linkage definitions: */ #pragma linkage c __asr50, __alr50, __sr50a, __lr50a, #pragma linkage c atof, atoi, atol, strtod, strtol, strtoul #pragma linkage c rand, srand, #pragma linkage c calloc, free, malloc, realloc #pragma linkage c abort, atexit, exit, getenv, system, #pragma linkage c bsearch, qsort #pragma linkage c abs, labs, div, ldiv #pragma linkage c mblen, mbtowc, wctomb #pragma linkage c mbstowcs, wcstombs /* Radix-50 - ASCII conversion functions: */ short int __asr50 (char * __input, unsigned short int * __output); short int __alr50 (char * __input, unsigned long int * __output); void __sr50a (unsigned short int __input, char * __string); short int __lr50a (unsigned long int * __input, char * __string); /* String conversion functions: */ double atof (const char * __nptr); int atoi (const char * __nptr); long int atol (const char * __nptr); double strtod (const char * __nptr, char ** __endptr); long int strtol (const char * __nptr, char ** __endptr, int __base); unsigned long int strtoul (const char * __nptr, char ** __endptr, int __base); /* Pseudo-random sequence generation functions: */ int rand (void); void srand (unsigned int __seed); /* Memory management functions: */ void * calloc (size_t __nmemb, size_t __size); void free (void * __ptr); void * malloc (size_t __size); void * realloc(void * __ptr, size_t __size); /* Communication with the environment: */ void abort (void); int atexit (void (* __func)(void)); void exit (int __status); char * getenv (const char * __name); int system (const char * __string); /* Searching and sorting Utilities: */ void * bsearch (const void * __key, const void * __base, size_t __nmemb, size_t __size, int (* __compar)(const void *, const void *)); void qsort (void * __base, size_t __nmemb, size_t __size, int (* __compar)(const void *, const void *)); /* Integer arithmetic functions: */ int abs (int __j); div_t div (int __numer, int __denom); long int labs (long int __j); ldiv_t ldiv (long int __numer, long int __denom); /* Multibyte character functions: */ int mblen (const char * __s, size_t __n); int mbtowc (wchar_t * __pwc, const char * __s, size_t __n); int wctomb (char * __s, wchar_t __wchar); /* Multibyte string functions: */ size_t mbstowcs (wchar_t * __pwcs, const char * __s, size_t __n); size_t wcstombs (char * __s, const wchar_t * __pwcs, size_t __n); #endif