diff options
Diffstat (limited to 'tools/man2html1.tcl')
-rw-r--r-- | tools/man2html1.tcl | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/tools/man2html1.tcl b/tools/man2html1.tcl index 0adc61e..f2b2e43 100644 --- a/tools/man2html1.tcl +++ b/tools/man2html1.tcl @@ -4,9 +4,8 @@ # man page to html conversion process. It is sourced by h.tcl. # # Copyright (c) 1996 by Sun Microsystems, Inc. -# -# SCCS: @(#) man2html1.tcl 1.2 96/03/21 10:48:29 -# + +package require Tcl 8.4 # Global variables used by these scripts: # @@ -27,7 +26,6 @@ # inDT - in dictionary term. - # text -- # # This procedure adds entries to the hypertext arrays NAME_file @@ -39,7 +37,6 @@ # Arguments: # string - Text to index. - proc text string { global state curFile NAME_file KEY_file inDT @@ -80,7 +77,7 @@ proc macro {name args} { switch $args { NAME { - if {$state == "INIT" } { + if {$state eq "INIT"} { set state NAME } } @@ -100,8 +97,8 @@ proc macro {name args} { set inDT 0 set state INIT if {[llength $args] != 5} { - set args [join $args " "] - puts stderr "Bad .TH macro: .$name $args" + set args [join $args " "] + puts stderr "Bad .TH macro: .$name $args" } set lib [lindex $args 3] ;# Tcl or Tk } @@ -109,7 +106,6 @@ proc macro {name args} { } - # dash -- # # This procedure is invoked to handle dash characters ("\-" in @@ -120,13 +116,12 @@ proc macro {name args} { proc dash {} { global state - if {$state == "NAME"} { + if {$state eq "NAME"} { set state DASH } } - # newline -- # # This procedure is invoked to handle newlines in the troff input. @@ -141,8 +136,6 @@ proc newline {} { } - - # initGlobals, tab, font, char, macro2 -- # # These procedures do nothing during the first pass. @@ -184,14 +177,14 @@ proc doListing {file pattern} { return } incr max_len - set ncols [expr 90/$max_len] - set nrows [expr int( ceil( [llength $type] / $ncols. ) ) ] + set ncols [expr {90/$max_len}] + set nrows [expr {int(ceil([llength $type] / double($ncols)))} ] # ? max_len ncols nrows set index 0 foreach f $type { - lappend row([expr $index % $nrows]) $f + lappend row([expr {$index % $nrows}]) $f incr index } @@ -215,8 +208,9 @@ proc doListing {file pattern} { # # Arguments: # file - name of the contents file. -# packageName - string used in the title and sub-heads of the HTML page. Normally -# name of the package without version numbers. +# packageName - string used in the title and sub-heads of the HTML +# page. Normally name of the package without version +# numbers. proc doContents {file packageName} { global footer @@ -239,8 +233,6 @@ proc doContents {file packageName} { } - - # do -- # # This is the toplevel procedure that searches a man page @@ -266,4 +258,3 @@ proc do fileName { exit 1 } } - |