/*
 *  MODULE  :   sysutil.h
 *              filename-handling and system-utilities
 *
{*  last modification:  17.12.91  13:37   }

 *  uli 14.1.91 : genenv added
 *  uli 04.02.91 : objmain added
 *  uli 18.02.91 : getenv has const parameter.
 *  uli 06.03.91 : prognam added
 *  uli 06.03.91 : fnaminit has parameter now
 *  uli 07.03.91 : FILENAME_MAX moved to defs.h
 *  uli 08.03.91 : errfnam, exefnam added. Used by manager.
 *  uli 17.04.91 : p88_fgets added.
 *  uli 19.04.91 : srcext, objext, libext and objelen added.
 *  uli 22.04.91 : sysdir, linkinfo added.
 *  uli 21.05.91 : dclinam  added.
 *  uli 26.07.91 : patterns added.
 *  uli 05.09.91 : exeext and pathch added. exefnam moved to depend.h
 *  uli 17.12.91 : namelength added.
*/
 
/* #define  TIMER  */                /* report used time */
 
#ifdef TIMER
#include <time.h>
global  clock_t  tp0, tp1;      /* total processor-time, start and end */
global  clock_t  sp0, sp1;      /* processor-time for subroutines */
global  time_t   tc0, tc1;      /* total calendar-time */
#endif

				 /* global variables, used by manager */
extern char  sysdir [] ;         /* system directory string */
extern char patterns[] ;         /* filename string */
extern char linkinfo[] ;         /* filename string */
extern int  namelength ;         /* max. length of C-names */
 
#ifdef LINT_ARGS
 
extern char* getenv     (const char*);    /* should be declared in stdlib.h */
global char* p88_fgets  (char*,int,FILE*); /* replaces fgets */
global char* setdefault (void);   /* setting defaults, uses enviroment-file */
global void  fnaminit   (char*);     /* initialisation of filename-handling */
global char* prognam    (void);               /* filename without extension */
global char* codfnam    (void);                /* name of C-code outputfile */
global char* dclfnam    (void);      /* C Header-file with path for writing */
global char* dclinam    (void);   /* C Header-file without path for include */
global char* intfnam    (void);    /* Interface filename of current program */
global char  pathch     (void);                 /* path delimiter character */
global char* srcext     (void);             /* source extension for manager */
global char* objext     (void);             /* object extension for manager */
global char* libext     (void);            /* library extension for manager */
global char* exeext     (void);         /* executable extension for manager */
global char* srcfnam    (void);            /* source-file, used for merging */
global char* lstfnam    (void);            /* listing file, used by error.c */
global int   objelen    (void);      /* object extension length for manager */
global char* objmain    (void);       /* object file of the current program */
global char* modfnam    (char*);   /* name of interface of imported modules */
					 /* searches for the interface file */
global char* dmpfnam    (void);                            /* dump filename */
global char* rtsfnam    (void);            /* path and filename of p88rts.i */
global char* lnkfnam    (void);             /* name of info-file for linker */
global char* objfnam    (char*);         /* name of objectfile (C-Compiler) */
global char* errfnam    (void);               /* name of error message file */
global char* dclfpath   (char*);      /* header-file with path of interface */
 
#ifdef TIMER
global void  time_in    (char);
global void  time_out   (char, char*);
global void  total_in   (void);
global void  total_out  (void);
#endif

global void  finish     (int status);   /* == exit () */
 
#else
 
extern char* getenv     ( );
global char* p88_fgets  ( );
global char* setdefault ( );
global void  fnaminit   ( );
global char* prognam    ( );
global char* codfnam    ( );
global char* dclfnam    ( );
global char* dclinam    ( );
global char* intfnam    ( );
global char  pathch     ( );
global char* srcext     ( );
global char* objext     ( );
global char* libext     ( );
global char* exeext     ( );
global char* srcfnam    ( );
global char* lstfnam    ( );
global int   objelen    ( );
global char* objmain    ( );
global char* modfnam    ( );
global char* dmpfnam    ( );
global char* rtsfnam    ( );
global char* lnkfnam    ( );
global char* objfnam    ( );
global char* errfnam    ( );
global char* dclfpath   ( );
 
#ifdef TIMER
global void  time_in    ( );
global void  time_out   ( );
global void  total_in   ( );
global void  total_out  ( );
#endif
 
global void  finish     ( );

#endif
 
