#!/bin/csh
# File Name:    kit_export
# File Purpose: This file is a c-shell script that is designed to take a KIT
#               item that has been created and automatically e-mail it to the
#               RnD team (gen_kit@frontline-pcb.com).
# Written by:   Ian Ticehurst (Autom8 Ltd.)
# Version 1A.:  Date: 16.08.00 - Initial design and development.
# Version 1B.:  Date: 27.10.00 - Addition of $TMP definition and useage.
# Version 1B.:  Date: 05.12.00 - Removal of "gui" alias.
# Version 1C.:  Date: 04.04.01 - added "set path".
############################# Start of notes ###############################
# This file is called from KIT when the "export" button is selected.
# It receives the name of the
# KIT item file to export.  This script makes it a simple task to mail
# this file on to Frontline without having to open an e-mail application.
# (of course, you will need to be able to access e-mail via a command line. For
# example, using the unix mail command).
############################# End of notes ###############################

if ($?GENESIS_TMP) then
   set TMP = $GENESIS_TMP
else if ($?GENESIS_DIR) then
   set TMP = $GENESIS_DIR/tmp
else
   set TMP = /genesis/tmp
endif

if($?GENESIS_DIR)then
  set _genesis_root=$GENESIS_DIR
else
  set _genesis_root=/genesis
endif

if($?GENESIS_EDIR)then
  set _genesis_edir=$GENESIS_EDIR
else
  set _genesis_edir=e$GENESIS_VER
endif

if($_genesis_edir =~ /* || $_genesis_edir =~ ?:*)then
  set path=($_genesis_edir/all $path)
else
  set path=($_genesis_root/$_genesis_edir/all $path)
endif

# Set up gui data and response files
set GUI_DATA = $TMP/gui_data.$$
set GUI_RESP = $TMP/gui_resp.$$

# Put window on screen.
echo "WIN 200 200" >> $GUI_DATA
echo "FONT tbr14" >> $GUI_DATA
echo "BG 222299" >> $GUI_DATA
echo "FG 999999" >> $GUI_DATA
echo "LABEL Frontline Default Hook Pop-up" >> $GUI_DATA
echo "LABEL This is the default hook kit_export" >> $GUI_DATA
echo "LABEL It is located in $GENESIS_DIR/sys/hooks" >> $GUI_DATA
echo "LABEL The hook is designed to e-mail a KIT item directly to Frontline" >> $GUI_DATA
echo "LABEL The KIT file just created is $1" >> $GUI_DATA
echo "LABEL Comments can be found in the header of this hook" >> $GUI_DATA
echo "LABEL See also the on-line manual 0203 (chapter 9) for more details" >> $GUI_DATA
echo "END" >> $GUI_DATA

gui $GUI_DATA
\rm $GUI_DATA

############################ END OF PROGRAM #####################
