home *** CD-ROM | disk | FTP | other *** search
- #ifndef ANSIC_H
-
- #define ANSIC_H
-
- /*
- ** ID
- */
-
- #ifndef ID
- #ifndef lint
- #ifndef NOID
- #define ID(name, value) static char (name)[] = value;
- #endif /* !defined NOID */
- #endif /* !defined lint */
- #ifndef ID
- #define ID(name, value) /* static char (name)[] = value; */
- #endif /* !defined ID */
- #endif /* !defined ID */
-
- #ifndef ELSIEID
- #define ELSIEID(value) ID(elsieid, (value))
- #endif /* !defined ELSIEID */
-
- ID(ansichid, "@(#)ansic.h 4.1")
-
- /*
- ** Cover for stupid IBM PC/RT compilers (pcc and hc);
- ** they fib about being __STDC__ when they lack standard header files
- ** ("locale.h" for one).
- */
-
- #ifdef ibm032
- #undef __STDC__
- #define VOID_OK
- #endif /* defined ibm032 */
-
- #ifdef sgi
- #define STDIO_H <stdio.h>
- #define MATH_H <math.h>
- #define remove unlink
- #endif /* defined sgi */
-
- /*
- ** const
- */
-
- #ifndef const
-
- #ifndef CONST_OK
- #ifndef CONST_NO
- #ifdef __convexc__
- /*
- ** Workaround for Convex CC bug that muffs
- ** func(int * const * const p){}
- */
- #define CONST_NO
- #endif /* defined __convexc__ */
- #endif /* !defined CONST_NO */
- #endif /* !defined CONST_OK */
-
- #ifndef CONST_OK
- #ifndef CONST_NO
- #ifdef __STDC__
- #define CONST_OK
- #endif /* defined __STDC__ */
- #endif /* !defined CONST_NO */
- #endif /* !defined CONST_OK */
-
- #ifndef CONST_OK
- #define const
- #endif /* !defined CONST_OK */
-
- #endif /* !defined const */
-
- /*
- ** void
- */
-
- #ifndef void
-
- #ifndef VOID_NO
- #ifndef VOID_OK
-
- #ifdef __STDC__
- #define VOID_OK
- #endif /* defined __STDC__ */
-
- #ifdef sun
- #define VOID_OK
- #endif /* defined sun */
-
- #ifdef __convexc__
- #define VOID_OK
- #endif /* defined __convexc__ */
-
- #endif /* !defined VOID_OK */
- #endif /* !defined VOID_NO */
-
- #ifndef VOID_OK
- #define void char
- #endif /* !defined VOID_OK */
-
- #endif /* !defined void */
-
- /*
- ** P((args))
- */
-
- #ifndef P
-
- #ifndef PROTO_OK
- #ifndef PROTO_NO
- #ifdef __STDC__
- #define PROTO_OK
- #endif /* defined __STDC__ */
- #endif /* !defined PROTO_NO */
- #endif /* !defined PROTO_OK */
-
- #ifdef PROTO_OK
- #define P(x) x
- #endif /* defined PROTO_OK */
-
- #ifndef PROTO_OK
- #define P(x) ()
- #endif /* !defined PROTO_OK */
-
- #endif /* !defined P */
-
- /*
- ** Includes. First the ones we expect to show up on all systems.
- */
-
- /*
- ** <assert.h>
- */
-
- #ifdef ASSERT_H
- #include ASSERT_H
- #endif /* defined ASSERT_H */
-
- #ifndef ASSERT_H
- #include "assert.h"
- #endif /* !defined ASSERT_H */
-
- /*
- ** <ctype.h>
- */
-
- #ifdef CTYPE_H
- #include CTYPE_H
- #endif /* defined CTYPE_H */
-
- #ifndef CTYPE_H
- #include "ctype.h"
- #ifdef sun
- #ifndef tolower
- extern int tolower P((
- int /*c*/
- ));
- extern int toupper P((
- int /*c*/
- ));
- #endif /* !defined tolower */
- #endif /* defined sun */
- #endif /* !defined CTYPE_H */
-
- /*
- ** <errno.h>
- */
-
- #ifdef ERRNO_H
- #include ERRNO_H
- #endif /* defined ERRNO_H */
-
- #ifndef ERRNO_H
- #include "errno.h"
- #ifndef errno
- extern int errno;
- #endif /* !defined errno */
- #endif /* !defined ERRNO_H */
-
- /*
- ** <math.h>
- */
-
- #ifdef MATH_H
- #include MATH_H
- #endif /* defined MATH_H */
-
- #ifndef MATH_H
- #include "math.h"
- #ifndef __STDC__
- #ifndef mips
- /*
- ** This declaration is missing in the 4.1BSD math.h;
- ** we'll play it safe.
- */
- extern double erf();
- #endif /* !defined mips */
- #endif /* !defined __STDC__ */
- #endif /* !defined MATH_H */
-
- /*
- ** <setjmp.h>
- */
-
- #ifdef SETJMP_H
- #include SETJMP_H
- #endif /* defined SETJMP_H */
-
- #ifndef SETJMP_H
- #include "setjmp.h"
- #endif /* !defined SETJMP_H */
-
- /*
- ** <signal.h>
- */
-
- #ifdef SIGNAL_H
- #include SIGNAL_H
- #endif /* defined SIGNAL_H */
-
- #ifndef SIGNAL_H
- #include "signal.h"
- #ifdef mips
- /*
- ** For the benefit of MIPS boxes, where signal isn't declared.
- */
- extern void (* signal P((
- int /*sig*/,
- void (* /*func*/)()
- )))();
- #endif /* defined mips */
- #endif /* !defined SIGNAL_H */
-
- /*
- ** <stdio.h>
- */
-
- #ifdef STDIO_H
- #include STDIO_H
- #endif /* defined STDIO_H */
-
- #ifndef STDIO_H
- #include "stdio.h"
-
- /*
- ** We get to do stdio prototypes if we are not __STDC__ or we are __GNUC__
- */
-
- #ifndef DO_STDIO_PROTOS
- #ifdef __GNUC__
- #define DO_STDIO_PROTOS
- #endif /* defined __GNUC__ */
- #endif /* !defined DO_STDIO_PROTOS */
-
- #ifndef DO_STDIO_PROTOS
- #ifndef __STDC__
- #ifndef __convexc__
- #define DO_STDIO_PROTOS
- #endif /* !defined __convexc__ */
- #endif /* !defined __STDC__ */
- #endif /* !defined DO_STDIO_PROTOS */
-
- #ifdef DO_STDIO_PROTOS
- extern int fclose P((
- FILE * /*stream*/
- ));
- extern int fflush P((
- FILE * /*stream*/
- ));
- extern int fprintf P((
- FILE * /*stream*/,
- const char * /*format*/,
- ...
- ));
- extern int fputc P((
- int /*c*/,
- FILE * /*stream*/
- ));
- extern int fputs P((
- const char * /*s*/,
- FILE * /*stream*/
- ));
- extern int fread P((
- void * /*p*/,
- int /*s*/,
- int /*n*/,
- FILE * /*stream*/
- ));
- extern int fscanf P((
- FILE * /*stream*/,
- const char * /*format*/,
- ...
- ));
- extern int fseek P((
- FILE * /*stream*/,
- long int /*offset*/,
- int /*whence*/
- ));
- extern int fwrite P((
- const void * /*p*/,
- int /*s*/,
- int /*n*/,
- FILE * /*stream*/
- ));
- extern int printf P((
- const char * /*format*/,
- ...
- ));
- extern int scanf P((
- const char * /*format*/,
- ...
- ));
- extern int sscanf P((
- const char * /*string*/,
- const char * /*format*/,
- ...
- ));
- extern char * tmpnam P((
- const char * /*name*/
- ));
- extern int ungetc P((
- int /*c*/,
- FILE * /*stream*/
- ));
- /*
- ** To prevent gcc squawks when in "prototypes required" mode. . .
- */
- extern int _filbuf P((
- FILE * /*stream*/
- ));
- extern int _flsbuf P((
- unsigned char /*c*/,
- FILE * /*stream*/
- ));
-
- /*
- ** And last but not least among the common stuff. . .
- */
- #ifndef remove
- extern int unlink P((
- const char * /*filename*/
- ));
- #define remove unlink
- #endif /* !defined remove */
-
- #ifdef USG
- extern void rewind P((
- FILE * /*stream*/
- ));
- #ifndef sun
- extern int sprintf P((
- char * /*string*/,
- const char * /*format*/,
- ...
- ));
- #endif /* !defined sun */
- #endif /* defined USG */
- #ifndef USG
- extern int rewind P((
- FILE * /*stream*/
- ));
- #ifndef sun
- extern char * sprintf P((
- char * /*string*/,
- const char * /*format*/,
- ...
- ));
- #endif /* !defined sun */
- #endif /* !defined USG */
-
- #endif /* defined DO_STDIO_PROTOS */
-
- #endif /* !defined STDIO_H */
-
- /*
- ** <string.h>
- */
-
- #ifdef STRING_H
- #include STRING_H
- #endif /* defined STRING_H */
-
- #ifndef STRING_H
- #include "string.h"
- #ifdef sun
- #include "memory.h"
- #endif /* defined sun */
- #endif /* !defined STRING_H */
-
- /*
- ** <time.h>
- */
-
- #ifdef TIME_H
- #include TIME_H
- #endif /* defined TIME_H */
-
- #ifndef TIME_H
- #include "time.h"
- #endif /* !defined TIME_H */
-
- /*
- ** ANSI inventions--float, limits, locale, stdarg, stddef, and stdlib.
- ** GCC 1.28 comes with stddef.h, but using it causes clashes if you
- ** also (directly or indirectly) include <sys/types.h>. So we don't
- ** use it here.
- */
-
- #ifdef __STDC__
-
- #ifndef LIMITS_H
- #define LIMITS_H "limits.h"
- #endif /* !defined LIMITS_H */
-
- #ifndef __GNUC__
-
- #ifndef STDARG_H
- #define STDARG_H "stdarg.h"
- #endif /* !defined STDARG_H */
-
- #ifndef FLOAT_H
- #define FLOAT_H "float.h"
- #endif /* !defined FLOAT_H */
-
- #ifndef LOCALE_H
- #define LOCALE_H "locale.h"
- #endif /* !defined LOCALE_H */
-
- #ifndef STDDEF_H
- #define STDDEF_H "stddef.h"
- #endif /* !defined STDDEF_H */
-
- #ifndef STDLIB_H
- #define STDLIB_H "stdlib.h"
- #endif /* !defined STDLIB_H */
-
- #endif /* !defined __GNUC__ */
- #endif /* defined __STDC__ */
-
- #ifdef FLOAT_H
- #include FLOAT_H
- #endif /* defined FLOAT_H */
-
- #ifdef LIMITS_H
- #include LIMITS_H
- #endif /* defined LIMITS_H */
-
- #ifndef CHAR_BIT
- #define CHAR_BIT 8
- #endif /* !defined CHAR_BIT */
-
- #ifndef USHRT_MAX
- #define USHRT_MAX ((unsigned short) ~0)
- #endif /* !defined USHRT_MAX */
-
- #ifdef LOCALE_H
- #include LOCALE_H
- #endif /* defined LOCALE_H */
-
- #ifdef STDARG_H
- #include STDARG_H
- #endif /* defined STDARG_H */
-
- #ifdef STDDEF_H
- #include STDDEF_H
- #endif /* defined STDDEF_H */
-
- #ifdef STDLIB_H
- #include STDLIB_H
- #endif /* defined STDLIB_H */
-
- #ifndef STDLIB_H
- extern int atoi P((
- const char * /*nptr*/
- ));
- extern char * getenv P((
- const char * /*name*/
- ));
- extern char * malloc P((
- unsigned /*size*/
- ));
- extern char * calloc P((
- unsigned /*nelem*/,
- unsigned /*elsize*/
- ));
- extern char * realloc P((
- void * /*pointer*/,
- unsigned /*size*/
- ));
- extern int system P((
- const char * /*command*/
- ));
- extern int abs P((
- int /*j*/
- ));
-
- #ifdef USG
- extern void exit P((
- int /*status*/
- ));
- extern void free P((
- void * /*pointer*/
- ));
- extern void qsort P((
- void * /*base*/,
- unsigned /*nmemb*/,
- unsigned /*size*/,
- int (*/*compar*/)(
- const void * /*left*/,
- const void * /*right*/
- )
- ));
- #endif /* defined USG */
- #ifndef USG
- #ifdef sun
- extern void exit P((
- int /*status*/
- ));
- #endif /* defined sun */
- #ifndef sun
- extern int exit P((
- int /*status*/
- ));
- #endif /* !defined sun */
- extern int free P((
- void * /*pointer*/
- ));
- extern int qsort P((
- void * /*base*/,
- unsigned /*nmemb*/,
- unsigned /*size*/,
- int (*/*compar*/)(
- const void * /*left*/,
- const void * /*right*/
- )
- ));
- #endif /* !defined USG */
- #endif /* !defined STDLIB_H */
-
- #ifndef EXIT_FAILURE
- #define EXIT_FAILURE 1
- #endif /* !defined EXIT_FAILURE */
-
- #ifndef EXIT_SUCCESS
- #define EXIT_SUCCESS 0
- #endif /* !defined EXIT_SUCCESS */
-
- /*
- ** One last bit of business. . .
- */
-
- #ifndef isascii
- #define isascii(a_r_g) (((unsigned) (a_r_g)) <= 127)
- #endif /* !defined isascii */
-
- #endif /* !defined ANSIC_H */
-