diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-05-10 15:48:04 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-05-10 15:48:04 (GMT) |
commit | 862a4a9a3489bc2f064416e8d567c4e7d5c8fd62 (patch) | |
tree | d36d35cc31af5279aa173c46d486217413d3bffc /ds9/library/multiframe.tcl | |
parent | e12f63777bc5cfd80313c62f706c8dd595af005a (diff) | |
download | blt-862a4a9a3489bc2f064416e8d567c4e7d5c8fd62.zip blt-862a4a9a3489bc2f064416e8d567c4e7d5c8fd62.tar.gz blt-862a4a9a3489bc2f064416e8d567c4e7d5c8fd62.tar.bz2 |
add ds9 multiframe parser
Diffstat (limited to 'ds9/library/multiframe.tcl')
-rw-r--r-- | ds9/library/multiframe.tcl | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/ds9/library/multiframe.tcl b/ds9/library/multiframe.tcl index 03a5307..89342cb 100644 --- a/ds9/library/multiframe.tcl +++ b/ds9/library/multiframe.tcl @@ -136,6 +136,18 @@ proc ProcessMultiFrameCmd {varname iname sock fn} { upvar $varname var upvar $iname i + global debug + if {$debug(tcl,parser)} { + global multiframe + set multiframe(load,sock) $sock + set multiframe(load,fn) $fn + + multiframe::YY_FLUSH_BUFFER + multiframe::yy_scan_string [lrange $var $i end] + multiframe::yyparse + incr i [expr $multiframe::yycnt-1] + } else { + switch -- [string tolower [lindex $var $i]] { new { incr i @@ -176,4 +188,32 @@ proc ProcessMultiFrameCmd {varname iname sock fn} { } FinishLoad } +} +proc MultiframeCmdLoad {param} { + global multiframe + + if {$multiframe(load,sock) != {}} { + # xpa + global tcl_platform + switch $tcl_platform(os) { + Linux - + Darwin - + SunOS { + if {![LoadMultiFrameSocket $multiframe(load,sock) $param]} { + InitError xpa + LoadMultiFrameFile $param + } + } + {Windows NT} {LoadMultiFrameFile $param} + } + } else { + # comm + if {$multiframe(load,fn) != {}} { + LoadMultiFrameAlloc $multiframe(load,fn) $param + } else { + LoadMultiFrameFile $param + } + } + FinishLoad +} |