c************
c  Description:	Tables for COMMANDS/HISTORY/RESULTS/MACROS
c
c  Author:	JGS 4/2/90
c  $Revision: 1.1 $
c  $Modtime:   01 Aug 1997 11:57:12  $
c  
c************
c
	integer*4  L_midas_tables
	integer*4  L_historys, L_pipes, L_widgets, L_wbanks
	integer*4  L_command_chars, L_history_chars
	integer*4  L_dsmess, L_dsintbuf, L_engines
	integer*4  L_message_ids, L_message_hdr
c
	parameter (L_historys=32)	! max entries in history buffer
	parameter (L_wbanks=16)		! max number of control widgets banks
	parameter (L_dsmess=256)	! max number of datastream messages
	parameter (L_dsintbuf=512)	! length of DS interrupt buffer
	parameter (L_engines=15)	! max number of datastream engines
	parameter (L_message_ids=4096)	! max number of ids on message queue
c
	parameter (L_history_chars=512)		! size of history buffer
c
	STRUCTURE /WIDGETSTRUCT/
	  character*16	name				! name
	  character*1	type				! type (M,L,F,D)
	  logical*1	altered				! altered
	  integer*2	put_id				! last put id
	  integer*2	prim_id				! primitive
	  integer*2	param_id			! parameter
	  UNION
	  MAP
	    integer*4	msel
	    integer*4	ls
	    character	menustr*80
	  ENDMAP
	  MAP
	    integer*4	lval,lmin,lmax,linc
	  ENDMAP
	  MAP
	    real*4	fval,fmin,fmax,finc
	  ENDMAP
	  MAP
	    real*8	dval,dmin,dmax,dinc
	  ENDMAP
	  ENDUNION
	END STRUCTURE
c
	STRUCTURE /MESSAGESTRUCT/
	  byte		type				! message type
	  character*1	format				! message format (V,I,E)
	  integer*2	idata				! message data
	  integer*4	ldata				! message data
	  real*8	ddata				! message data
	END STRUCTURE
c
	STRUCTURE /QMESSHDRSTRUCT/
	  integer*4	nmessage		! queue length in slots
	  integer*4	readers			! number readers
	  integer*4	bcreaders		! max # broadcast readers
	  integer*4	bcslots			! slots overhead for bc mesg
	  integer*4	qid			! queued ID num
c+++
c DR 5366
c Old
c	  integer*4	read			! first valid qmess
c	  integer*4	write			! 1 after last qmess
c	  integer*4	wlock			! writer's lock
c New
!if _PFC
	  integer*4	read			! first valid qmess
	  integer*4	write			! 1 after last qmess
	  integer*4	wlock			! writer's lock
!else
!
!
!
!
!
!endif
c---
	  integer*4	qmess(L_message_ids)	! mesg lookup table
	END STRUCTURE
c+++
c DR 5366
c Old
c	parameter (L_message_hdr=8*4+L_message_ids*4)	! message queue header
c New
!if _PFC
	parameter (L_message_hdr=8*4+L_message_ids*4)	! message queue header
!else
!
!endif
c---
c
	STRUCTURE /ENGINESTRUCT/
	  character*19	node				! node name
	  character*1	fp				! float prec def
	  character*4	os				! Oper Sys type
	  character*4	rep				! data representation
	  integer*4	tl				! def transfer length
	  integer*4	ps				! def pipe size
	  integer*4	fb				! def file buffer size
	  integer*4	socket				! socket ID code
	  integer*4	sdin				! in descript
	  integer*4	sdout				! out descript
	  integer*4	state				! engine status
	END STRUCTURE
c
	STRUCTURE /MTABLES/
c
	  integer*4	dsmess_state			! DS message state
	  integer*4	dsmess_in			! DS message in
	  integer*4	dsmess_out			! DS message out
	  integer*4	dsmess_lock			! DS message lock
	  record /MESSAGESTRUCT/ dsmess(L_dsmess)	! message buffer
c
	  integer*4	historyb			! hist buf ID ping/pong
	  integer*4	nhistory(0:1)			! # commands in hist buf
	  integer*2	h_index(0:1,L_historys)		! command start index
	  character*(L_history_chars) h_string(0:1)	! history buf string
c
	  integer*4	nmessage			! queue length
	  integer*4	nreaders			! max number readers
c
	  integer*4	npipe				! # pipes
	  integer*4	mpipe				! max # pipes
	  integer*4	phead_off			!
	  integer*4	nwidget				! # control widgets
	  integer*4	wparm_off			!
	  integer*4	wparm_used			!
	  integer*2	w_bank(L_wbanks)		! widget bank offsets
c
	  integer*4	ds_alloc
	  integer*4	ds_used
	  integer*4	ds_ptr
	  integer*4	ds_flag
	  record /ENGINESTRUCT/ engine(0:L_engines)	! DS engines structs

	  integer*4	result_lock			! result writer's lock
	  integer*4	dsint_lock
	  integer*4	dsint_size
	  integer*4	dsint_status
	  integer*2	dsint_state
	  integer*2	dsint_engine
	  byte		dsintbuf(L_dsintbuf)
c
	END STRUCTURE
	record /MTABLES/ Mt
	record /QMESSHDRSTRUCT/ Mq
c
	pointer (M_mtpointer,Mt)
	pointer (M_mqpointer,Mq)
c	parameter (L_midas_tables=6784)
	parameter (L_midas_tables=6800)
	common /M$TABLES/ M_mtpointer,M_mqpointer
