#
# Library functions for the scripting library (scrib)
#
# File: scrib/lib/setup.tcl
#
# $Revision: 389238 $ on $Date: 2004-01-08 20:44:05 -0500 (Thu, 08 Jan 2004) $
# 
# Copyright (c) 1993-2003 ICEM CFD Engineering
#
#--------------------------------------------------------------------
#
# --> if the name of the first proc already exists in interp, return
#
if {"" != [info commands scrib_lib_setup_source_files]} { return }


## no path or extension should be on these files, e.g.:
##     "~scrib/lib/exec.tcl" should be listed as "exec"
## but it should work with them too...

proc scrib_lib_setup_source_files {{filelist ""}} {
    global env
    
    if ![info exists env(ICEM_SCRIB)] {
	puts "environment variable ICEM_SCRIB must be set"
	return
    }
    if {"" == $filelist} {
	mess "Error: must supply list of files to source, but fixme\n" red
    }
    foreach f $filelist {
	set f [file tail [file rootname $f]]
	set file [file join $env(ICEM_SCRIB) lib ${f}.tcl]
	catch {source "$file"} res
    }
}
#
#
#
set required_files "exec"
scrib_lib_setup_source_files $required_files
