c
	include 'dix_size_def.inc'
c
	character*(*) dopointer,unpointer
	parameter (dopointer = '=>')
	parameter (unpointer = '  ')
c
	integer*4 enttyp_int ,enttyp_real_f,enttyp_log
	integer*4 enttyp_uint,enttyp_chr 
	integer*4 enttyp_uic ,enttyp_dat ,enttyp_bits
	integer*4 enttyp_string ,enttyp_lstring,enttyp_wstring
	integer*4 enttyp_zstring,enttyp_hstring,enttyp_cpu
	integer*4 enttyp_structure,enttyp_endstructure
	integer*4 enttyp_map,enttyp_endmap
	integer*4 enttyp_union,enttyp_endunion
	integer*4 enttyp_prot,enttyp_revint,enttyp_identifier
	integer*4 enttyp_fid,enttyp_field,enttyp_endfield
	integer*4 enttyp_rlog,enttyp_rbits
	integer*4 enttyp_max_type,enttyp_real_d
	integer*4 enttyp_diskmap,enttyp_position,enttyp_user
	integer*4 enttyp_range,enttyp_endrange,enttyp_acl
	integer*4 enttyp_exit,enttyp_pointer,enttyp_real_s
	integer*4 enttyp_real_t,enttyp_real_g,enttyp_real_h
	integer*4 enttyp_real_x,enttyp_vfc,enttyp_abort
	integer*4 enttyp_decimal,enttyp_message,enttyp_udecimal
	integer*4 enttyp_if,enttyp_else,enttyp_elseif,enttyp_endif
	integer*4 enttyp_deltatime,enttyp_ifdef
	parameter (
     1     enttyp_int      = 1,
     1     enttyp_real_f   = 2,
     1     enttyp_log      = 3,
     1     enttyp_chr      = 4,
     1     enttyp_uint     = 5,
     1     enttyp_ifdef    = 6,
     1     enttyp_uic      = 7,
     1     enttyp_dat      = 8,
     1     enttyp_bits     = 9,
     1     enttyp_string   = 10,
     1     enttyp_lstring  = 11,
     1     enttyp_zstring  = 12,
     1     enttyp_hstring  = 13,
     1     enttyp_structure= 14,
     1     enttyp_endstructure= 15,
     1     enttyp_map      = 16,
     1     enttyp_endmap   = 17,
     1     enttyp_union    = 18,
     1     enttyp_endunion = 19,
     1     enttyp_prot     = 20,
     1     enttyp_revint   = 21,
     1     enttyp_fid      = 22,
     1     enttyp_field    = 23,
     1     enttyp_endfield = 24,
     1     enttyp_rbits    = 25,
     1     enttyp_rlog     = 26,
     1     enttyp_real_d   = 27,
     1     enttyp_wstring  = 28,
     1     enttyp_cpu      = 29,
     1     enttyp_diskmap  = 30,
     1     enttyp_position = 31,
     1     enttyp_range    = 32,
     1     enttyp_endrange = 33,
     1     enttyp_acl      = 34,
     1     enttyp_identifier = 35,
     1     enttyp_user     = 36,
     1     enttyp_exit     = 37,
     1     enttyp_pointer  = 38,
     1     enttyp_real_s   = 39,
     1     enttyp_real_t   = 40,
     1     enttyp_real_g   = 41,
     1     enttyp_real_h   = 42,
     1     enttyp_real_x   = 43,
     1     enttyp_vfc      = 44,
     1     enttyp_abort    = 45,
     1     enttyp_decimal  = 46,
     1     enttyp_if       = 47,	
     1     enttyp_else     = 48,
     1     enttyp_elseif   = 49,
     1     enttyp_endif    = 50,        
     1     enttyp_message  = 51,	
     1     enttyp_deltatime= 52,	
     1     enttyp_udecimal = 53,
     1     enttyp_max_type = 54)
	character*(*) type_names	!trailing & means no data item
	parameter (type_names = 
     1        '/INTEGER/REALF/LOGICAL/CHARACTER/UINTEGER'//
     1        '/#IFDEF/UIC/DATE'//
     2        '/BITS/STRING/LSTRING/ZSTRING/HSTRING'//
     3        '/STRUCTURE&/ENDSTRUCTURE&/MAP&/ENDMAP&'//
     4        '/UNION&/ENDUNION&/PROTECTION/REVINTEGER'//
     5        '/FILEID/BITFIELD&/ENDBITFIELD&/RBITS/RLOG'//
     6        '/REALD/WSTRING/CPU/DISKMAP/POSITION/RANGE&/ENDRANGE&'//
     1        '/ACL/IDENTIFIER/USER&/EXIT&/POINTER&/REALS'//
     1        '/REALT/REALG/REALH/REALX/VFC/ABORT/DECIMAL'//
     1        '/#IF&/#ELSE&/#ELSEIF&/#ENDIF&/#MESSAGE&/DELTATIME'//
     1        '/UDECIMAL/#IFDEF')
c
	structure /link/	!general purpose link record
	  integer*4 forw
	  integer*4 backw
	end structure
c
	integer*4 magic_table
	parameter (magic_table = 'TABL')
	structure /table/
	  integer*4 size
	  integer*4 count
	  integer*4 allocated
	  integer*4 address
	  integer*4 magic
	end structure
c
	integer*4 magic_vm_zone
	parameter (magic_vm_zone = 'VMZM')
	structure /vm_zone/		!VM alloction structure
	  record /link/ link		!link for vm_zones
	  integer*4 zone 		!zone id from lib$create_vm_zone
	  integer*4 n_alloc		!#records  allocated
	  integer*4 nb_alloc		!#bytes alocated
	  integer*4 n_dealloc           !#records deallocated
	  integer*4 nb_dealloc          !#byte deallocated
	  integer*4 magic               !magic word for sanity checking
	  character*(max_vm_zone_name_length) name
	end structure
c
	integer*4 magic_strdef
	parameter (magic_strdef = 'STRD')
c
	structure /strdef/
          INTEGER*2 DSC$W_MAXSTRLEN    !  Max length of the BODY field of the varying string
          BYTE      DSC$B_DTYPE        !  A one-byte atomic data type code
          BYTE      DSC$B_CLASS        !  A one-byte descriptor class code (see above).
	  INTEGER*4 DSC$A_POINTER	 ! Pointer to the string
	  integer*4 magic               !magic word for sanity checking
	end structure
c
	integer*4 magic_dimension
	parameter (magic_dimension = 'DIME')
	structure /dimension/		!dimension entry (low:high)
	  integer*4 low			!low value for index
	  integer*4 idx                 !work value for index
	  integer*4 high                !high value for index
	  logical*4 low_is_star         !low=* flag
	  record /strdef/ low_name      !name for low value (must be eval'd)
	  record /strdef/ high_name	!name for high value (must be eval'd)
	end structure
c	
	integer*4 magic_repeat
	parameter (magic_repeat = 'REPE')
	structure /repeat/		!repeat structure for dimension
	  record /dimension/ dim(max_dimension)  !the dimension info
	  logical*4 has_dims		!does the structure have dimension?
	  integer*4 magic               !magic word for sanity checking
	end structure
c
	integer*4 magic_link_rec
	parameter (magic_link_rec = 'LINK')
	structure /link_rec/
	  integer*4 nk_link_file	!length of filename
	  character*(max_filename_length) link_file !the name of the file
	  integer*4 key_nr		!0..n keynr, -1 is recordnumber
	  integer*4 match		!eq,ge,gt,le,lt
	  record /strdef/ comp_line     !compute string
	  record /strdef/ if_line       !if string
	  integer*4 magic               !magic word for sanity checking
	end structure
c
c COntents of flag word 
c  nibble 1,2 , nb_reserved
c
	integer*4 des_flag_nb_reserved_mask
	parameter (des_flag_nb_reserved_mask = '000000FF'X)
c
c  nibble 3, is_field, is_variable, case mask
c
	integer*4  des_flag_is_field
	parameter (des_flag_is_field =     '00000100'x)
	integer*4  des_flag_is_variable
	parameter (des_flag_is_variable =  '00000200'x)
	integer*4  des_flag_case_mask
	parameter (des_flag_case_mask =    '00000C00'X)
	integer*4  des_flag_case_no_case
	parameter (des_flag_case_no_case = '00000000'X)
	integer*4  des_flag_case_upper
	parameter (des_flag_case_upper =   '00000400'X)
	integer*4  des_flag_case_lower
	parameter (des_flag_case_lower =   '00000800'X)
c
c Nibble 4 : translate mask, fielname_status mask
c
	integer*4  des_flag_translate_mask
	parameter (des_flag_translate_mask='00003000'X)
	integer*4  des_flag_translate_nor
	parameter (des_flag_translate_nor ='00000000'X)
	integer*4  des_flag_translate_bin
	parameter (des_flag_translate_bin ='00001000'X)
	integer*4  des_flag_translate_oct
	parameter (des_flag_translate_oct ='00002000'X)
	integer*4  des_flag_translate_hex
	parameter (des_flag_translate_hex ='00003000'X)
	integer*4  des_flag_fieldname_status_mask
	parameter (des_flag_fieldname_status_mask = '0000C000'X)
	integer*4  des_flag_fieldname_status_none
	parameter (des_flag_fieldname_status_none  = '00000000'X)
	integer*4  des_flag_fieldname_status_singl
	parameter (des_flag_fieldname_status_singl = '00004000'X)
	integer*4  des_flag_fieldname_status_multi
	parameter (des_flag_fieldname_status_multi = '00008000'X)
	integer*4  des_flag_fieldname_status_mulrv 
	parameter (des_flag_fieldname_status_mulrv = '0000C000'X)
c
c nibble 5 is_filler, no_display, has_repat and has_size_asc
c
	integer*4  des_flag_is_filler
	parameter (des_flag_is_filler   = '00010000'X)
	integer*4  des_flag_no_display
	parameter (des_flag_no_display   = '00020000'X)
	integer*4  des_flag_has_repeat
	parameter (des_flag_has_repeat   = '00040000'X)
	integer*4  des_flag_has_size_asc
	parameter (des_flag_has_size_asc = '00080000'X)
c
c Nibble 6, has_dependancy, field_mode, readonly, compressed
c
	integer*4  des_flag_has_dependancy
	parameter (des_flag_has_dependancy = '00100000'X)
	integer*4  des_flag_field_mode
	parameter (des_flag_field_mode     = '00200000'X)
	integer*4  des_flag_readonly           
	parameter (des_flag_readonly       = '00400000'X)
	integer*4  des_flag_compressed
	parameter (des_flag_compressed     = '00800000'X)
c
c Nibble 7 : limit flag/vfc/relative
c
	integer*4  des_flag_has_limit
	parameter (des_flag_has_limit  = '01000000'X)
	integer*4  des_flag_is_vfc
	parameter (des_flag_is_vfc     = '02000000'X)
	integer*4  des_flag_is_relative
	parameter (des_flag_is_relative= '04000000'X)
c
c nibble 8 : conversion for decimal strings
c
	integer*4  des_flag_decimal_zerofill
	parameter (des_flag_decimal_zerofill = '10000000'X)
	integer*4  des_flag_decimal_exponent
	parameter (des_flag_decimal_exponent = '20000000'X)
	integer*4  des_flag_decimal_fraction
	parameter (des_flag_decimal_fraction = '40000000'X)
	integer*4  des_flag_decimal_leftjust
	parameter (des_flag_decimal_leftjust = '80000000'X)
c
	integer*4 magic_des_rec_fil
	parameter (magic_des_rec_fil = 'DESF')
	structure /des_rec_fil/         !description record read from file
	  integer*4 ent_type		!type for this entry
	  integer*4 size		!size in bits
	  record /repeat/ rep		!repeat structure (dimensions)
	  character*(name_length) name  !name of field
	  integer*4 nam_len             !length name
	  integer*4 flags		!flag word
	  record /strdef/ size_asc	!ascii size (must be eval'd)
	  record /strdef/ fldnam        !optional fieldnames
	  record /strdef/ limit_value	!field limits for structs
	  integer*4 pad_value		!after this field, align to 'pad_value' bits
	  integer*4 min_val		!for integers, min and max val
	  integer*4 max_val		!max val
	  integer*4 link_pointer        !pointer for pointer statement
	  integer*4 p_link_rec		!pointer to des_rec_fil record
	  integer*4 lun_translate	!pointer to tranlate function
	  character*(max_user_function_name_length) username !name for user define fieldtype
	  integer*4 magic               !magic word for sanity checking
	end structure
c
	integer*4 magic_des_rec
	parameter (magic_des_rec = 'DESR')
	structure /des_rec/		!description record (expanded)
	  record /strdef/ nam		!name 
	  record /strdef/ fldnam        !optional field values
	  integer*4 ent_type		!entry type
	  integer*4 size                !bit size
	  integer*4 flags               !flag word
	  integer*4 act_size		!for %string(*) with byte count field
	  integer*4 bit_offset          !bit offset in record
	  integer*4 link_back           !back link to des_rec_fil
	  integer*4 min_val		!for integers, min and max val
	  integer*4 max_val             !max val
	  integer*4 p_link_rec		!pointer to link_rec
	  integer*4 lun_translate	!pointer to tranlate function
	  integer*4 pad_value		!actual pad value
	  integer*4 magic               !magic word for sanity checking
	end structure
c
	integer*4 magic_param
	parameter (magic_param = 'PARM')
	structure /param/
	  character*(name_length) name
	  integer*4 value
	  integer*4 hex
	  integer*4 magic               !magic word for sanity checking
	end structure
c
c Key defs
c
	integer*4 key_up,key_down,key_left,key_right,key_menu
	integer*4 key_prev,key_next,key_top,key_bot
	integer*4 key_find,key_find_rec,key_find_rec1
	integer*4 key_swap_dis,key_swap_num,key_ask_key,key_next_rec
	integer*4 key_do,key_abort,key_newreclen,key_getfields
	integer*4 key_byte,key_word,key_long,key_next_window
	integer*4 key_prev_window,key_change_disp
	integer*4 key_chdis,key_chmod,key_chrec,key_compres
	integer*4 key_delete,key_put,key_exit,key_display_hex,key_hexdeco
	integer*4 key_viewdes,key_nextdes,key_prevdes,key_dirdes
	integer*4 key_next_file,key_prev_file,key_dir_file,key_chfile
	integer*4 key_show_field,key_save,key_restore,key_repaint
	integer*4 key_contdis,key_viewdesc,key_viewvfc,key_prev_rec
	integer*4 key_rfa_restore,key_open,key_close,key_help
	integer*4 key_last,key_first,key_select,key_modechange
	integer*4 key_enter,key_erase,key_cancel,key_set_forw
	integer*4 key_set_backw,key_dispall,key_remove,key_editdes
	integer*4 key_prev_field,key_toggle,key_fileinfo
	integer*4 key_print,key_page,key_find1,key_unknown
	integer*4 key_delete_line,key_undelete_line,key_next_line
	integer*4 key_delete_word,key_undelete_word,key_follow_link
	integer*4 key_back_link,key_ch_width,key_delete_char
	integer*4 key_undelete_char
	integer*4 key_mouse_left,key_mouse_middle,key_mouse_right
	integer*4 key_mouse_toggle,key_display_binary
	integer*4 key_display_octal,key_display_decimal
c
c All keyd_defs must be negative
c locate keys 
c
	parameter (key_up       =-1)		!one line up
	parameter (key_down     =-2)		!one line down
	parameter (key_left     =-3)		!one pos left
	parameter (key_right    =-4)		!one pos right
	parameter (key_prev     =-5)		!screen up
	parameter (key_next     =-6)		!screen down
	parameter (key_top      =-7)		!first line
	parameter (key_bot      =-8)		!last line
	parameter (key_find     =-9)		!search
	parameter (key_next_window=-10)		!toggle ascci/bin display
	parameter (key_do       =-11)		!save changes
	parameter (key_show_field=-12)		!display field info
	parameter (key_save      =-13)		!Save to save area
	parameter (key_contdis  =-14)		!continously display des
	parameter (key_getfields=-15)		!get data through fields
	parameter (key_viewvfc  =-16)		!get data through fields
	parameter (key_help     =-17)		!display help
	parameter (key_unknown  =-18)		!unknown state-key 
	parameter (key_first    =-19)		!goto first char in line 
	parameter (key_enter    =-20)		!terminate input
	parameter (key_erase    =-21)		!erase input field
	parameter (key_cancel   =-22)		!cancel action
	parameter (key_set_forw =-23)		!set forward mode on find
	parameter (key_set_backw=-24)		!set backward mode on find
	parameter (key_dispall  =-25)		!all field mode
	parameter (key_delete   =-26)		!delete charater on input
	parameter (key_editdes  =-27)		!edit description
	parameter (key_prev_field=-28)		!previous field on input
	parameter (key_toggle   =-29)		!toggle insert/overstrike
	parameter (key_fileinfo =-30)		!file info
	parameter (key_print    =-31)		!print
	parameter (key_page     =-32)		!page commmand
	parameter (key_find1    =-33)		!gold-pf3
	parameter (key_last     =-34)		!goto last char in line
	parameter (key_select   =-35)		!select
	parameter (key_delete_word  =-36)	!delete word
	parameter (key_undelete_word=-37)	!undelete word
	parameter (key_delete_line  =-38)	!delete line
	parameter (key_undelete_line=-39)	!undelete line
	parameter (key_next_line    =-40)	!next line
	parameter (key_prev_window  =-41)	!prev window
	parameter (key_mouse_left   =-42)	!mouse click 1` (left)
	parameter (key_mouse_middle =-43)       !middle
	parameter (key_mouse_right  =-44)       !right
	parameter (key_menu         =-45)	        !menu key
	parameter (key_delete_char  =-46)	!delete char
	parameter (key_undelete_char=-47)	!undelete char
	parameter (key_mouse_toggle =-48)	!toggle mouse usage
c
c the next keys need change of display 
c
	parameter (key_chdis    =-60)		!leave display or redisplay
	parameter (key_swap_num =-61)		!F20 no/display byte offset
	parameter (key_byte     =-62)		!PF1-B
	parameter (key_word     =-63)		!PF1-W
	parameter (key_long     =-64)		!PF1-L
	parameter (key_compres  =-66)		!pf1-C compres toggle
	parameter (key_display_hex=-67)		!pf1-h hex display
	parameter (key_newreclen=-68)		!pf1-r
	parameter (key_viewdes  =-69)		!pf1-v view description
	parameter (key_repaint  =-70)		!ctrl_r repaint 
	parameter (key_viewdesc =-71)		!pf1-u view description in mem
	parameter (key_hexdeco   =-72)		!pf1-h hex/decimal offsets
	parameter (key_change_disp=-73)		!pf4-c change display
	parameter (key_display_decimal =-74) 	!display decinal
	parameter (key_display_octal   =-75)    !display octal
	parameter (key_display_binary  =-76)    !display binary
c
c The next key changes from raw/interpreted mode
c
	parameter (key_chmod    =-100)		!leave display or redisplay
	parameter (key_swap_dis =-100)		!F19
	parameter (key_abort    =-101)		!pf1-do
	parameter (key_remove   =-102)		!Remove delete current record
	parameter (key_nextdes  =-104)		!pf1-X next description file
	parameter (key_prevdes  =-105)		!pf1-Z prev description file
	parameter (key_dirdes   =-106)		!pf1-Q DIR description file
	parameter (key_restore  =-107)		!restore from save area
	parameter (key_ch_width=-108) 		!toggle 132/80 chars
c
c The next keys change the record
c
	parameter (key_chrec    =-150)		!leave display or redisplay
	parameter (key_ask_key  =-150)		!F17 ask for new key
	parameter (key_next_rec =-151)		!f18 Next record
	parameter (key_put      =-152)		!Insert Insert new record
	parameter (key_find_rec =-153)		!find data in record
	parameter (key_find_rec1=-154)		!find data in record woth old search strin
	parameter (key_prev_rec =-155)		!f18 Next record
c
c The next keys change the file or mode
c
	parameter (key_chfile   =-200)		!file changes
	parameter (key_next_file=-201)		!next file
	parameter (key_prev_file=-202)		!prev file
	parameter (key_dir_file =-203)		!dir file
	parameter (key_exit     =-204)		!F10 exit
	parameter (key_rfa_restore=-205)	!return to prevsion set rfa
	parameter (key_open     =-206)		!open file(s) requested
	parameter (key_close    =-207)		!close file requested
	parameter (key_modechange=-208)		!toggle screen/interactive
	parameter (key_follow_link=-209)	!follow link in file
	parameter (key_back_link=-210)	!back link in file

c
c Is used for expanded des structures
c
	integer*4 magic_des_expanded
	parameter (magic_des_expanded = 'DESE')
	structure /des_expanded/	
	  record /link/ link		!general link
	  integer*4 nk_handle		!handle length
	  character*(max_handle_name_length) handle !handle name
	  integer*4 p_des_info		!pointer to DES_INFO structure
c
c the following 5 fields are for the normal data
c
	  record /table/ table_nor
	  record /table/ fieldnames_nor
	  integer*4 max_name_size   	!max size of name fields
	  integer*4 nfield_total        !#fields total
	  integer*4 nfield_notcompressed!#fields no compressed
c
c the following 5 fields are for the VFC data
c
	  record /table/ table_vfc
	  record /table/ fieldnames_vfc
	  integer*4 vfc_max_name_size   !max size of name fields
	  integer*4 vfc_nfield_total    !#fields total
	  integer*4 vfc_nfield_notcompressed!#fields no compressed
c
	  logical*4 expand_error	!error during expansion
	  logical*4 is_expanded		!state of expansion
c
	  record /vm_zone/ zone_rec	!vm structure for allocs
	  integer*4 magic               !magic word for sanity checking
	end structure
c
	integer*4  max_vfc_size
	parameter (max_vfc_size=255)
c
	integer*4 magic_data_info
	parameter (magic_data_info = 'DATA')
	structure /data_info/		!the data from the record
	  integer*4 nb_data		!#bytes of data
	  byte data_rec(max_buf)        !the data record
	  byte fil_1			!align
	  integer*4 nb_sav              !#bytes for undo (unchanged)
	  byte data_sav(max_buf)        !undo buffer
	  byte fil_2                    !align (since max_buf is odd)
	  logical*4 newrec		!flag for new data record
	  integer*4 nb_vfc		!#vfc bytes
	  byte vfc_data(max_vfc_size)	!vfc data
	  byte fil_3                    !align since max_vfc_size is odd
	  byte vfc_data_sav(max_vfc_size) !#vfc data for undo
	  byte fil_4                    !align
	  integer*4 magic               !magic word for sanity checking
	end structure
c
	integer*4 symb_typ_none
	integer*4 symb_typ_char
	integer*4 symb_typ_int
	integer*4 symb_typ_real
	integer*4 symb_typ_log
	integer*4 symb_typ_date
	integer*4 symb_typ_decimal
	parameter (symb_typ_none = 0)
	parameter (symb_typ_char = enttyp_chr)
	parameter (symb_typ_int  = enttyp_int)
	parameter (symb_typ_real = enttyp_real_f)
	parameter (symb_typ_log  = enttyp_log)
	parameter (symb_typ_date = enttyp_dat)
	parameter (symb_typ_decimal= enttyp_decimal)
c
	integer*4 magic_value
	parameter (magic_value = 'VALU')
	structure /value/		!value structure
	  integer*4 type                !type of value (int/char/...)
	  record /strdef/ strdes	!for character type
	  union
	    map
	      integer*4     ival        !for integer
	    end map
	    map
	      integer*4     i8val(2)    !for integer*8
	    end map
	    map
	      logical*4     lval        !for logical
	    end map
	    map
	      integer*4     date(2)     !for data
	    end map
	    map
	      real*4        rval        !for real*4
	    end map
	    map
	      real*8        rval8       !for real*8
	    end map
	    map
	      real*16       rval16      !for real*16
	    end map
	    map				!for decimal
	      integer*4     sign	!sign 0=pos, 1=neg
              integer*4     exponent    !*10**exponent
	    end map
	  end union
	  integer*4 magic               !magic word for sanity checking
	end structure
c
	integer*4 magic_file_info
	parameter (magic_file_info = 'FILI')
	structure /file_info/
	  record /link/ link          	!link 
	  integer*4 nk_fnam             !length of filename
	  character*(max_filename_length) fnam !filename
	  integer*4 nk_handle           !lengthof handle
	  character*(max_handle_name_length) handle !handle name
	  integer*4 fabadr              !pointer to fab
	  integer*4 rabadr              !pointer to rab
	  integer*4 fabmod              !pointer to fabmod (for modify record)
	  integer*4 rabmod              !pointer to rabmod
	  integer*4 namadr              !pointer to nam block
	  logical*4 indexed             !indexed file?
	  logical*4 relative            !relative file?
	  logical*4 fixed               !fixed record length file?
	  logical*4 modify              !file in modify mode
	  integer*4 minrecl             !minimum record length (for indexed)
	  integer*4 maxrecl		!maximum record length
	  integer*4 nkey                !#keys for indexed file
	  integer*4 filesize            !size of the file in blocks
	  logical*4 block_size          !block size on blockio
	  logical*4 err_seen            !we saw an error on this file
	  logical*4 record_locked	!is a read with nolock executed?
	  logical*4 oplock		!oportunistic locking?
	  logical*4 rrl			!read regardless lock??
	  integer*4 count		!the number of records to dump
	  integer*4 top_des		!first description
	  integer*4 cur_des		!first description
	  integer*4 cur_key		!current key
	  integer*4 dis_id		!display id for data
	  integer*4 line_nr		!index to descriptions
	  integer*4 scr_pos             !line nr of the first displayed line
	  integer*4 rec_nr		!current record number fo sequential file
	  integer*4 nb_vfc		!vfc record length
	  integer*4 bucket_size		!bucket_size
	  logical got_record		!do we have a record present
	  logical rewound		!file has been rewound
	  logical raw			!raw mode wanted?
	  integer*4 ptr_fast_search          !pointer to fast search bloc
	  integer*4 search_block_size   !fast search block size
	  integer*4 ptr_keyinfo		!pointer to key info (/key_info/)
	  record /data_info/ data       !the data for the current record
	  integer*4 magic               !magic word for sanity checking
	end structure
c
c The key blocks are linked in via the ptr_keyinfo in the file_info block
c
	integer*4 magic_key_info
	parameter (magic_key_info = 'KEYI')
	structure /key_info/		!information about a key
	  record /link/ link		!link record to the next
	  integer*4 keyidx		!index
	  integer*4 nsegment            !#segments for segmented keys
	  integer*4 length              !total length
	  integer*4 data_type           !key type
	  integer*4 keypos(8)           !starting pos (max 8)
	  integer*4 keysiz(8)           !ending pos (max 8)
	  logical*4 string              !is it a string type key?
	  logical*4 ascending           !is it an ascending key
	  logical*4 duplicate           !duplicates allowed?
	  logical*4 change              !changes allowed
	  integer*4 null_key	!null key value ,only low byte is valid
	  character*(max_rms_key_name_length) name !name of key
	end structure
c
	integer*4 magic_dis_pars
	parameter (magic_dis_pars = 'DISP')
	structure /dis_pars/	!display parameter block
	  logical*4 hex		!display in hex mode
	  integer*4 word        !display numbers per 16 bit
	  logical*4 number	!display byte offset
	  integer*4 number_hex	!display byte offset in hex
	  logical*4 raw		!display in raw mode
	  logical*4 compres     !display compressed
	  logical*4 show_des    !show descriptions
	  logical*4 is_term     !this is a terminal
	  logical*4 unsigned    !display integers unsigned
	  logical*4 tag         !display full path for fieldnames
	  integer*4 magic               !magic word for sanity checking
	  logical*4 field	!display field mode
	  logical*4 recnr	!display record number
	  logical*4 recsiz      !display record size
	  logical*4 data        !display data
	  logical*4 vfc         !display vfc data
	  logical*4 rfa         !display rfa
	end structure
c
	integer*4  des_in_file
	integer*4  des_in_syslib
	integer*4  des_in_userlib
	parameter (des_in_file=0,
     1             des_in_syslib=1,
     1             des_in_userlib=3)
c
	integer*4 magic_des_info
	parameter (magic_des_info = 'DESI')
	structure /des_info/            !descroption file/module info
	  record /link/ link		!link srructure
	  integer*4 nk_fnam		!lenth of filename
	  character*(max_filename_length) fnam	!original name
	  logical*4 fixed		!this is a fixed description
	  logical*4 has_fields		!this description contains bit fields
c
c quadriple for normal entries entries
c
	  record /table/ table_nor	!table structure for normal entries
	  integer*4 first_nor_var	!first variable in normal des
	  record /table/ table_vfc	!table for vfc entries
	  integer*4 first_vfc_var	!first var in vfc des
	  record /table/ parameters	!table for parameters
c
	  logical*4 in_library		!module is in text_library
	  integer*4 usage_count
	  integer*4 lun_memtab		!pointer to memtab file
	  record /vm_zone/ zone_file	!vm zone for memory allocation
	  integer*4 magic               !magic word for sanity checking
	end structure
c
c Program modes
c
        integer*4 mode_none
        integer*4 mode_screen
        integer*4 mode_interactive
        integer*4 mode_file
        integer*4 mode_info
        parameter (mode_none        = 0)
        parameter (mode_screen      = 1)
        parameter (mode_interactive = 2)
        parameter (mode_file        = 3)
        parameter (mode_info        = 4)
c
	integer*4 magic_help_stack
	parameter (magic_help_stack = 'HLPS')
	structure /help_stack/
	  integer*4 stack(2)	!string info (length/address)
	  integer*4 dis_id	!display id
	end structure

	integer*4 magic_history
	parameter (magic_history = 'HIST')
	structure /history/		!history record for follow
	  integer*4 p_file		!pointer to file_info block
	  character*80 rfainfo          !rfa information
	  integer*4 magic               !magic word for sanity checking
	end structure

	integer*4 platform_vax
	integer*4 platform_alpha
	integer*4 platform_ipf
c
	parameter (platform_vax=0,
     1             platform_alpha=1,
     1             platform_ipf=2)
c
	structure /csv_block/
	  logical*4 csv
	  logical*4 header
	  logical*4 quotes
	  logical*4 all_quotes
	  character*1 separator
	  character*1 quote
	end structure
c
	integer*4 magic_control
	parameter (magic_control = 'CONT')
c
	integer*4 keyboard_normal
	integer*4 keyboard_pc
	integer*4 keyboard_laptop
c
	parameter (keyboard_normal = 0)
	parameter (keyboard_pc     = 1)
	parameter (keyboard_laptop = 2)
	structure /control/ 
	  integer*4 mode		!display mode screen/file/int
	  record /table/ search		!table search
	  logical*4 rewind		!rewind flag for searches
	  integer*4 search_flags	!flags
c
	  integer*4 nk_symb		!length of symbol name for output
	  character*(max_symbol_name_length) symbol !symbol name for output
	  integer*4 lun_select		!memory table for selected fields
	  record /csv_block/ csv	!csv control
	  integer*4 nk_fnam_out		!length of output file
	  character*(max_filename_length) fnam_out !output file
	  integer*4 nk_script_file	!length of script file
	  character*(max_filename_length) script_file !script file
	  integer*4 key_table		!dix keytable
	  integer*4 input_flags		!line editing flag
c
	  logical*4 one_rec		!only one record to be printed
c
	  integer*4 strict_mode		!strict mode flags
c
	  integer*4 smg_window          !smg-window for paged output
c
	  integer*4 nk_prompt           !length of prompt string
	  character*(max_prompt_length) prompt !prompt string
c
          integer*4 depth		!#levels 
	  integer*4 top_level		!pointer to the top level
	  integer*4 cur_level		!pointer to the current level (for interactive mode)
c
	  integer*4 top_vm_zones	!link for vm_zones
	  integer*4 n_vm_area_crea	!#vm areas created	
	  integer*4 n_vm_area_dele	!#vm areas deleted
	  integer*4 p_symbols		!pointer to symbols
	  integer*4 n_memfiles_opened	!counter of openend memfiles
	  integer*4 n_memfiles_closed	!counter of closed memfiles
c
	  integer*4 lun_out		!lun for output file
	  integer*4 lun_console		!lun for sys$output io
	  logical*4 is_term		!is the sys$command a terminal?
	  integer*4 paste_id
	  integer*4 keyboard_id		!s!mg keyboard
	  integer*4 keytable_id		!SMG keytable
	  logical*4 keyboard		!pc/laptop keyboard
	  integer*4 ncols
	  integer*4 nrows
	  integer*4 dis_kop		!display id for header
	  integer*4 dis_err		!display for error messages
	  integer*4 nlin_dis_err	!#lines in dis_error
	  integer*4 ncol_dis_err	!#cols in dis_error
	  integer*4 help_depth		!help level
	  record /help_stack/ help_stack(max_help_depth)
	  logical*4 control_c_seen
	  logical got_pasteboard
c
	  integer*4 platform
	  logical*4 wide_display		!new display for description display
c
	  integer*4 real_size
	  integer*4 integer_size
c
	  character*(max_format_real_length) format_real4	!format strings for *4
	  character*(max_format_real_length) format_real8     !                   *8
	  character*(max_format_real_length) format_real16    !                   *16
c
	  character*(max_format_real_length) format_integer4    !                   *16
	  character*(max_format_real_length) format_integer8    !                   *16
c
	  logical*4 forward
	  logical*4 bold_set
	  integer*4 nk_sear
	  integer*4 row_bold
	  integer*4 col_bold
c
	  integer*4 search_block_size
	  character*(max_search_length) sear
	  integer*4 msgmask
	  logical*4 paged
	  logical*4 use_mouse		!allow mouse usage
	  integer*4 linenr		!output linenenr
	  integer*4 debug		!debug flag
	  integer*4 n_descr		!Count of open descriptions
	  integer*4 top_descr		!pointer to a list of all loaded desc
	  integer*4 n_file		!count of open files
	  integer*4 top_file		!pointer to a list of open files
	  integer*4 cur_file		!pointer to current file
	  integer*4 editor		!editor selection
	  logical*4 may_write_to_syslib	!User has write access to system .tlb
	  integer*4 nk_syslib		!length of system .tlb filename
	  character*(max_filename_length) syslib_name !system .tlb file
	  logical*4 may_write_to_userlib!User may write to user .tlb
	  integer*4 nk_userlib		!length of user .tlb file
	  character*(max_filename_length) userlib_name !name of user .tlb file
	  integer*4 p_link_history	!index in table
	  record /history/ link_history(max_link_history) !link history
	  character*(max_label_length) error_label !error label
	  character*(max_label_length) eof_label   !end of file label
	  integer*4 ran_seed		!random number seed
	  integer*4 err_seen		!seen an error?
c
	  integer*4 inter_control	!control word for interactive mode
c
	  record /vm_zone/ zone_file	!vm_zone for files
	  record /vm_zone/ zone_cfile	!vm_zone for command_files
	  record /vm_zone/ zone_general !vm zone for general things
	  record /vm_zone/ zone_descr	!vm zone for descriptions
	  record /vm_zone/ zone_links	!vm zone for links
c
	  integer*4 old_filep
	  integer*4 old_desp
	  integer*4 decimal_ndig 	!#digits for divide
	  logical*4 decimal_round       !round/truncate mode
c
	  integer*4 include_binary	!the binary convert flag
c
	  integer*4 nb_save		!#bytes in save area (cut)
c	
	  byte save_area(max_buf)       !data in save area
	  byte fill_command		!align data
c
	  integer*4 nk_command_line
	  character*(max_line_length) command_line
	  integer*4 magic               !magic word for sanity checking
	end structure
c
c Line editing modes (line_editing/insert mode)
c
	integer*4  input_flag_editing
	integer*4  input_flag_insert
	parameter (input_flag_editing = 1)
	parameter (input_flag_insert  = 2)
c
c Declare strict flags
c
	integer*4 strict_typing
	parameter (strict_typing = 1)		!Do not mix types
	integer*4  strict_declaration
	parameter (strict_declaration=2)	!Vars must be declared
	integer*4 strict_declaration_local	
	parameter (strict_declaration_local=4)  !Do not inherit global vars
c
	character*(*) true_name
	parameter (true_name = 'True')
	character*(*) false_name
	parameter (false_name = 'False')
c
c Choise of editor
c
	integer*4  dix_edit_internal,  dix_edit_edt,  dix_edit_tpu
	parameter (dix_edit_internal=1,dix_edit_edt=2,dix_edit_tpu=3)
c
	integer*4 magic_dyn_help
	parameter (magic_dyn_help = 'DYNH')
	structure /dyn_help/       !dynamic help string
	  record /strdef/ descr !the string data
	  integer*4 name_width     !name with (header)
	  integer*4 topic_width    !max string length in descr
	  logical*4 first_part     !flag
	  integer*4 magic               !magic word for sanity checking
	end structure
c
c Some special chars
c
	character*(*) tab,space,null,escape
	parameter (tab =char(9),space =' ',
     1             null=char(0),escape=char(27))
c
c Debug flags
c
	integer*4 debug_fp,debug_des,debug_keys,debug_symbols,
     1            debug_command,debug_expand,debug_file,debug_find,
     1            debug_vm,debug_fastio
c
	parameter (debug_fp      = 1,
     1             debug_des     = 2,
     2             debug_keys    = 4,
     3             debug_symbols = 8,
     3             debug_command = 16,
     3             debug_expand  = 32,
     3             debug_file    = 64,
     3             debug_find    = 128,
     3             debug_vm      = 256,
     3             debug_fastio  = 512)
c
	character*(*) default_format_real4
	character*(*) default_format_real8
	character*(*) default_format_real16
        parameter (default_format_real4  = '(G20.8)',
     1             default_format_real8  = '(G25.10E3)',
     1             default_format_real16 = '(G30.15E4)')
c
	character*(*) default_format_integer4
	character*(*) default_format_integer8
        parameter (default_format_integer4  = '(I10)',
     1             default_format_integer8  = '(I20)')
c
	structure /rfa/
	  union
	    map
	      integer*2 rfa(3)
	    end map
	    map
	      integer*4 bbnr	!bucket/block number
	      integer*2 offset	!byte offset
	    end map
	  end union
	end structure
c
	integer*4 include_binary_bin
	integer*4 include_binary_dot
	integer*4 include_binary_fancy
	integer*4 include_binary_hex
c
	parameter (include_binary_bin   = 0)	!include binary data
	parameter (include_binary_dot   = 1)    !replace binary with a .
	parameter (include_binary_fancy = 2)    !replace binary with someting like <SUB>
	parameter (include_binary_hex   = 3)    !replace binary with %Xnn
c
c Search flag types
c
	integer*4 wildcard_flag_none		!no wildcard
	integer*4 wildcard_flag_standard		!normal vms wildc
	integer*4 wildcard_flag_extended		!extended wildcards
c
	parameter (wildcard_flag_none     = 0)
	parameter (wildcard_flag_standard = 1)
	parameter (wildcard_flag_extended = 2)
c
c Key options
c
	integer*4 key_opt_seq
	integer*4 key_opt_lt
	integer*4 key_opt_le
	integer*4 key_opt_eq
	integer*4 key_opt_ge
	integer*4 key_opt_gt
c
	parameter (key_opt_seq = -3)
	parameter (key_opt_lt = -2)
	parameter (key_opt_le = -1)
	parameter (key_opt_eq =  0)
	parameter (key_opt_ge = +1)
	parameter (key_opt_gt = +2)
c                                 
c
c
	integer*4  substitute_symbols 	!substitute symbols
	parameter (substitute_symbols = 1)
	integer*4  substitute_verb      !substitute verbs
	parameter (substitute_verb    = 2)
