/***********************************
  (C) Copyright 1993; dit/upm
   Distributed under the conditions stated in the
   TOPO General Public License (see file LICENSE)
 ***********************************
 $Log: context.h,v $
 * Revision 1.6  1995/01/20  14:43:47  lotos
 * new function -main & -compiler
 *
 * Revision 1.5  1994/12/19  15:12:20  lotos
 * prototypes integrated into topo
 * new pieces convention, and integrated into topo
 * clean objects
 *
 * Revision 1.4  1994/11/21  16:32:46  lotos
 * port to msdos
 *
 * Revision 1.3  1993/10/19  11:58:36  lotos
 * add Xlola
 *
 * Revision 1.2  1993/09/30  13:17:15  lotos
 * context file may be explicit
 *
 * Revision 1.1  1993/06/29  18:55:05  lotos
 * Initial revision
 *
 ***********************************/

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>

/* KJT 11/03/98: added for NS/OS */
#ifdef __NeXT__
#include <libc.h>
#endif

#include "info.h"

#ifndef TRUE
# define TRUE  1
# define FALSE 0
#endif

#ifdef MSDOS
# define DIRSEP '/'
# define REDIR ""
# define DEVNULL "NUL"
# define OBJEXT "o"
#else
# define DIRSEP '/'
# define REDIR "1>&2"
# define DEVNULL "/dev/null"
# define OBJEXT "o"
#endif

#define shift argc--; argv++

#define PUBLIC
#define PRIVATE static
#define SHARED  extern

SHARED char filename[BUFSIZ];
SHARED char command[BUFSIZ];
SHARED char buffer[BUFSIZ];
SHARED int FlagVerbose;

#define VSIZE 128

SHARED char SPEC[VSIZE];
SHARED char CONTEXT[VSIZE];
SHARED char TOPO[VSIZE];
SHARED char TOPOINC[VSIZE];
SHARED char TOPOLIB[VSIZE];
SHARED char TOPOBIN[VSIZE];
SHARED char TOPOSTDLIB[VSIZE];

SHARED char LIB[VSIZE];
SHARED char LIBLOT[VSIZE];
SHARED char LIBLSA[VSIZE];

SHARED char LANGUAGE[VSIZE];
SHARED char TNAME[VSIZE];
SHARED char DNAME[VSIZE];
SHARED char TPCS[VSIZE];
SHARED char DPCS[VSIZE];
SHARED char GLDLIB[VSIZE];
SHARED char MAKEFILE[VSIZE];
SHARED int Modified;

SHARED char TMP[VSIZE];
SHARED char MAKE[VSIZE];

SHARED char LSA[VSIZE];
SHARED char GLAD[VSIZE];
SHARED char IDLE[VSIZE];
SHARED char OMLBC[VSIZE];
SHARED char D2C[VSIZE];
SHARED char LOLA[VSIZE];
SHARED char XLOLA[VSIZE];

SHARED char TOPOF_LFE[VSIZE]	;
SHARED char TOPOF_LSA[VSIZE]	;
SHARED char TOPOF_GLAD[VSIZE]	;
SHARED char TOPOF_OM[VSIZE]	;
SHARED char TOPOF_OMLBC[VSIZE]	;
SHARED char TOPOF_IDLE[VSIZE]	;
SHARED char TOPOF_D2H[VSIZE]	;
SHARED char TOPOF_D2C[VSIZE]	;

SHARED char OMLBADA[VSIZE];
SHARED char D2ADA_B[VSIZE];
SHARED char TOPOF_OMLBADA[VSIZE]	;
SHARED char TOPOF_D2ADA[VSIZE]	;
SHARED char TOPOF_D2ADA_B[VSIZE]	;
SHARED char TOPOF_ADACPL[VSIZE]	;
SHARED char TOPOF_ADARTS[VSIZE]	;

PUBLIC int read_ok ();
PUBLIC void read_env ();
PUBLIC void read_ctx ();
PUBLIC void write_ctx ();
PUBLIC void list_ctx ();

PUBLIC int my_system ();

PUBLIC void unlink_pcs ();

void	Cgenmake (/* file */);
int	CBuildBehaviour ();
void	CCleanBehaviour ();
int	CBuildData ();
int	CBuildMain ();
int	CBuildCompiler ();
void	CCleanData ();
void	CCleanObject ();

void	Adagenmake (/* file */);
int	AdaBuildBehaviour ();
void	AdaCleanBehaviour ();
int	AdaBuildData ();
int	AdaBuildMain ();
int	AdaBuildCompiler ();
void	AdaCleanData ();
void	AdaCleanObject ();

