csaAssign csaAuth.send csaAwk csaAwk.cgi csaBugReport csaCheck.special csaChop csaCleanup csaClient csaCollapse csaCommit csaConceal csaCookie.set csaDebug csaExit csaExit.bdata csaExit.cdata csaExit.pcdata csaExit.env csaExit.fault csaExit.http csaExit.location csaExit.needauth csaExit.ok csaExit.session csaExit.table csaExit.value csaGetArgs csaHttp.header csaHttp.referrers csaHttp.status csaIndex csaIsConfirmed csaIsDate csaIsFullPath csaIsInteractive csaIsWeb csaLoadLib csaLock csaMkTemp csaNew csaOnCommit csaOpen csaPrintMsg csaSession.set csaSetClear csaSetTime csaSource csaStatus csaSubshell csaSum csaSwap csaSystem csaTemplate csaTest.set csaTest.unset csaTplProc csaTrapFile csaTrue csaUniq csaUnlist csaUnlock
csaExit.fault
function is defined in both
mainlib.rc
and
cgilib.rc
. In all cases the function serves the same purpose: exiting on errors. The way it accomplishes its job, however, may be different in the three cases. A command-line shell script will only load
mainlib.rc
, and the version of
csaExit.fault
contained in that library will simply exit non-zero (after doing some housekeeping) if called in that context. A CGI program, however, beside loading
mainlib.rc
will also load
cgilib.rc
. This second library will provide its own re-definition of
csaExit.fault
. The latter, if called by the CGI program, will do the housekeeping, send an error HTML page to the client and exit non-zero. In this way, that is by re-using the same function names for different context-specific code, I managed to: