File: modem.tcl

package info (click to toggle)
ppxp 0.99120923-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,812 kB
  • ctags: 3,704
  • sloc: ansic: 24,532; tcl: 3,992; makefile: 517; sh: 80
file content (39 lines) | stat: -rw-r--r-- 748 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#
#
#
#

proc Modem:List {} {
    global PPxP_SysPath PPxP_UsrPath

    set flist [glob -nocomplain [file join $PPxP_SysPath modem *]]
    if [info exists PPxP_UsrPath] {
	lappend flist [glob -nocomplain [file join $PPxP_UsrPath modem *]]
    }
    set mlist {}

    foreach fname $flist {
	if {$fname == "" || [file isdirectory $fname]} {
	    continue
	}
	set f [open $fname]
	set name [file tail $fname]
	set desc ""

	while {[gets $f l] >= 0} {
	    if [regexp -nocase {name} [lindex $l 0]] {
		set desc [lindex $l 1]
		break
	    }
	}
	close $f
	set m [format "%-12s (%s)" $name $desc]
	set mlist [lappend mlist $m]
    }
    lsort $mlist
}

proc Modem:SetVar {val} {
    global PPxPVar
    set PPxPVar(SERIAL.MODEM) [lindex [split $val] 0]
}