/* This symbol must always be defined when compiling for Motif.  This is to
 * ensure that the correct set of Xt header files are used (ie those in
 * /usr/include/Xm rather than the X11 Release 4 ones in /usr/include/X11).
 * All the R4 Xt headers check for this symbol; if it is defined, they give
 * an error.
 */

#ifndef _MOTIF_XT
#define _MOTIF_XT
#endif


#ifdef REV_INFO
#ifndef lint
static char SCCSID[] = "OSF/Motif: @(#)UilDef.h	1.4 90/01/09";
#endif /* lint */
#endif /* REV_INFO */
/******************************************************************************
*******************************************************************************
*
*  (c) Copyright 1989, 1990, OPEN SOFTWARE FOUNDATION, INC.
*  (c) Copyright 1989, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
*  ALL RIGHTS RESERVED
*  
*  	THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED
*  AND COPIED ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND
*  WITH THE INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR
*  ANY OTHER COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE
*  AVAILABLE TO ANY OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF THE
*  SOFTWARE IS HEREBY TRANSFERRED.
*  
*  	THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT
*  NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY OPEN SOFTWARE
*  FOUNDATION, INC. OR ITS THIRD PARTY SUPPLIERS  
*  
*  	OPEN SOFTWARE FOUNDATION, INC. AND ITS THIRD PARTY SUPPLIERS,
*  ASSUME NO RESPONSIBILITY FOR THE USE OR INABILITY TO USE ANY OF ITS
*  SOFTWARE .   OSF SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
*  KIND, AND OSF EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES, INCLUDING
*  BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
*  FITNESS FOR A PARTICULAR PURPOSE.
*  
*  Notice:  Notwithstanding any other lease or license that may pertain to,
*  or accompany the delivery of, this computer software, the rights of the
*  Government regarding its use, reproduction and disclosure are as set
*  forth in Section 52.227-19 of the FARS Computer Software-Restricted
*  Rights clause.
*  
*  (c) Copyright 1989, 1990, Open Software Foundation, Inc.  Unpublished - all
*  rights reserved under the Copyright laws of the United States.
*  
*  RESTRICTED RIGHTS NOTICE:  Use, duplication, or disclosure by the
*  Government is subject to the restrictions as set forth in subparagraph
*  (c)(1)(ii) of the Rights in Technical Data and Computer Software clause
*  at DFARS 52.227-7013.
*  
*  Open Software Foundation, Inc.
*  11 Cambridge Center
*  Cambridge, MA   02142
*  (617)621-8700
*  
*  RESTRICTED RIGHTS LEGEND:  This computer software is submitted with
*  "restricted rights."  Use, duplication or disclosure is subject to the
*  restrictions as set forth in NASA FAR SUP 18-52.227-79 (April 1985)
*  "Commercial Computer Software- Restricted Rights (April 1985)."  Open
*  Software Foundation, Inc., 11 Cambridge Center, Cambridge, MA  02142.  If
*  the contract contains the Clause at 18-52.227-74 "Rights in Data General"
*  then the "Alternate III" clause applies.
*  
*  (c) Copyright 1989, 1990, Open Software Foundation, Inc.
*  ALL RIGHTS RESERVED 
*  
*  
* Open Software Foundation is a trademark of The Open Software Foundation, Inc.
* OSF is a trademark of Open Software Foundation, Inc.
* OSF/Motif is a trademark of Open Software Foundation, Inc.
* Motif is a trademark of Open Software Foundation, Inc.
* DEC is a registered trademark of Digital Equipment Corporation
* DIGITAL is a registered trademark of Digital Equipment Corporation
* X Window System is a trademark of the Massachusetts Institute of Technology
*
*******************************************************************************
******************************************************************************/

/*
**++
**  FACILITY:
**
**      User Interface Language Compiler (UIL)
**
**  ABSTRACT:
**
**      This include file defines the set of definitions used by all of
**	modules of the UIL compiler.
**
**--
**/

#ifndef UilDef_h
#define UilDef_h


/*
**
**  INCLUDE FILES
**
**/


/*
**                                    
**  Universal Definitions
**
*/

#define _compiler_version "V2.0-000"
#define _compiler_version_int 2
#define _data_version 1





#define _host_compiler "Motif Uil Compiler"


#ifdef NULL
#undef NULL
#endif
#define NULL	  	0

#ifdef TRUE
#undef TRUE
#endif
#define TRUE	 	1

#ifdef FALSE
#undef FALSE
#endif
#define FALSE	  	0

#define debug_version	FALSE

#define k_normal  	1
#define k_error   	0

typedef int status;
typedef int boolean;

/*
**  The PCC counterpart to extern is globalref/globaldef.
**  Define external and externaldef so they work correctly
**  on the 2 compilers.
*/

#ifdef external
#undef external
#endif
#ifdef externaldef
#undef externaldef
#endif


#define external extern
#define externaldef




/*
**
**  Constants controlling limits in the compiler
**
*/

#define src_k_max_source_files		101
#define src_k_max_source_line_length	132
#define lex_k_unprint_sub		'?'
#define sym_k_max_list_count		1000
#define sym_k_max_color_count		256
#define Uil_k_max_include_dir_count	32

/*
**
**  Definition of UIL_DATA data
**
*/

external boolean	uil_v_case_sensitive;

#if debug_version
external boolean	uil_v_dump_tokens;
external boolean	uil_v_dump_symbols;
#endif

external status		uil_l_compile_status;

/*
**
**  Definition of Compiler Termination Statuses
**
*/

#define uil_k_min_status	Uil_k_min_status
#define uil_k_success_status	Uil_k_success_status
#define uil_k_info_status	Uil_k_info_status
#define uil_k_warning_status	Uil_k_warning_status
#define uil_k_error_status	Uil_k_error_status
#define uil_k_severe_status	Uil_k_severe_status
#define uil_k_max_status	Uil_k_max_status


/*
**
**  Upper and Lower Case Translation Macros
**
*/

#define _upper(c)	((c) >= 'a' && (c) <= 'z' ? (c) & 0x5F:(c))
#define _lower(c)	((c) >= 'A' && (c) <= 'Z' ? (c) | 0x20:(c))


/*
**
**  Assert Macro
**
*/

#if debug_version
#define _assert( __condition, __text )			\
	if (!(__condition))				\
	{  diag_issue_internal_error( (__text)); }
#else
#define _assert( __condition, __text )			\
	if (!(__condition))				\
	{  diag_issue_internal_error( NULL ); }
#endif

/*
**
**  Macros for setting overflow detection
**
*/






#define _catch_overflow( _env_block, _error_label) \
	{ int	    _setting;			\
	  external int *uil_az_error_env_block;	\
	  _setting = 1;			     \
	  uil_az_error_env_block = _env_block; \
	  if( setjmp( _env_block ) != 0 )    \
		goto _error_label;	    \
	};




#define _reset_overflow \
        { external int *uil_az_error_env_block; \
	  uil_az_error_env_block = NULL;\
	};

/*
**
**  _error and _okay macro
**
*/

#define _error( __status )	\
	((__status & 1)==0)

#define _success( __status )	\
	((__status & 1)==1)


/*
**
**  Memory allocation definitions
**
*/

#define _get_memory XtMalloc

#define _free_memory XtFree

/*
**
**  Move macro
**
*/

#define _move memcpy

/*
**
**  Compare macro
**
*/

#define _compare strcmp

/*
**
**  Fill macro
**
*/

#define _fill memset

/*
**
**  Index macro
**
*/

#define _index( __char, __string, __len ) \
    ((int)((char *)memchr( __string, __char, __len ) - (char *)__string ))


/*
**
**  Number macro, for determining the number of elements in an array
**
*/

#define _number( __array_name ) \
    ( sizeof __array_name / sizeof __array_name [0] )


/*
**
**  Debug output macro
**
*/
#if debug_version
#define _debug_output lst_debug_output
#else
#define _debug_output printf
#endif


/*
**
**  constraint check access macro
**
*/
#define _constraint_check(arg) \
 (constraint_tab[((arg)-1)/8] & (1 << ((arg)-1)%8))


/*
**
**  Common includes need by most modules
**
*/

#ifndef Uil_h
#include "Uil.h"
#endif
#include "UilMess.h"
#ifndef UilSymDef_h
#include "UilSymDef.h"
#endif
#ifndef UilSrcDef_h
#include "UilSrcDef.h"
#endif
#ifndef UilDiagDef_h
#include "UilDiagDef.h"
#endif

#endif /* UilDef_h */
/* DON'T ADD STUFF AFTER THIS #endif */
