/*
 * $RCSfile: global.h,v $
 *
 * x-kernel v3.3
 *
 * Copyright (c) 1993,1991,1990,1996  Arizona Board of Regents
 *
 * $Log: global.h,v $
 * Revision 1.2  1996/01/27 00:13:01  slm
 * Updated copyright and version.
 *
 * Revision 1.1  1995/07/29  03:08:13  slm
 * Initial revision
 *
 * Revision 1.18.2.1  1994/05/31  19:55:52  menze
 * Added support for general source-filename extensions
 *
 * Revision 1.18  1994/04/07  23:24:47  menze
 *   [ 1994/03/08          menze ]
 *   added 'romopt' and 'romfile' entries, allowing rom files and options
 *   to be statically configured at compose/compile time
 *
 * Revision 1.17  1994/02/04  23:41:43  menze
 *   [ 1994/01/04          menze ]
 *   Name of make variable (naming the platform include file) changed.
 *
 * Revision 1.16  1993/12/17  00:55:19  menze
 * Fixed #endif comment
 */

#define MAX_FILES 20
#define MAX_PROTOCOL 50

typedef struct {
    char *	name;
    char *	instance;
    int		index;		/* index into instance table */
} ProtName;

typedef struct {
    char *	name;
    char *	value;
    int		instantiate;
} TraceVar;

typedef enum {
    INIT_NOT_DONE,
    INIT_WORKING,
    INIT_DONE
} InitState;

typedef struct protocol {
    ProtName	n;
    char *	path;
    char *	trace;	  /* String rep. of initial value of trace variable */
    char *	traceVar; /* String rep. of name of trace variable */
    int		numfiles;
    struct {
	char *	base;
	char *	ext;
    } files[MAX_FILES + 1];
    int 	numdown;
    ProtName	down[MAX_PROTOCOL + 1];
    InitState	initState;
    int		isDriver;
    TraceVar	*tv;
} PROTOCOL;

extern int	fileLine;
extern int	filePosition;

#ifdef __STDC__

void	addInstance( PROTOCOL * );
void	addProtTbl( char *name );
void	addRomFile( char *name );
void	addRomOption( char *name );
TraceVar	*addTraceVar( char *name, char * value, int instantiate );
void	errorCycle( void );
void	errorCycleName( char * );
void	errorFile( char *s );
void	errorLaterInstanceFiles( PROTOCOL * );
void	errorProtlUndefined( char *p1, char *p2 );
void    errorRomLineTooLong(char *);
void	errorTooManyStates( void );
void	finishErrorCycle( void );
char *	join( char *, char * );
void	lastDriver( void );
void	parse( void );
void	syntaxErrorChar( char expected, char got );
void	syntaxErrorString( char *expected );
char *	xerox( char * );
void 	warnCouldNotAccess( char * );
void	warnDefaultPtblNotSupported( void );
void	warnProtNotFound( char * );
void	warnReassignedTraceValue( char * );

#endif /* __STDC__ */

#include PLATFORM_INCLUDE
