/*
 *   FILE : defs.h
 *   contains global definitions of the PASCAL-XSC to C compiler and
 *   its configuration program
 *
 *  creation date:  05.03.91  18:02
{*  last modification:  14.08.92  12:44   }

 *  uli 26.07.91: PATtern added.
 *  uli 12.11.91: FILENAME_MAX redefined, if < 64
 *  uli 04.02.92: IBMva if not LINT_ARGS
 *  uli 14.05.92: NOBRACKETS added.
 *  PJ  31.07.92: Comment for NOBRACKETS added
 *  PJ  03.08.92: DEMOVERSION added.
 *  PJ  14.08.92: CASE_SENSITVE added
*/

/* #define DEMOVERSION  */
          /* PJ 03.08.92 :  Change this to non-comment, if you want to
                            create a demo version of the compiler       */

#define CASE_SENSITIVE 1
     /* PJ 14.08.92 : Set this to 0, if you create a version for
                      operating systems like MS-DOS, which do not
                      distinguish upper and lower case file names  */

#ifndef IMPORTED

#define LINT_ARGS
                /* define LINT_ARGS, if the C-Compiler supports */
                /* new-style prototype declarations. */
#ifndef LINT_ARGS
#define IBMva
                /* old style variable argument lists */
#endif
                /* must be defined for PS2 AIX       */
/* #define IBMva */
                /* IBM style variable argument lists */

/* #define UNIX */
                /* currently unused */
/* #define GEM */
                /* Stop after compilation to save screen */
#define INTERMEDIATE 0
                /* define as 0, if generate should be called after compilation*/
                /* define as 1, if generate should be intersperced */

/* #define NOBRACKETS */
                /* define NOBRACKETS, if compiler should generate trigraph */
                /*  sequences ??( and ??) instead of brackets */
                /* PJ 31.07.92 : The scanner now reads trigraph characters
                                 when NOBRACKETS is defined.                */


          /* Initial value for the corresponding variables */
          /* the variables may be patched */

#define      PATHchar    '/'      /* for UNIX */
/* #define   PATHchar    '\\' */  /* for DOS  */
/* #define   PATHchar    ']'  */  /* for VMS  */
#define      POINT       '.'      /* separates filename and extension */

#define      SYSdir      "/usr/pxsc/sys/" /* system directory */
#define      USRdir      "/pxsc/"       /* user directory, prefixed by $HOME */
#define      ENVfnam     "p88.env"      /* configuration file name */
#define      PATtern     "patterns.bin" /* pattern file name */
#define     LINKinfo     "linkinfo.tmp" /* link information file */
#define      RTIfnam     "p88rts.i"     /* runtime system interface */
#define      ERRmess     "errmess.tmp"  /* filename of error message file */

#if CASE_SENSITIVE
#define      STDmod      "stdmod"       /* module name of standard module */
                                        /* end of patch area */
#else
#define      STDmod      "STDMOD"
#endif

#define      SCREENlength 24          /* number of lines on screen */

                        /* maximal length of filenames is defined in ANSI C */
#ifndef      FILENAME_MAX
#define      FILENAME_MAX   127
#else
#if          FILENAME_MAX < 64
#undef       FILENAME_MAX
#define      FILENAME_MAX   127
#endif
#endif


  /* default-values of file name extensions; */
  /* normally overridden by the configuration file p88.env */
#define   SRCfext   ".p"
#define   CODfext   ".c"
#define   DCLfext   ".h"
#define   INTfext   ".mod"
#define   LSTfext   ".lst"
#define   DMPfext   ".dmp"
#define   MODfext   ".mod"       /* same as INTfext */
#define   OBJfext   ".o"         /* objektfile extension -> linker */
#define   LIBfext   ".a"         /* library extension -> linker */
#define   EXEfext   ".exe"       /* executable file */

#define   NAMElength    8


                                      /* environment variables */
#define      HOME        "HOME"       /* users home directory */
#define      P88USR      "PXSC_USR"   /* user p88 directory */
#define      P88SYS      "PXSC_SYS"   /* system directory */
#define      P88EDIT     "PXSC_EDIT"  /* users editor name */
#define      P88LIB      "PXSC_LIB"   /* linker post options */

                              /* delimiters of the configuration file */
#define  options     'o'
#define  includes    'i'
#define  extensions  'e'
#define  paths       'p'
#define  delimiter   '\n'




/* Algol68-style */
#define IF if(
#define THEN ){
#define ELIF }else if(
#define ELSE }else{
#define FI }

#define FOR for(
#define DO ){
#define OD }
#define WHILE while(

/* Pascal-style*/
#define begin       {
#define end         }
#define repeat      do begin
#define until(expr) end while (! (expr))
#define then
#define nil         (char *)0
#define true        1
#define false       0

#define BEGIN(proc) begin
#define END         end
#define RETURN(val) return(val)
#define VAL(val)    ={val}

#define local       static

#define shortint    short int
#define longint     long
#define boolean     char
#define byte        unsigned char

#define mod         %
#define div         /
#define not         (boolean)!
#define and         &&
#define or          ||
#define isletter(ch)  ((isalpha(ch)) or ch=='_')

#ifndef LINT_ARGS
#define const
#endif

#define IMPORTED
#endif
