divert(-1)
# @(#)Copyright (c), 1987, 1995 StatSci, Inc.  All rights reserved.
#		standard definitions for RATFOR or EFL
define(`SCCS_M4_ID_STAND',
`SCCS_ID(90003,`@(#)'stand.m 3.14 last edit 6/12/95 StatSci. Basefile BASEFILE)')
define(`ASSERT',`{if(!($1)) FATAL(assertion failed: $1)}')
define(`C2I',`(($1+NCPW-1)/NCPW)')
define(`CHECK',`{if(!($1)){ $2 }}')
define(`FATAL',`{call ptline(ERRORFC,"Error: $*",len(`Error: $*'));
	call zzabt }')
define(`WARNING',`call ptline(ERRORFC,"Warning: $*",len(`Warning: $*'))')
define(`TERMINATE',`{call ptline(ERRORFC,"S terminating: $*",
  len(`S terminating: $*')); call fabort}')
define(`MESSAGE',`call ptline(ERRORFC,"$*",len(`$*'))')
define(`FOR',`for($1 FOR_SEP $2 FOR_SEP $3 )')
define(`FORTRAN',%)
define(`TRUE',.true.)define(`FALSE',.false.)
define(`SWITCH',`define(`SWITVAR',ifelse($1,,,$1==))define(`SWITNO',0)')
define(`CASE',`ifelse(SWITNO,0,`if(',`else if(')dnl
SWITVAR $1 ifelse($2,,,| SWITVAR$2) ifelse($3,,,| SWITVAR$3)dnl
ifelse($4,,, | SWITVAR$4) ifelse($5,,,| SWITVAR$5) `)'define(`SWITNO',1)')
define(`DEFAULT',`else ')
define(`POINTER',`integer')define(`NULL',0)
define(`LGL',1)
define(`INT',2)
define(`PTR',2)	# for allocating pointers
define(`REAL',3)
define(`DBL',4)
define(`CHAR',5)
define(`NEW_CHAR',17)
define(`FREE_FILE',0)define(`AUTO',1)define(`ONERROR',2)define(`PERM',3)define(`SOURCE',4)
define(`STRING',`istrng("$*",len(`$*'))')
define(`SYSTEM',`call excmd("$*",len(`$*'))')
define(`QUOTE',`CHARMAKE(34)')
define(`APOSTROPHE',`CHARMAKE(39)')

#psl macros
define(`ROUTINE',`define(`PNAME',`$1')dnl
#$1  --  substr($2,0,50)')
define(`SUPPORT',`define(`PNAME',`$1')dnl
#$1  --  substr(`$2',0,50)')
define(`POSARG',`{if($1 <0)ERROR($1 less than zero)
if($1== 0) { ERROR($1 equal to zero,$2,WARNING); return} }')
define(`ERROR',`ifelse($3,FATAL,FATAL($1),$3,WARNING,WARNING(PNAME: $2),
	FATAL(PNAME: $1))')
define(`DEBUG',`define(`HEADER',ifdef(`PNAME',routine PNAME:,,))dnl
ifelse($3,,call ssnapr("HEADER $* "//EOS),call dbenc("HEADER $1: "//EOS,$1,$2,$3))')
define(`CHAR_VAR',`ifelse(substr(CHARACTER(a,1),0,9),character,yes,no)')

divert(0)
