NAME(S)
CMApp_CkNum,
CMApp_GetsClean,
CMApp_IsCMProccess,
ASSERT,
CMApp_SetDebug,
CMApp_IfError,
CMApp_Debug,
CMApp_ListSet,
CMApp_SwitchList,
CMApp_ArgsAndSwitchList,
SYNOPSIS
CMApp_CkNum <args>
CMApp_GetsClean <fid>
CMApp_IsCMProccess
ASSERT <scrpt> <args>
CMApp_SetDebug <file>
CMApp_IfError <script> <actType> <actScript>
CMApp_Debug <moduleTag> <string>
CMApp_ListSet <varLst> <vals> ?flag?
CMApp_SwitchList <switchL> <argList> ?init? ?upCnt?
CMApp_ArgsAndSwitchList <switchL> <argList> ?init?
DESCRIPTION
The CMAPP library is a collection of functions which are
callable from any tcl/tk wish. They provide a layer of
helping functions between the raw CMT objects and user
scripts. This file supports some basic CMAPP commands.
Other commands can be found in:
cmapp-movie (simpleMovie.tcl)
cmapp-network (gen_net.tcl)
cmapp-tags (gen_net.tcl)
CMApp_CkNum <args>
If any of $args is not a number then an error is produced.
Switches: -noerr cases 0 to be returned for non-number.
Return: 1
CMApp_GetsClean <fid>
Returns first non-empty non-comment line from open file
'fid' or {} for EOF.
CMApp_IsCMProccess
Used to determine if this process can invoke cmp commands
directly
or if it needs to call them remotely.
ASSERT <scrpt> <args>
Like C's assert. If script evaluates to 0 reports an error.
$args
are appended to the end of the error message.
CMApp_SetDebug <file>
Simple debug output funtion. If the variable
gCMApp_DebugFile is
set to a file name (or stdout) then the string is sent
to that
file, otherwise this function is a no-op. Currently
the
moduleTag is ignored, but this may later be used to
allow finer
control of debug output.
CMApp_IfError <script> <actType> <actScript>
Simple wrapper for the common catch cases. If an error
occures in
$script, then a catch action is taken, based on $act-
Type.
Currently only rethrow is implemented. The variable
_errorTxt
contains the text within the actScript. rethrow -
actScript is executed and then the error is rethrown,
using the possibly modified _errorTxt value. Usefull
for
clean-up actions.
CMApp_Debug <moduleTag> <string>
Simple debug output funtion. If the variable
gCMApp_DebugFile is
set to a file name (or stdout) then the string is sent
to that
file, otherwise this function is a no-op. Currently
the
moduleTag is ignored, but this may later be used to
allow finer
control of debug output.
CMApp_ListSet <varLst> <vals> ?flag?
Maps a list of vals to a list of vars. If the '-init' flag
is present then, vars w/o corresponding vals are set to {},
else an error is returned. Extra vals are always ignored.
This is great for returning multipule values from a func-
tion!
CMApp_ListSet {?varName? ...} {?value? ...} ?-init?
or ?-exact? ?-excess?
CMApp_SwitchList <switchL> <argList> ?init? ?upCnt?
Takes a list of switches (without the initial dash) and sets
variables of the same names to the values specified in the
argList.
(format switchL: "{name ?initVal? ?possibleValList?}
...")
(format argList: "-sw val -sw val...) switchL
entries can be either simple names or lists. The 2nd arg is
the initial value (if pressent) and the final arg is a list
of legal values for the switch.
If the final arg to the function is -init. Then all switch
variables are initalised to {}, otherwise they are unset.
CMApp_ArgsAndSwitchList <switchL> <argList> ?init?
As CMApp_SwitchList, except that all arguments preceeding
the first switch are identified and returned.
AUTHOR
Eric Baldeschwieler, eric14@cs.berkeley.edu