#!/bin/sh
#
# This script is a part of FreeUSP - the UNIX Seismic Processing system.
#

#
# Get architecture information
#
. usp-osarch
#
# The IRIX64 architecture uses the IRIX32 module
#

if ( test "${OSARCH_OS}" = "IRIX64" ) then
  OSARCH_OS=IRIX32
fi
#
# Get USP division/group information
#
. usp-set-env
#
# override the name of the binary; our actual process is "xsb"
#
APP="xsb"

XUI_PATH=${APPDIR}/etc/${DIST_PRODUCT}/xui_pattern/

XKEYSYMDB=${APPDIR}/etc/X11R6/XKeysymDB
XLOCALEDIR=${APPDIR}/etc/X11R6/locale

XFILESEARCHPATH=${XFILESEARCHPATH:+"${APPDIR}/etc/${DIST_PRODUCT}/app-defaults/%N:$XFILESEARCHPATH"}
XFILESEARCHPATH=${XFILESEARCHPATH:="${APPDIR}/etc/${DIST_PRODUCT}/app-defaults/%N:$XFILESEARCHPATH"}

# if ( test "`type setplot.sh`" != "setplot.sh not found" ) then
# 	. setplot.sh
# 	echo "pltr setup done"
# else
# 	echo "Warning: pltr setup file does not exist"
# fi

BATCH=`usparg -B "" $*`
LOCAL=`usparg -L "" $*`
BLOCKSIZE=`usparg -b "4096" $*`

export PATH XUI_PATH XFILESEARCHPATH XKEYSYMDB XNLSPATH XLOCALEDIR

exec ${USP_MONITOR_CMD} ${APP} -l ${XUI_PATH}/table.sort ${1:+"$@"}
