/*
 * Copyright (c) 1989,90 Microsoft Corporation
 */
/*
 *  "Global.def"
 *  Date:       01/21/92
 *  Update:
 */
#include    "global.ext"

/********************************
 |  SYSTEM VARIABLE DEFINITION  |
 ********************************/

struct  ntb_def FAR * FAR * name_table ;     /* used for key is nametype */

//struct  object_def near opnstack[MAXOPNSTKSZ] ;   /* operand stack */    @WIN
//struct  object_def near dictstack[MAXDICTSTKSZ] ; /* dictionary stack */ @WIN
//struct  object_def near execstack[MAXEXECSTKSZ] ; /* execution stack */  @WIN
struct  object_def FAR * opnstack;     /* operand stack; alloc in start.c */
struct  object_def FAR * dictstack;    /* dictionary stack; alloc in start.c */
struct  object_def FAR * execstack;    /* execution stack; alloc in start.c */

ufix16  near opnstktop ;                    /* top of operand stack */
ufix16  near dictstktop ;                   /* top of dictionary stack */
ufix16  near execstktop ;                   /* top of execution stack */

ufix16  near hash_used ;                    /* top of collision area of
                                              hash table */
ufix16  near global_error_code ;            /* system error code */

ufix16  near global_dictstkchg ;            /* dict stack change freq */

ufix16  near current_save_level ;           /* system save level */

byte    huge * near vmptr ;                 /* pointer to free VM */
byte    huge * near vmheap ;                /* vmheap = VMBASE + MAXVMSZ */

bool8   near packed_flag = FALSE ;          /* packed array mode */

bool8   near ST_inter_password ;            /* internal password */

real32 near zero_f = (real32)0.0 ;
real32 near one_f = (real32)1.0 ;

real32 near infinity_f = (real32)3.402823466385288598e+38 ;

/* Change these constants to variables and move them from constant.h */
ufix32     SYSRAMBASE ;          /* system RAM base */

ufix32     FARDATA_HEAD ;        /* far data area base */
ufix32     FARDATA_END ;

ufix32     VMBASE, MAXVMSZ ;     /* VM base */
ufix32     FONTBASE ;            /* font cache base */

ufix32     Dict_Offset ;         /* font dict. base */

/* Moved from blib.c and initialized in start.c (Temp.) */
ufix32     fardata_ptr ;

ufix16  near use_fg = 0 ;                    /* use flag for server control */
struct  object_def  near sv1 ;               /* save level #1 for server */
bool    near start_flag = FALSE ;            /* flag for us_start */
ufix16  near dict_count = 0 ;                /* for init1pp */

ubyte   ctype__[256] = {
/* ?? NULL and SPACE */
/* ?? form feed */
/*       0     1     2     3     4     5     6     7     8     9     A     B     C     D     E    F   */
/* 0 */  0x10, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x30, 0x28, 0x20, 0x20, 0x28, 0x20, 0x20,
/* 1 */  0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
/* 2 */  0x10, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
/* 3 */  0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x00, 0x00, 0x40, 0x00, 0x40, 0x00,
/* 4 */  0x00, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
/* 5 */  0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x40, 0x40, 0x40, 0x00, 0x00,
/* 6 */  0x00, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
/* 7 */  0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x40, 0x00, 0x40, 0x00, 0x00,
/* 8 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 9 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
/* A */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
/* B */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
/* C */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
/* D */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
/* E */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
/* F */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
} ;

//DJC byte    job_name[64], job_state[64], job_source[64];
//DJC fix from history.log UPD023
byte    job_name[MAXJOBNAME], job_state[64], job_source[64];
byte    TI_state_flag = 0;
struct object_def   FAR *opnstkptr;
struct object_def   FAR *execstkptr;
struct object_def   FAR *dictstkptr;
struct cache_area   cache_name_id;
