/*

    FILE:  COMMON.H

           This header file is useful for automatically including the
           commonly used system include files required by any one
           of the compilers below.

           To use this file, simply type

               #include "common.h"

           in place of #include <stdio.h>, #include <math.h>, etc.
           Be sure that if you need other, more specialized header
           files not among those listed below, you #include them separately.

           If you are not using any of the compilers listed below, then check
           your compiler manual carefully to set up an appropriate list of
           included files.  Subtle but disastrous errors can result from not
           including the necessary headers.  If your compiler does not have
           header files for library functions that return nonintegers, you
           must also declare those functions with the appropriate return type.

*/

#ifndef common_included
#define common_included

#include <stdio.h>                    /* most compilers need this file */
#include <ctype.h>                    /* isalpha and similar */
#include <math.h>                     /* mathematical functions */
#include "dbhost.h"                   /* COMPILER, etc */

#if (COMPILER == VAX_VMS_C)
#define unlink delete                 /* file deleting function */
#define remove delete
#else

#if (COMPILER == MICROSOFT_C)
#include <malloc.h>                   /* memory allocation routines */
#include <string.h>                   /* string routines */
#else

#if (COMPILER == TURBO_C)
#include <stdlib.h>                   /* memory allocation routines */
#include <string.h>                   /* string routines */
#define VBUF                          /* setvbuf() available */
#else

#if (COMPILER == BERKELEY_UNIX_C)
#include <string.h>                   /* string routines */
#include <malloc.h>                   /* malloc() & realloc() */
/*extern char *calloc();  */              /* no header file for calloc function */
#define remove unlink                 /* no remove function */
#define VBUF                          /* setvbuf() available */
#else

#if (COMPILER == ANSI_C)
#include <string.h>                   /* string routines */
#include <stdlib.h>                   /* malloc() & realloc() */
#define VBUF                          /* setvbuf() available */
#else

#if (COMPILER == HP_UNIX_C)
#include <string.h>                   /* string routines */
#include <malloc.h>                   /* malloc() & realloc() */
#define remove unlink                 /* no remove function */
#define VBUF                          /* setvbuf() available */
#endif
#endif
#endif
#endif
#endif
#endif

/*
       FILE STATUS

   The following lines define some masks used by the file i/o procedures.
   These masks are usually defined in the compiler's include i/o files.
   If they have not been defined, the defaults for the VAX/VMS system are
   assigned to them.

*/
#ifndef NUL                           /* Let's C distinguishes between */
#define NUL                '\0'       /* the NULL pointer and the NUL  */
#endif                                /* character                     */

#ifndef SEEK_SET                      /* file location for seek        */
#define SEEK_SET           0          /* routines                      */
#endif                                /* SEEK_SET = file beginning     */

#ifndef SEEK_CUR
#define SEEK_CUR           1
#endif                                /* SEEK_CUR = current position   */

#ifndef SEEK_END
#define SEEK_END           2
#endif                                /* SEEK_END = end of file        */

#ifndef M_PI
#define M_PI 3.1415926               /* some math.h lack M_PI etc. */
#endif

#endif  /* ifndef common_included */
