summaryrefslogtreecommitdiff
path: root/tcl/tools
diff options
context:
space:
mode:
authorIan Roxborough <irox@redhat.com>2001-09-09 22:40:53 +0000
committerIan Roxborough <irox@redhat.com>2001-09-09 22:40:53 +0000
commita850c17c374d03259483e799b09326d255e17487 (patch)
treef1d024951a993f0453aa49d4ba808d6c38fa4321 /tcl/tools
parent57e8350a3895a1579b77cc134d6d7d49b056678e (diff)
downloadgdb-a850c17c374d03259483e799b09326d255e17487.tar.gz
Tcl 8.3 upgradeTCL_8_3
Diffstat (limited to 'tcl/tools')
-rw-r--r--tcl/tools/Makefile.in69
-rw-r--r--tcl/tools/README28
-rw-r--r--tcl/tools/checkLibraryDoc.tcl296
-rwxr-xr-xtcl/tools/configure749
-rw-r--r--tcl/tools/configure.in33
-rw-r--r--tcl/tools/cvtEOL.tcl35
-rw-r--r--tcl/tools/genStubs.tcl894
-rw-r--r--tcl/tools/genWinImage.tcl158
-rw-r--r--tcl/tools/index.tcl202
-rw-r--r--tcl/tools/man2help.tcl130
-rw-r--r--tcl/tools/man2help2.tcl970
-rw-r--r--tcl/tools/man2html.tcl181
-rw-r--r--tcl/tools/man2html1.tcl269
-rw-r--r--tcl/tools/man2html2.tcl871
-rw-r--r--tcl/tools/man2tcl.c405
-rw-r--r--tcl/tools/regexpTestLib.tcl266
-rw-r--r--tcl/tools/tcl.hpj.in19
-rw-r--r--tcl/tools/tcl.wse.in2356
-rw-r--r--tcl/tools/tclSplash.bmpbin0 -> 162030 bytes
-rwxr-xr-xtcl/tools/tcltk-man2html.tcl1675
-rw-r--r--tcl/tools/uniClass.tcl61
-rw-r--r--tcl/tools/uniParse.tcl386
-rw-r--r--tcl/tools/white.bmpbin0 -> 20522 bytes
23 files changed, 10053 insertions, 0 deletions
diff --git a/tcl/tools/Makefile.in b/tcl/tools/Makefile.in
new file mode 100644
index 00000000000..a2551c239d6
--- /dev/null
+++ b/tcl/tools/Makefile.in
@@ -0,0 +1,69 @@
+# This makefile is used to convert Tcl manual pages into various
+# alternate formats:
+#
+# Windows help file: 1. Build the winhelp target on Unix
+# 2. Build the helpfile target on Windows
+#
+# HTML: 1. Build the html target on Unix
+
+# RCS: @(#) $Id$
+
+TCL = tcl@TCL_VERSION@
+TK = tk@TCL_VERSION@
+VER = @TCL_WIN_VERSION@
+
+TCL_BIN_DIR = @TCL_BIN_DIR@
+TCL_SOURCE = @TCL_SRC_DIR@
+TK_SOURCE = $(TCL_SOURCE)/../$(TK)
+PRO_SOURCE = $(TCL_SOURCE)/../pro
+ITCL_SOURCE = $(TCL_SOURCE)/../itcl3.1.0
+
+TCL_DOCS = $(TCL_SOURCE)/doc/*.[13n]
+
+TK_DOCS = $(TK_SOURCE)/doc/*.[13n]
+
+PRO_DOCS = \
+ $(PRO_SOURCE)/doc/man/procheck.1 \
+ $(PRO_SOURCE)/doc/man/prodebug.1 \
+ $(PRO_SOURCE)/doc/man/prodebug.n \
+ $(PRO_SOURCE)/doc/man/prolicense.1
+
+ITCL_DOCS = \
+ $(ITCL_SOURCE)/itcl/doc/*.[13n] \
+ $(ITCL_SOURCE)/itk/doc/*.[13n]
+
+# $(ITCL_SOURCE)/iwidgets3.0.0/doc/*.[13n]
+
+COREDOCS = $(TCL_DOCS) $(TK_DOCS)
+#PRODOCS = $(COREDOCS) $(PRO_DOCS) $(ITCL_DOCS)
+PRODOCS = $(COREDOCS) $(PRO_DOCS)
+TCLSH = $(TCL_BIN_DIR)/tclsh
+CC = @CC@
+
+#
+# Targets
+#
+
+all: core
+
+pro:
+ $(MAKE) DOCS="$(PRODOCS)" VER="" rtf
+
+core:
+ $(MAKE) DOCS="$(COREDOCS)" rtf
+
+rtf: $(TCL_SOURCE)/tools/man2help.tcl man2tcl $(DOCS)
+ LD_LIBRARY_PATH=$(TCL_BIN_DIR) \
+ TCL_LIBRARY=$(TCL_SOURCE)/library \
+ $(TCLSH) $(TCL_SOURCE)/tools/man2help.tcl tcl "$(VER)" $(DOCS)
+
+winhelp: tcl.rtf
+
+man2tcl: $(TCL_SOURCE)/tools/man2tcl.c
+ $(CC) $(CFLAGS) -o man2tcl $(TCL_SOURCE)/tools/man2tcl.c
+
+clean:
+ -rm -f man2tcl *.o *.cnt *.rtf
+
+helpfile:
+ hcw /c /e tcl.hpj
diff --git a/tcl/tools/README b/tcl/tools/README
new file mode 100644
index 00000000000..821b2b3e377
--- /dev/null
+++ b/tcl/tools/README
@@ -0,0 +1,28 @@
+This directory contains unsupported tools used to build parts of Tcl
+for distribution.
+
+
+uniParse.tcl -- Script for converting the Unicode character database
+ into a compact table stored in generic/tclUniData.c.
+
+uniClass.tcl -- Script for generating regexp class tables from the Tcl
+ "string is" classes
+
+Generating HTML files.
+The tcl-tk-man-html.tcl script from Robert Critchlow
+generates a nice set of HTML with good cross references.
+Use it like
+ tclsh tcl-tk-man-html.tcl --htmldir=/tmp/tcl8.2
+This script is very picky about the organization of man pages,
+effectively acting as a style enforcer.
+
+Generating Windows Help Files:
+1) Build tcl in the ../unix directory
+2) On UNIX, (after autoconf and configure), do
+ make
+ this converts the Nroff to RTF files.
+2) On Windows, convert the RTF to a Help doc, do
+ nmake helpfile
+
+Generating Windows binary distribution.
+Update and compile the WYSE tcl.wse configuration.
diff --git a/tcl/tools/checkLibraryDoc.tcl b/tcl/tools/checkLibraryDoc.tcl
new file mode 100644
index 00000000000..3e7169b6ff5
--- /dev/null
+++ b/tcl/tools/checkLibraryDoc.tcl
@@ -0,0 +1,296 @@
+# checkLibraryDoc.tcl --
+#
+# This script attempts to determine what APIs exist in the source base that
+# have not been documented. By grepping through all of the doc/*.3 man
+# pages, looking for "Pkg_*" (e.g., Tcl_ or Tk_), and comparing this list
+# against the list of Pkg_ APIs found in the source (e.g., tcl8.2/*/*.[ch])
+# we create six lists:
+# 1) APIs in Source not in Docs.
+# 2) APIs in Docs not in Source.
+# 3) Internal APIs and structs.
+# 4) Misc APIs and structs that we are not documenting.
+# 5) Command APIs (e.g., Tcl_ArrayObjCmd.)
+# 6) Proc pointers (e.g., Tcl_CloseProc.)
+#
+# Note: Each list is "a best guess" approximation. If developers write
+# non-standard code, this script will produce erroneous results. Each
+# list should be carefully checked for accuracy.
+#
+# Copyright (c) 1998-1999 by Scriptics Corporation.
+# All rights reserved.
+#
+# RCS: @(#) $Id$
+
+
+lappend auto_path "c:/program\ files/tclpro1.2/win32-ix86/bin"
+#lappend auto_path "/home/surles/cvs/tclx8.0/tcl/unix"
+if {[catch {package require Tclx}]} {
+ puts "error: could not load TclX. Please set TCL_LIBRARY."
+ exit 1
+}
+
+# A list of structs that are known to be undocumented.
+
+set StructList {
+ Tcl_AsyncHandler \
+ Tcl_CallFrame \
+ Tcl_Condition \
+ Tcl_Encoding \
+ Tcl_EncodingState \
+ Tcl_EncodingType \
+ Tcl_EolTranslation \
+ Tcl_HashEntry \
+ Tcl_HashSearch \
+ Tcl_HashTable \
+ Tcl_Mutex \
+ Tcl_Pid \
+ Tcl_QueuePosition \
+ Tcl_ResolvedVarInfo \
+ Tcl_SavedResult \
+ Tcl_ThreadDataKey \
+ Tcl_ThreadId \
+ Tcl_Time \
+ Tcl_TimerToken \
+ Tcl_Token \
+ Tcl_Trace \
+ Tcl_Value \
+ Tcl_ValueType \
+ Tcl_Var \
+ Tk_3DBorder \
+ Tk_ArgvInfo \
+ Tk_BindingTable \
+ Tk_Canvas \
+ Tk_CanvasTextInfo \
+ Tk_ConfigSpec \
+ Tk_ConfigTypes \
+ Tk_Cursor \
+ Tk_CustomOption \
+ Tk_ErrorHandler \
+ Tk_FakeWin \
+ Tk_Font \
+ Tk_FontMetrics \
+ Tk_GeomMgr \
+ Tk_Image \
+ Tk_ImageMaster \
+ Tk_ImageType \
+ Tk_Item \
+ Tk_ItemType \
+ Tk_OptionSpec\
+ Tk_OptionTable \
+ Tk_OptionType \
+ Tk_PhotoHandle \
+ Tk_PhotoImageBlock \
+ Tk_PhotoImageFormat \
+ Tk_PostscriptInfo \
+ Tk_SavedOption \
+ Tk_SavedOptions \
+ Tk_SegType \
+ Tk_TextLayout \
+ Tk_Window \
+}
+
+# Misc junk that appears in the comments of the source. This just
+# allows us to filter comments that "fool" the script.
+
+set CommentList {
+ Tcl_Create\[Obj\]Command \
+ Tcl_DecrRefCount\\n \
+ Tcl_NewObj\\n \
+ Tk_GetXXX \
+}
+
+# Main entry point to this script.
+
+proc main {} {
+ global argv0
+ global argv
+
+ set len [llength $argv]
+ if {($len != 2) && ($len != 3)} {
+ puts "usage: $argv0 pkgName pkgDir \[outFile\]"
+ puts " pkgName == Tcl,Tk"
+ puts " pkgDir == /home/surles/cvs/tcl8.2"
+ exit 1
+ }
+
+ set pkg [lindex $argv 0]
+ set dir [lindex $argv 1]
+ if {[llength $argv] == 3} {
+ set file [open [lindex $argv 2] w]
+ } else {
+ set file stdout
+ }
+
+ foreach {c d} [compare [grepCode $dir $pkg] [grepDocs $dir $pkg]] {}
+ filter $c $d $dir $pkg $file
+
+ if {$file != "stdout"} {
+ close $file
+ }
+ return
+}
+
+# Intersect the two list and write out the sets of APIs in one
+# list that is not in the other.
+
+proc compare {list1 list2} {
+ set inter [intersect3 $list1 $list2]
+ return [list [lindex $inter 0] [lindex $inter 2]]
+}
+
+# Filter the lists into the six lists we report on. Then write
+# the results to the file.
+
+proc filter {code docs dir pkg {outFile stdout}} {
+ set apis {}
+
+ # A list of Tcl command APIs. These are not documented.
+ # This list should just be verified for accuracy.
+
+ set cmds {}
+
+ # A list of proc pointer structs. These are not documented.
+ # This list should just be verified for accuracy.
+
+ set procs {}
+
+ # A list of internal declarations. These are not documented.
+ # This list should just be verified for accuracy.
+
+ set decls [grepDecl $dir $pkg]
+
+ # A list of misc. procedure declarations that are not documented.
+ # This list should just be verified for accuracy.
+
+ set misc [grepMisc $dir $pkg]
+
+ set pat1 ".*(${pkg}_\[A-z0-9]+).*$"
+
+ # A list of APIs in the source, not in the docs.
+ # This list should just be verified for accuracy.
+
+ foreach x $code {
+ if {[string match *Cmd $x]} {
+ if {[string match ${pkg}* $x]} {
+ lappend cmds $x
+ }
+ } elseif {[string match *Proc $x]} {
+ if {[string match ${pkg}* $x]} {
+ lappend procs $x
+ }
+ } elseif {[lsearch -exact $decls $x] >= 0} {
+ # No Op.
+ } elseif {[lsearch -exact $misc $x] >= 0} {
+ # No Op.
+ } else {
+ lappend apis $x
+ }
+ }
+
+ dump $apis "APIs in Source not in Docs." $outFile
+ dump $docs "APIs in Docs not in Source." $outFile
+ dump $decls "Internal APIs and structs." $outFile
+ dump $misc "Misc APIs and structs that we are not documenting." $outFile
+ dump $cmds "Command APIs." $outFile
+ dump $procs "Proc pointers." $outFile
+ return
+}
+
+# Print the list of APIs if the list is not null.
+
+proc dump {list title file} {
+ if {$list != {}} {
+ puts $file ""
+ puts $file $title
+ puts $file "---------------------------------------------------------"
+ foreach x $list {
+ puts $file $x
+ }
+ }
+}
+
+# Grep into "dir/*/*.[ch]" looking for APIs that match $pkg_*.
+# (e.g., Tcl_Exit). Return a list of APIs.
+
+proc grepCode {dir pkg} {
+ set apis [myGrep "${pkg}_\.\*" "${dir}/\*/\*\.\[ch\]"]
+ set pat1 ".*(${pkg}_\[A-z0-9]+).*$"
+
+ foreach a $apis {
+ if {[regexp -- $pat1 $a main n1]} {
+ set result([string trim $n1]) 1
+ }
+ }
+ return [lsort [array names result]]
+}
+
+# Grep into "dir/doc/*.3" looking for APIs that match $pkg_*.
+# (e.g., Tcl_Exit). Return a list of APIs.
+
+proc grepDocs {dir pkg} {
+ set apis [myGrep "\\fB${pkg}_\.\*\\fR" "${dir}/doc/\*\.3"]
+ set pat1 ".*(${pkg}_\[A-z0-9]+)\\\\fR.*$"
+
+ foreach a $apis {
+ if {[regexp -- $pat1 $a main n1]} {
+ set result([string trim $n1]) 1
+ }
+ }
+ return [lsort [array names result]]
+}
+
+# Grep into "generic/pkgIntDecls.h" looking for APIs that match $pkg_*.
+# (e.g., Tcl_Export). Return a list of APIs.
+
+proc grepDecl {dir pkg} {
+ set file [file join $dir generic "[string tolower $pkg]IntDecls.h"]
+ set apis [myGrep "^EXTERN.*\[ \t\]${pkg}_.*" $file]
+ set pat1 ".*(${pkg}_\[A-z0-9]+).*$"
+
+ foreach a $apis {
+ if {[regexp -- $pat1 $a main n1]} {
+ set result([string trim $n1]) 1
+ }
+ }
+ return [lsort [array names result]]
+}
+
+# Grep into "*/*.[ch]" looking for APIs that match $pkg_Db*.
+# (e.g., Tcl_DbCkalloc). Return a list of APIs.
+
+proc grepMisc {dir pkg} {
+ global CommentList
+ global StructList
+
+ set apis [myGrep "^EXTERN.*\[ \t\]${pkg}_Db.*" "${dir}/\*/\*\.\[ch\]"]
+ set pat1 ".*(${pkg}_\[A-z0-9]+).*$"
+
+ foreach a $apis {
+ if {[regexp -- $pat1 $a main n1]} {
+ set dbg([string trim $n1]) 1
+ }
+ }
+
+ set result {}
+ eval {lappend result} $StructList
+ eval {lappend result} [lsort [array names dbg]]
+ eval {lappend result} $CommentList
+ return $result
+}
+
+proc myGrep {searchPat globPat} {
+ set result {}
+ foreach file [glob -nocomplain $globPat] {
+ set file [open $file r]
+ set data [read $file]
+ close $file
+ foreach line [split $data "\n"] {
+ if {[regexp "^.*${searchPat}.*\$" $line]} {
+ lappend result $line
+ }
+ }
+ }
+ return $result
+}
+main
+
diff --git a/tcl/tools/configure b/tcl/tools/configure
new file mode 100755
index 00000000000..c63dbe2f201
--- /dev/null
+++ b/tcl/tools/configure
@@ -0,0 +1,749 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.9
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+ac_help="$ac_help
+ --with-tcl=DIR use Tcl 8.1 binaries from DIR"
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.9"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=man2tcl.c
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+# RCS: @(#) $Id$
+
+# Recover information that Tcl computed with its configure script.
+
+#--------------------------------------------------------------------
+# See if there was a command-line option for where Tcl is; if
+# not, assume that its top-level directory is a sibling of ours.
+#--------------------------------------------------------------------
+
+# Check whether --with-tcl or --without-tcl was given.
+if test "${with_tcl+set}" = set; then
+ withval="$with_tcl"
+ TCL_BIN_DIR=$withval
+else
+ TCL_BIN_DIR=`cd ../../tcl8.1$TCL_PATCH_LEVEL/unix; pwd`
+fi
+
+if test ! -d $TCL_BIN_DIR; then
+ { echo "configure: error: Tcl directory $TCL_BIN_DIR doesn't exist" 1>&2; exit 1; }
+fi
+if test ! -f $TCL_BIN_DIR/tclConfig.sh; then
+ { echo "configure: error: There's no tclConfig.sh in $TCL_BIN_DIR; perhaps you didn't specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?" 1>&2; exit 1; }
+fi
+
+. $TCL_BIN_DIR/tclConfig.sh
+
+TCL_WIN_VERSION=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION
+
+CC=$TCL_CC
+
+
+
+
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \
+ >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.9"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+
+trap 'rm -fr `echo "Makefile tcl.hpj" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@TCL_WIN_VERSION@%$TCL_WIN_VERSION%g
+s%@CC@%$CC%g
+s%@TCL_VERSION@%$TCL_VERSION%g
+s%@TCL_PATCH_LEVEL@%$TCL_PATCH_LEVEL%g
+s%@TCL_SRC_DIR@%$TCL_SRC_DIR%g
+s%@TCL_BIN_DIR@%$TCL_BIN_DIR%g
+
+CEOF
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile tcl.hpj"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust relative srcdir, etc. for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
+fi; done
+rm -f conftest.subs
+
+
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/tcl/tools/configure.in b/tcl/tools/configure.in
new file mode 100644
index 00000000000..7b6d947087e
--- /dev/null
+++ b/tcl/tools/configure.in
@@ -0,0 +1,33 @@
+dnl This file is an input file used by the GNU "autoconf" program to
+dnl generate the file "configure", which is run to configure the
+dnl Makefile in this directory.
+AC_INIT(man2tcl.c)
+# RCS: @(#) $Id$
+
+# Recover information that Tcl computed with its configure script.
+
+#--------------------------------------------------------------------
+# See if there was a command-line option for where Tcl is; if
+# not, assume that its top-level directory is a sibling of ours.
+#--------------------------------------------------------------------
+
+AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.3 binaries from DIR], TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd ../../tcl8.3$TCL_PATCH_LEVEL/unix; pwd`)
+if test ! -d $TCL_BIN_DIR; then
+ AC_MSG_ERROR(Tcl directory $TCL_BIN_DIR doesn't exist)
+fi
+if test ! -f $TCL_BIN_DIR/tclConfig.sh; then
+ AC_MSG_ERROR(There's no tclConfig.sh in $TCL_BIN_DIR; perhaps you didn't specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?)
+fi
+
+. $TCL_BIN_DIR/tclConfig.sh
+
+TCL_WIN_VERSION=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION
+AC_SUBST(TCL_WIN_VERSION)
+CC=$TCL_CC
+AC_SUBST(CC)
+AC_SUBST(TCL_VERSION)
+AC_SUBST(TCL_PATCH_LEVEL)
+AC_SUBST(TCL_SRC_DIR)
+AC_SUBST(TCL_BIN_DIR)
+
+AC_OUTPUT(Makefile tcl.hpj)
diff --git a/tcl/tools/cvtEOL.tcl b/tcl/tools/cvtEOL.tcl
new file mode 100644
index 00000000000..e2df3410217
--- /dev/null
+++ b/tcl/tools/cvtEOL.tcl
@@ -0,0 +1,35 @@
+# cvtEOL.tcl --
+#
+# This file contains a script to parse a Tcl/Tk distribution and
+# convert the EOL from \n to \r on all text files.
+#
+# Copyright (c) 1996-1997 by Sun Microsystems, Inc.
+#
+# SCCS: @(#) cvtEOL.tcl 1.1 97/01/30 11:33:33
+#
+
+#
+# Convert files in the distribution to Mac style
+#
+
+set distDir [lindex $argv 0]
+
+set dirs {unix mac generic win library compat tests unix/dltest \
+ library/demos library/demos/images bitmaps xlib xlib/X11 .}
+set files {*.c *.y *.h *.r *.tcl *.test *.rc *.bc *.vc *.bmp *.html \
+ *.in *.notes *.terms all defs \
+ README ToDo changes tclIndex configure install-sh mkLinks \
+ square widget rmt ixset hello browse rolodex tcolor timer}
+
+foreach x $dirs {
+ if [catch {cd $distDir/$x}] continue
+ puts "Working on $x..."
+ foreach y [eval glob $files] {
+ exec chmod 666 $y
+ exec cp $y $y.tmp
+ exec tr \012 \015 < $y.tmp > $y
+ exec chmod 444 $y
+ exec rm $y.tmp
+ }
+}
+
diff --git a/tcl/tools/genStubs.tcl b/tcl/tools/genStubs.tcl
new file mode 100644
index 00000000000..ee0bfd4d067
--- /dev/null
+++ b/tcl/tools/genStubs.tcl
@@ -0,0 +1,894 @@
+# genStubs.tcl --
+#
+# This script generates a set of stub files for a given
+# interface.
+#
+#
+# Copyright (c) 1998-1999 by Scriptics Corporation.
+# See the file "license.terms" for information on usage and redistribution
+# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+#
+# RCS: @(#) $Id$
+
+namespace eval genStubs {
+ # libraryName --
+ #
+ # The name of the entire library. This value is used to compute
+ # the USE_*_STUB_PROCS macro and the name of the init file.
+
+ variable libraryName "UNKNOWN"
+
+ # interfaces --
+ #
+ # An array indexed by interface name that is used to maintain
+ # the set of valid interfaces. The value is empty.
+
+ array set interfaces {}
+
+ # curName --
+ #
+ # The name of the interface currently being defined.
+
+ variable curName "UNKNOWN"
+
+ # hooks --
+ #
+ # An array indexed by interface name that contains the set of
+ # subinterfaces that should be defined for a given interface.
+
+ array set hooks {}
+
+ # stubs --
+ #
+ # This three dimensional array is indexed first by interface name,
+ # second by platform name, and third by a numeric offset or the
+ # constant "lastNum". The lastNum entry contains the largest
+ # numeric offset used for a given interface/platform combo. Each
+ # numeric offset contains the C function specification that
+ # should be used for the given entry in the stub table. The spec
+ # consists of a list in the form returned by parseDecl.
+
+ array set stubs {}
+
+ # outDir --
+ #
+ # The directory where the generated files should be placed.
+
+ variable outDir .
+}
+
+# genStubs::library --
+#
+# This function is used in the declarations file to set the name
+# of the library that the interfaces are associated with (e.g. "tcl").
+# This value will be used to define the inline conditional macro.
+#
+# Arguments:
+# name The library name.
+#
+# Results:
+# None.
+
+proc genStubs::library {name} {
+ variable libraryName $name
+}
+
+# genStubs::interface --
+#
+# This function is used in the declarations file to set the name
+# of the interface currently being defined.
+#
+# Arguments:
+# name The name of the interface.
+#
+# Results:
+# None.
+
+proc genStubs::interface {name} {
+ variable curName $name
+ variable interfaces
+
+ set interfaces($name) {}
+ return
+}
+
+# genStubs::hooks --
+#
+# This function defines the subinterface hooks for the current
+# interface.
+#
+# Arguments:
+# names The ordered list of interfaces that are reachable through the
+# hook vector.
+#
+# Results:
+# None.
+
+proc genStubs::hooks {names} {
+ variable curName
+ variable hooks
+
+ set hooks($curName) $names
+ return
+}
+
+# genStubs::declare --
+#
+# This function is used in the declarations file to declare a new
+# interface entry.
+#
+# Arguments:
+# index The index number of the interface.
+# platform The platform the interface belongs to. Should be one
+# of generic, win, unix, or mac.
+# decl The C function declaration, or {} for an undefined
+# entry.
+#
+# Results:
+# None.
+
+proc genStubs::declare {args} {
+ variable stubs
+ variable curName
+
+ if {[llength $args] != 3} {
+ puts stderr "wrong # args: declare $args"
+ }
+ lassign $args index platformList decl
+
+ # Check for duplicate declarations, then add the declaration and
+ # bump the lastNum counter if necessary.
+
+ foreach platform $platformList {
+ if {[info exists stubs($curName,$platform,$index)]} {
+ puts stderr "Duplicate entry: declare $args"
+ }
+ }
+ regsub -all "\[ \t\n\]+" [string trim $decl] " " decl
+ set decl [parseDecl $decl]
+
+ foreach platform $platformList {
+ if {$decl != ""} {
+ set stubs($curName,$platform,$index) $decl
+ if {![info exists stubs($curName,$platform,lastNum)] \
+ || ($index > $stubs($curName,$platform,lastNum))} {
+ set stubs($curName,$platform,lastNum) $index
+ }
+ }
+ }
+ return
+}
+
+# genStubs::rewriteFile --
+#
+# This function replaces the machine generated portion of the
+# specified file with new contents. It looks for the !BEGIN! and
+# !END! comments to determine where to place the new text.
+#
+# Arguments:
+# file The name of the file to modify.
+# text The new text to place in the file.
+#
+# Results:
+# None.
+
+proc genStubs::rewriteFile {file text} {
+ if {![file exist $file]} {
+ puts stderr "Cannot find file: $file"
+ return
+ }
+ set in [open ${file} r]
+ set out [open ${file}.new w]
+
+ # Always write out the file with LF termination
+ fconfigure $out -translation lf
+
+ while {![eof $in]} {
+ set line [gets $in]
+ if {[regexp {!BEGIN!} $line]} {
+ break
+ }
+ puts $out $line
+ }
+ puts $out "/* !BEGIN!: Do not edit below this line. */"
+ puts $out $text
+ while {![eof $in]} {
+ set line [gets $in]
+ if {[regexp {!END!} $line]} {
+ break
+ }
+ }
+ puts $out "/* !END!: Do not edit above this line. */"
+ puts -nonewline $out [read $in]
+ close $in
+ close $out
+ file rename -force ${file}.new ${file}
+ return
+}
+
+# genStubs::addPlatformGuard --
+#
+# Wrap a string inside a platform #ifdef.
+#
+# Arguments:
+# plat Platform to test.
+#
+# Results:
+# Returns the original text inside an appropriate #ifdef.
+
+proc genStubs::addPlatformGuard {plat text} {
+ switch $plat {
+ win {
+ return "#ifdef __WIN32__\n${text}#endif /* __WIN32__ */\n"
+ }
+ unix {
+ return "#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */\n${text}#endif /* UNIX */\n"
+ }
+ mac {
+ return "#ifdef MAC_TCL\n${text}#endif /* MAC_TCL */\n"
+ }
+ }
+ return "$text"
+}
+
+# genStubs::emitSlots --
+#
+# Generate the stub table slots for the given interface. If there
+# are no generic slots, then one table is generated for each
+# platform, otherwise one table is generated for all platforms.
+#
+# Arguments:
+# name The name of the interface being emitted.
+# textVar The variable to use for output.
+#
+# Results:
+# None.
+
+proc genStubs::emitSlots {name textVar} {
+ variable stubs
+ upvar $textVar text
+
+ forAllStubs $name makeSlot 1 text {" void *reserved$i;\n"}
+ return
+}
+
+# genStubs::parseDecl --
+#
+# Parse a C function declaration into its component parts.
+#
+# Arguments:
+# decl The function declaration.
+#
+# Results:
+# Returns a list of the form {returnType name args}. The args
+# element consists of a list of type/name pairs, or a single
+# element "void". If the function declaration is malformed
+# then an error is displayed and the return value is {}.
+
+proc genStubs::parseDecl {decl} {
+ if {![regexp {^(.*)\((.*)\)$} $decl all prefix args]} {
+ puts stderr "Malformed declaration: $decl"
+ return
+ }
+ set prefix [string trim $prefix]
+ if {![regexp {^(.+[ ][*]*)([^ *]+)$} $prefix all rtype fname]} {
+ puts stderr "Bad return type: $decl"
+ return
+ }
+ set rtype [string trim $rtype]
+ foreach arg [split $args ,] {
+ lappend argList [string trim $arg]
+ }
+ if {![string compare [lindex $argList end] "..."]} {
+ if {[llength $argList] != 2} {
+ puts stderr "Only one argument is allowed in varargs form: $decl"
+ }
+ set arg [parseArg [lindex $argList 0]]
+ if {$arg == "" || ([llength $arg] != 2)} {
+ puts stderr "Bad argument: '[lindex $argList 0]' in '$decl'"
+ return
+ }
+ set args [list TCL_VARARGS $arg]
+ } else {
+ set args {}
+ foreach arg $argList {
+ set argInfo [parseArg $arg]
+ if {![string compare $argInfo "void"]} {
+ lappend args "void"
+ break
+ } elseif {[llength $argInfo] == 2 || [llength $argInfo] == 3} {
+ lappend args $argInfo
+ } else {
+ puts stderr "Bad argument: '$arg' in '$decl'"
+ return
+ }
+ }
+ }
+ return [list $rtype $fname $args]
+}
+
+# genStubs::parseArg --
+#
+# This function parses a function argument into a type and name.
+#
+# Arguments:
+# arg The argument to parse.
+#
+# Results:
+# Returns a list of type and name with an optional third array
+# indicator. If the argument is malformed, returns "".
+
+proc genStubs::parseArg {arg} {
+ if {![regexp {^(.+[ ][*]*)([^][ *]+)(\[\])?$} $arg all type name array]} {
+ if {$arg == "void"} {
+ return $arg
+ } else {
+ return
+ }
+ }
+ set result [list [string trim $type] $name]
+ if {$array != ""} {
+ lappend result $array
+ }
+ return $result
+}
+
+# genStubs::makeDecl --
+#
+# Generate the prototype for a function.
+#
+# Arguments:
+# name The interface name.
+# decl The function declaration.
+# index The slot index for this function.
+#
+# Results:
+# Returns the formatted declaration string.
+
+proc genStubs::makeDecl {name decl index} {
+ lassign $decl rtype fname args
+
+ append text "/* $index */\n"
+ set line "EXTERN $rtype"
+ set count [expr {2 - ([string length $line] / 8)}]
+ append line [string range "\t\t\t" 0 $count]
+ set pad [expr {24 - [string length $line]}]
+ if {$pad <= 0} {
+ append line " "
+ set pad 0
+ }
+ append line "$fname _ANSI_ARGS_("
+
+ set arg1 [lindex $args 0]
+ switch -exact $arg1 {
+ void {
+ append line "(void)"
+ }
+ TCL_VARARGS {
+ set arg [lindex $args 1]
+ append line "TCL_VARARGS([lindex $arg 0],[lindex $arg 1])"
+ }
+ default {
+ set sep "("
+ foreach arg $args {
+ append line $sep
+ set next {}
+ append next [lindex $arg 0] " " [lindex $arg 1] \
+ [lindex $arg 2]
+ if {[string length $line] + [string length $next] \
+ + $pad > 76} {
+ append text $line \n
+ set line "\t\t\t\t"
+ set pad 28
+ }
+ append line $next
+ set sep ", "
+ }
+ append line ")"
+ }
+ }
+ append text $line
+
+ append text ");\n"
+ return $text
+}
+
+# genStubs::makeMacro --
+#
+# Generate the inline macro for a function.
+#
+# Arguments:
+# name The interface name.
+# decl The function declaration.
+# index The slot index for this function.
+#
+# Results:
+# Returns the formatted macro definition.
+
+proc genStubs::makeMacro {name decl index} {
+ lassign $decl rtype fname args
+
+ set lfname [string tolower [string index $fname 0]]
+ append lfname [string range $fname 1 end]
+
+ set text "#ifndef $fname\n#define $fname"
+ set arg1 [lindex $args 0]
+ set argList ""
+ switch -exact $arg1 {
+ void {
+ set argList "()"
+ }
+ TCL_VARARGS {
+ }
+ default {
+ set sep "("
+ foreach arg $args {
+ append argList $sep [lindex $arg 1]
+ set sep ", "
+ }
+ append argList ")"
+ }
+ }
+ append text " \\\n\t(${name}StubsPtr->$lfname)"
+ append text " /* $index */\n#endif\n"
+ return $text
+}
+
+# genStubs::makeStub --
+#
+# Emits a stub function definition.
+#
+# Arguments:
+# name The interface name.
+# decl The function declaration.
+# index The slot index for this function.
+#
+# Results:
+# Returns the formatted stub function definition.
+
+proc genStubs::makeStub {name decl index} {
+ lassign $decl rtype fname args
+
+ set lfname [string tolower [string index $fname 0]]
+ append lfname [string range $fname 1 end]
+
+ append text "/* Slot $index */\n" $rtype "\n" $fname
+
+ set arg1 [lindex $args 0]
+
+ if {![string compare $arg1 "TCL_VARARGS"]} {
+ lassign [lindex $args 1] type argName
+ append text " TCL_VARARGS_DEF($type,$argName)\n\{\n"
+ append text " " $type " var;\n va_list argList;\n"
+ if {[string compare $rtype "void"]} {
+ append text " " $rtype " resultValue;\n"
+ }
+ append text "\n var = (" $type ") TCL_VARARGS_START(" \
+ $type "," $argName ",argList);\n\n "
+ if {[string compare $rtype "void"]} {
+ append text "resultValue = "
+ }
+ append text "(" $name "StubsPtr->" $lfname "VA)(var, argList);\n"
+ append text " va_end(argList);\n"
+ if {[string compare $rtype "void"]} {
+ append text "return resultValue;\n"
+ }
+ append text "\}\n\n"
+ return $text
+ }
+
+ if {![string compare $arg1 "void"]} {
+ set argList "()"
+ set argDecls ""
+ } else {
+ set argList ""
+ set sep "("
+ foreach arg $args {
+ append argList $sep [lindex $arg 1]
+ append argDecls " " [lindex $arg 0] " " \
+ [lindex $arg 1] [lindex $arg 2] ";\n"
+ set sep ", "
+ }
+ append argList ")"
+ }
+ append text $argList "\n" $argDecls "{\n "
+ if {[string compare $rtype "void"]} {
+ append text "return "
+ }
+ append text "(" $name "StubsPtr->" $lfname ")" $argList ";\n}\n\n"
+ return $text
+}
+
+# genStubs::makeSlot --
+#
+# Generate the stub table entry for a function.
+#
+# Arguments:
+# name The interface name.
+# decl The function declaration.
+# index The slot index for this function.
+#
+# Results:
+# Returns the formatted table entry.
+
+proc genStubs::makeSlot {name decl index} {
+ lassign $decl rtype fname args
+
+ set lfname [string tolower [string index $fname 0]]
+ append lfname [string range $fname 1 end]
+
+ set text " "
+ append text $rtype " (*" $lfname ") _ANSI_ARGS_("
+
+ set arg1 [lindex $args 0]
+ switch -exact $arg1 {
+ void {
+ append text "(void)"
+ }
+ TCL_VARARGS {
+ set arg [lindex $args 1]
+ append text "TCL_VARARGS([lindex $arg 0],[lindex $arg 1])"
+ }
+ default {
+ set sep "("
+ foreach arg $args {
+ append text $sep [lindex $arg 0] " " [lindex $arg 1] \
+ [lindex $arg 2]
+ set sep ", "
+ }
+ append text ")"
+ }
+ }
+
+ append text "); /* $index */\n"
+ return $text
+}
+
+# genStubs::makeInit --
+#
+# Generate the prototype for a function.
+#
+# Arguments:
+# name The interface name.
+# decl The function declaration.
+# index The slot index for this function.
+#
+# Results:
+# Returns the formatted declaration string.
+
+proc genStubs::makeInit {name decl index} {
+ append text " " [lindex $decl 1] ", /* " $index " */\n"
+ return $text
+}
+
+# genStubs::forAllStubs --
+#
+# This function iterates over all of the platforms and invokes
+# a callback for each slot. The result of the callback is then
+# placed inside appropriate platform guards.
+#
+# Arguments:
+# name The interface name.
+# slotProc The proc to invoke to handle the slot. It will
+# have the interface name, the declaration, and
+# the index appended.
+# onAll If 1, emit the skip string even if there are
+# definitions for one or more platforms.
+# textVar The variable to use for output.
+# skipString The string to emit if a slot is skipped. This
+# string will be subst'ed in the loop so "$i" can
+# be used to substitute the index value.
+#
+# Results:
+# None.
+
+proc genStubs::forAllStubs {name slotProc onAll textVar \
+ {skipString {"/* Slot $i is reserved */\n"}}} {
+ variable stubs
+ upvar $textVar text
+
+ set plats [array names stubs $name,*,lastNum]
+ if {[info exists stubs($name,generic,lastNum)]} {
+ # Emit integrated stubs block
+ set lastNum -1
+ foreach plat [array names stubs $name,*,lastNum] {
+ if {$stubs($plat) > $lastNum} {
+ set lastNum $stubs($plat)
+ }
+ }
+ for {set i 0} {$i <= $lastNum} {incr i} {
+ set slots [array names stubs $name,*,$i]
+ set emit 0
+ if {[info exists stubs($name,generic,$i)]} {
+ if {[llength $slots] > 1} {
+ puts stderr "platform entry duplicates generic entry: $i"
+ }
+ append text [$slotProc $name $stubs($name,generic,$i) $i]
+ set emit 1
+ } elseif {[llength $slots] > 0} {
+ foreach plat {unix win mac} {
+ if {[info exists stubs($name,$plat,$i)]} {
+ append text [addPlatformGuard $plat \
+ [$slotProc $name $stubs($name,$plat,$i) $i]]
+ set emit 1
+ } elseif {$onAll} {
+ append text [eval {addPlatformGuard $plat} $skipString]
+ set emit 1
+ }
+ }
+ }
+ if {$emit == 0} {
+ eval {append text} $skipString
+ }
+ }
+
+ } else {
+ # Emit separate stubs blocks per platform
+ foreach plat {unix win mac} {
+ if {[info exists stubs($name,$plat,lastNum)]} {
+ set lastNum $stubs($name,$plat,lastNum)
+ set temp {}
+ for {set i 0} {$i <= $lastNum} {incr i} {
+ if {![info exists stubs($name,$plat,$i)]} {
+ eval {append temp} $skipString
+ } else {
+ append temp [$slotProc $name $stubs($name,$plat,$i) $i]
+ }
+ }
+ append text [addPlatformGuard $plat $temp]
+ }
+ }
+ }
+
+}
+
+# genStubs::emitDeclarations --
+#
+# This function emits the function declarations for this interface.
+#
+# Arguments:
+# name The interface name.
+# textVar The variable to use for output.
+#
+# Results:
+# None.
+
+proc genStubs::emitDeclarations {name textVar} {
+ variable stubs
+ upvar $textVar text
+
+ append text "\n/*\n * Exported function declarations:\n */\n\n"
+ forAllStubs $name makeDecl 0 text
+ return
+}
+
+# genStubs::emitMacros --
+#
+# This function emits the inline macros for an interface.
+#
+# Arguments:
+# name The name of the interface being emitted.
+# textVar The variable to use for output.
+#
+# Results:
+# None.
+
+proc genStubs::emitMacros {name textVar} {
+ variable stubs
+ variable libraryName
+ upvar $textVar text
+
+ set upName [string toupper $libraryName]
+ append text "\n#if defined(USE_${upName}_STUBS) && !defined(USE_${upName}_STUB_PROCS)\n"
+ append text "\n/*\n * Inline function declarations:\n */\n\n"
+
+ forAllStubs $name makeMacro 0 text
+
+ append text "\n#endif /* defined(USE_${upName}_STUBS) && !defined(USE_${upName}_STUB_PROCS) */\n"
+ return
+}
+
+# genStubs::emitHeader --
+#
+# This function emits the body of the <name>Decls.h file for
+# the specified interface.
+#
+# Arguments:
+# name The name of the interface being emitted.
+#
+# Results:
+# None.
+
+proc genStubs::emitHeader {name} {
+ variable outDir
+ variable hooks
+
+ set capName [string toupper [string index $name 0]]
+ append capName [string range $name 1 end]
+
+ emitDeclarations $name text
+
+ if {[info exists hooks($name)]} {
+ append text "\ntypedef struct ${capName}StubHooks {\n"
+ foreach hook $hooks($name) {
+ set capHook [string toupper [string index $hook 0]]
+ append capHook [string range $hook 1 end]
+ append text " struct ${capHook}Stubs *${hook}Stubs;\n"
+ }
+ append text "} ${capName}StubHooks;\n"
+ }
+ append text "\ntypedef struct ${capName}Stubs {\n"
+ append text " int magic;\n"
+ append text " struct ${capName}StubHooks *hooks;\n\n"
+
+ emitSlots $name text
+
+ append text "} ${capName}Stubs;\n"
+
+ append text "\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n"
+ append text "extern ${capName}Stubs *${name}StubsPtr;\n"
+ append text "#ifdef __cplusplus\n}\n#endif\n"
+
+ emitMacros $name text
+
+ rewriteFile [file join $outDir ${name}Decls.h] $text
+ return
+}
+
+# genStubs::emitStubs --
+#
+# This function emits the body of the <name>Stubs.c file for
+# the specified interface.
+#
+# Arguments:
+# name The name of the interface being emitted.
+#
+# Results:
+# None.
+
+proc genStubs::emitStubs {name} {
+ variable outDir
+
+ append text "\n/*\n * Exported stub functions:\n */\n\n"
+ forAllStubs $name makeStub 0 text
+
+ rewriteFile [file join $outDir ${name}Stubs.c] $text
+ return
+}
+
+# genStubs::emitInit --
+#
+# Generate the table initializers for an interface.
+#
+# Arguments:
+# name The name of the interface to initialize.
+# textVar The variable to use for output.
+#
+# Results:
+# Returns the formatted output.
+
+proc genStubs::emitInit {name textVar} {
+ variable stubs
+ variable hooks
+ upvar $textVar text
+
+ set capName [string toupper [string index $name 0]]
+ append capName [string range $name 1 end]
+
+ if {[info exists hooks($name)]} {
+ append text "\nstatic ${capName}StubHooks ${name}StubHooks = \{\n"
+ set sep " "
+ foreach sub $hooks($name) {
+ append text $sep "&${sub}Stubs"
+ set sep ",\n "
+ }
+ append text "\n\};\n"
+ }
+ append text "\n${capName}Stubs ${name}Stubs = \{\n"
+ append text " TCL_STUB_MAGIC,\n"
+ if {[info exists hooks($name)]} {
+ append text " &${name}StubHooks,\n"
+ } else {
+ append text " NULL,\n"
+ }
+
+ forAllStubs $name makeInit 1 text {" NULL, /* $i */\n"}
+
+ append text "\};\n"
+ return
+}
+
+# genStubs::emitInits --
+#
+# This function emits the body of the <name>StubInit.c file for
+# the specified interface.
+#
+# Arguments:
+# name The name of the interface being emitted.
+#
+# Results:
+# None.
+
+proc genStubs::emitInits {} {
+ variable hooks
+ variable outDir
+ variable libraryName
+ variable interfaces
+
+ # Assuming that dependencies only go one level deep, we need to emit
+ # all of the leaves first to avoid needing forward declarations.
+
+ set leaves {}
+ set roots {}
+ foreach name [lsort [array names interfaces]] {
+ if {[info exists hooks($name)]} {
+ lappend roots $name
+ } else {
+ lappend leaves $name
+ }
+ }
+ foreach name $leaves {
+ emitInit $name text
+ }
+ foreach name $roots {
+ emitInit $name text
+ }
+
+ rewriteFile [file join $outDir ${libraryName}StubInit.c] $text
+}
+
+# genStubs::init --
+#
+# This is the main entry point.
+#
+# Arguments:
+# None.
+#
+# Results:
+# None.
+
+proc genStubs::init {} {
+ global argv argv0
+ variable outDir
+ variable interfaces
+
+ if {[llength $argv] < 2} {
+ puts stderr "usage: $argv0 outDir declFile ?declFile...?"
+ exit 1
+ }
+
+ set outDir [lindex $argv 0]
+
+ foreach file [lrange $argv 1 end] {
+ source $file
+ }
+
+ foreach name [lsort [array names interfaces]] {
+ puts "Emitting $name"
+ emitHeader $name
+ }
+
+ emitInits
+}
+
+# lassign --
+#
+# This function emulates the TclX lassign command.
+#
+# Arguments:
+# valueList A list containing the values to be assigned.
+# args The list of variables to be assigned.
+#
+# Results:
+# Returns any values that were not assigned to variables.
+
+proc lassign {valueList args} {
+ if {[llength $args] == 0} {
+ error "wrong # args: lassign list varname ?varname..?"
+ }
+
+ uplevel [list foreach $args $valueList {break}]
+ return [lrange $valueList [llength $args] end]
+}
+
+genStubs::init
diff --git a/tcl/tools/genWinImage.tcl b/tcl/tools/genWinImage.tcl
new file mode 100644
index 00000000000..b49c52a45ab
--- /dev/null
+++ b/tcl/tools/genWinImage.tcl
@@ -0,0 +1,158 @@
+# genWinImage.tcl --
+#
+# This script generates the Windows installer.
+#
+# Copyright (c) 1999 by Scriptics Corporation.
+# All rights reserved.
+#
+# RCS: @(#) $Id$
+
+
+# This file is insensitive to the directory from which it is invoked.
+
+namespace eval genWinImage {
+ # toolsDir --
+ #
+ # This variable points to the platform specific tools directory.
+
+ variable toolsDir
+
+ # tclBuildDir --
+ #
+ # This variable points to the directory containing the Tcl built tree.
+
+ variable tclBuildDir
+
+ # tkBuildDir --
+ #
+ # This variable points to the directory containing the Tk built tree.
+
+ variable tkBuildDir
+
+ # our script name at runtime
+ variable script [info script]
+}
+
+# genWinImage::init --
+#
+# This is the main entry point.
+#
+# Arguments:
+# None.
+#
+# Results:
+# None.
+
+proc genWinImage::init {} {
+ global tcl_platform argv argv0
+ variable tclBuildDir
+ variable tkBuildDir
+ variable toolsDir
+ variable script
+
+ puts "\n--- $script started: \
+ [clock format [clock seconds] -format "%Y%m%d-%H:%M"] --\n"
+
+ if {$tcl_platform(platform) != "windows"} {
+ puts stderr "ERROR: Cannot build TCL.EXE on Unix systems"
+ exit 1
+ }
+
+ if {[llength $argv] != 3} {
+ puts stderr "usage: $argv0 <tclBuildDir> <tkBuildDir> <toolsDir>"
+ exit 0
+ }
+
+ set tclBuildDir [lindex $argv 0]
+ set tkBuildDir [lindex $argv 1]
+ set toolsDir [lindex $argv 2]
+
+ generateInstallers
+
+ puts "\n--- $script finished: \
+ [clock format [clock seconds] -format "%Y%m%d-%H:%M"] --\n\n"
+}
+
+# genWinImage::makeTextFile --
+#
+# Convert the input file into a CRLF terminated text file.
+#
+# Arguments:
+# infile The input file to convert.
+# outfile The location where the text file should be stored.
+#
+# Results:
+# None.
+
+proc genWinImage::makeTextFile {infile outfile} {
+ set f [open $infile r]
+ set text [read $f]
+ close $f
+ set f [open $outfile w]
+ fconfigure $f -translation crlf
+ puts -nonewline $f $text
+ close $f
+}
+
+# genWinImage::generateInstallers --
+#
+# Perform substitutions on the pro.wse.in file and then
+# invoke the WSE script twice; once for CD and once for web.
+#
+# Arguments:
+# None.
+#
+# Results:
+# Leaves proweb.exe and procd.exe sitting in the curent directory.
+
+proc genWinImage::generateInstallers {} {
+ variable toolsDir
+ variable tclBuildDir
+ variable tkBuildDir
+
+ # Now read the "pro/srcs/install/pro.wse.in" file, have Tcl make
+ # appropriate substitutions, write out the resulting file in a
+ # current-working-directory. Use this new file to perform installation
+ # image creation. Note that we have to use this technique to set
+ # the value of _WISE_ because wise32 won't use a /d switch for this
+ # variable.
+
+ set __TCLBASEDIR__ [file native $tclBuildDir]
+ set __TKBASEDIR__ [file native $tkBuildDir]
+ set __WISE__ [file native [file join $toolsDir wise]]
+
+ set f [open [file join $__TCLBASEDIR__ generic/tcl.h] r]
+ set s [read $f]
+ close $f
+ regexp {TCL_PATCH_LEVEL\s*\"([^\"]*)\"} $s dummy __TCL_PATCH_LEVEL__
+
+ set f [open tcl.wse.in r]
+ set s [read $f]
+ close $f
+ set s [subst -nocommands -nobackslashes $s]
+ set f [open tcl.wse w]
+ puts $f $s
+ close $f
+
+ # Ensure the text files are CRLF terminated
+
+ makeTextFile [file join $tclBuildDir win/README.binary] \
+ [file join $tclBuildDir win/readme.txt]
+ makeTextFile [file join $tclBuildDir license.terms] \
+ [file join $tclBuildDir license.txt]
+
+ set wise32ProgFilePath [file native [file join $__WISE__ wise32.exe]]
+
+ # Run the Wise installer to create the Windows install images.
+
+ if {[catch {exec [file native $wise32ProgFilePath] /c tcl.wse} errMsg]} {
+ puts stderr "ERROR: $errMsg"
+ } else {
+ puts "\"TCL.EXE\" created."
+ }
+
+ return
+}
+
+genWinImage::init
+
diff --git a/tcl/tools/index.tcl b/tcl/tools/index.tcl
new file mode 100644
index 00000000000..59942d21013
--- /dev/null
+++ b/tcl/tools/index.tcl
@@ -0,0 +1,202 @@
+# index.tcl --
+#
+# This file defines procedures that are used during the first pass of
+# the man page conversion. It is used to extract information used to
+# generate a table of contents and a keyword list.
+#
+# Copyright (c) 1996 by Sun Microsystems, Inc.
+#
+# See the file "license.terms" for information on usage and redistribution
+# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+#
+# RCS: @(#) $Id$
+#
+
+# Global variables used by these scripts:
+#
+# state - state variable that controls action of text proc.
+#
+# topics - array indexed by (package,section,topic) with value
+# of topic ID.
+#
+# keywords - array indexed by keyword string with value of topic ID.
+#
+# curID - current topic ID, starts at 0 and is incremented for
+# each new topic file.
+#
+# curPkg - current package name (e.g. Tcl).
+#
+# curSect - current section title (e.g. "Tcl Built-In Commands").
+#
+
+# getPackages --
+#
+# Generate a sorted list of package names from the topics array.
+#
+# Arguments:
+# none.
+
+proc getPackages {} {
+ global topics
+ foreach i [array names topics] {
+ regsub {^(.*),.*,.*$} $i {\1} i
+ set temp($i) {}
+ }
+ lsort [array names temp]
+}
+
+# getSections --
+#
+# Generate a sorted list of section titles in the specified package
+# from the topics array.
+#
+# Arguments:
+# pkg - Name of package to search.
+
+proc getSections {pkg} {
+ global topics
+ regsub -all {[][*?\\]} $pkg {\\&} pkg
+ foreach i [array names topics "${pkg},*"] {
+ regsub {^.*,(.*),.*$} $i {\1} i
+ set temp($i) {}
+ }
+ lsort [array names temp]
+}
+
+# getSections --
+#
+# Generate a sorted list of topics in the specified section of the
+# specified package from the topics array.
+#
+# Arguments:
+# pkg - Name of package to search.
+# sect - Name of section to search.
+
+proc getTopics {pkg sect} {
+ global topics
+ regsub -all {[][*?\\]} $pkg {\\&} pkg
+ regsub -all {[][*?\\]} $sect {\\&} sect
+ foreach i [array names topics "${pkg},${sect},*"] {
+ regsub {^.*,.*,(.*)$} $i {\1} i
+ set temp($i) {}
+ }
+ lsort [array names temp]
+}
+
+# text --
+#
+# This procedure adds entries to the hypertext arrays topics and keywords.
+#
+# Arguments:
+# string - Text to index.
+
+
+proc text string {
+ global state curID curPkg curSect topics keywords
+
+ switch $state {
+ NAME {
+ foreach i [split $string ","] {
+ set topic [string trim $i]
+ set index "$curPkg,$curSect,$topic"
+ if {[info exists topics($index)]
+ && [string compare $topics($index) $curID] != 0} {
+ puts stderr "duplicate topic $topic in $curPkg"
+ }
+ set topics($index) $curID
+ lappend keywords($topic) $curID
+ }
+ }
+ KEY {
+ foreach i [split $string ","] {
+ lappend keywords([string trim $i]) $curID
+ }
+ }
+ DT -
+ OFF -
+ DASH {}
+ default {
+ puts stderr "text: unknown state: $state"
+ }
+ }
+}
+
+
+# macro --
+#
+# This procedure is invoked to process macro invocations that start
+# with "." (instead of ').
+#
+# Arguments:
+# name - The name of the macro (without the ".").
+# args - Any additional arguments to the macro.
+
+proc macro {name args} {
+ switch $name {
+ SH {
+ global state
+
+ switch $args {
+ NAME {
+ if {$state == "INIT" } {
+ set state NAME
+ }
+ }
+ DESCRIPTION {set state DT}
+ INTRODUCTION {set state DT}
+ KEYWORDS {set state KEY}
+ default {set state OFF}
+ }
+
+ }
+ TH {
+ global state curID curPkg curSect topics keywords
+ set state INIT
+ if {[llength $args] != 5} {
+ set args [join $args " "]
+ puts stderr "Bad .TH macro: .$name $args"
+ }
+ incr curID
+ set topic [lindex $args 0] ;# Tcl_UpVar
+ set curPkg [lindex $args 3] ;# Tcl
+ set curSect [lindex $args 4] ;# {Tcl Library Procedures}
+ regsub -all {\\ } $curSect { } curSect
+ set index "$curPkg,$curSect,$topic"
+ set topics($index) $curID
+ lappend keywords($topic) $curID
+ }
+ }
+}
+
+
+# dash --
+#
+# This procedure is invoked to handle dash characters ("\-" in
+# troff). It only function in pass1 is to terminate the NAME state.
+#
+# Arguments:
+# None.
+
+proc dash {} {
+ global state
+ if {$state == "NAME"} {
+ set state DASH
+ }
+}
+
+
+
+# initGlobals, tab, font, char, macro2 --
+#
+# These procedures do nothing during the first pass.
+#
+# Arguments:
+# None.
+
+proc initGlobals {} {}
+proc newline {} {}
+proc tab {} {}
+proc font type {}
+proc char name {}
+proc macro2 {name args} {}
+
diff --git a/tcl/tools/man2help.tcl b/tcl/tools/man2help.tcl
new file mode 100644
index 00000000000..6a3ab6517b7
--- /dev/null
+++ b/tcl/tools/man2help.tcl
@@ -0,0 +1,130 @@
+# man2help.tcl --
+#
+# This file defines procedures that work in conjunction with the
+# man2tcl program to generate a Windows help file from Tcl manual
+# entries.
+#
+# Copyright (c) 1996 by Sun Microsystems, Inc.
+#
+# RCS: @(#) $Id$
+#
+
+#
+# PASS 1
+#
+
+proc generateContents {basename version files} {
+ global curID topics
+ set curID 0
+ foreach f $files {
+ puts "Pass 1 -- $f"
+ flush stdout
+ doFile $f
+ }
+ set fd [open "$basename$version.cnt" w]
+ fconfigure $fd -translation crlf
+ puts $fd ":Base $basename$version.hlp"
+ foreach package [getPackages] {
+ foreach section [getSections $package] {
+ puts $fd "1 $section"
+ set lastTopic {}
+ foreach topic [getTopics $package $section] {
+ if {[string compare $lastTopic $topic]} {
+ set id $topics($package,$section,$topic)
+ puts $fd "2 $topic=$id"
+ set lastTopic $topic
+ }
+ }
+ }
+ }
+ close $fd
+}
+
+
+#
+# PASS 2
+#
+
+proc generateHelp {basename files} {
+ global curID topics keywords file id_keywords
+ set curID 0
+
+ foreach key [array names keywords] {
+ foreach id $keywords($key) {
+ lappend id_keywords($id) $key
+ }
+ }
+
+ set file [open "$basename.rtf" w]
+ fconfigure $file -translation crlf
+ puts $file "\{\\rtf1\\ansi \\deff0\\deflang1033\{\\fonttbl\{\\f0\\froman\\fcharset0\\fprq2 Times New Roman\;\}\}"
+ foreach f $files {
+ puts "Pass 2 -- $f"
+ flush stdout
+ initGlobals
+ doFile $f
+ pageBreak
+ }
+ puts $file "\}"
+ close $file
+}
+
+# doFile --
+#
+# Given a file as argument, translate the file to a tcl script and
+# evaluate it.
+#
+# Arguments:
+# file - Name of file to translate.
+
+proc doFile {file} {
+ if {[catch {eval [exec man2tcl [glob $file]]} msg] &&
+ [catch {eval [exec ./man2tcl [glob $file]]} msg]} {
+ global errorInfo
+ puts stderr $msg
+ puts "in"
+ puts $errorInfo
+ exit 1
+ }
+}
+
+# doDir --
+#
+# Given a directory as argument, translate all the man pages in
+# that directory.
+#
+# Arguments:
+# dir - Name of the directory.
+
+proc doDir dir {
+ puts "Generating man pages for $dir..."
+ foreach f [lsort [glob [file join $dir *.\[13n\]]]] {
+ do $f
+ }
+}
+
+# process command line arguments
+
+if {$argc < 3} {
+ puts stderr "usage: $argv0 projectName version manFiles..."
+ exit 1
+}
+
+set baseName [lindex $argv 0]
+set version [lindex $argv 1]
+set files {}
+foreach i [lrange $argv 2 end] {
+ set i [file join $i]
+ if {[file isdir $i]} {
+ foreach f [lsort [glob [file join $i *.\[13n\]]]] {
+ lappend files $f
+ }
+ } elseif {[file exists $i]} {
+ lappend files $i
+ }
+}
+
+source [file join [file dir $argv0] index.tcl]
+generateContents $baseName $version $files
+source [file join [file dir $argv0] man2help2.tcl]
+generateHelp $baseName $files
diff --git a/tcl/tools/man2help2.tcl b/tcl/tools/man2help2.tcl
new file mode 100644
index 00000000000..4ea9d9dd8c4
--- /dev/null
+++ b/tcl/tools/man2help2.tcl
@@ -0,0 +1,970 @@
+# man2help2.tcl --
+#
+# This file defines procedures that are used during the second pass of
+# the man page conversion. It converts the man format input to rtf
+# form suitable for use by the Windows help compiler.
+#
+# Copyright (c) 1996 by Sun Microsystems, Inc.
+#
+# See the file "license.terms" for information on usage and redistribution
+# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+#
+# RCS: @(#) $Id$
+#
+
+# Global variables used by these scripts:
+#
+# state - state variable that controls action of text proc.
+#
+# topics - array indexed by (package,section,topic) with value
+# of topic ID.
+#
+# keywords - array indexed by keyword string with value of topic ID.
+#
+# curID - current topic ID, starts at 0 and is incremented for
+# each new topic file.
+#
+# curPkg - current package name (e.g. Tcl).
+#
+# curSect - current section title (e.g. "Tcl Built-In Commands").
+#
+
+# initGlobals --
+#
+# This procedure is invoked to set the initial values of all of the
+# global variables, before processing a man page.
+#
+# Arguments:
+# None.
+
+proc initGlobals {} {
+ uplevel \#0 unset state
+ global state chars
+
+ set state(paragraphPending) 0
+ set state(breakPending) 0
+ set state(firstIndent) 0
+ set state(leftIndent) 0
+
+ set state(inTP) 0
+ set state(paragraph) 0
+ set state(textState) 0
+ set state(curFont) ""
+ set state(startCode) "{\\b "
+ set state(startEmphasis) "{\\i "
+ set state(endCode) "}"
+ set state(endEmphasis) "}"
+ set state(noFill) 0
+ set state(charCnt) 0
+ set state(offset) [getTwips 0.5i]
+ set state(leftMargin) [getTwips 0.5i]
+ set state(nestingLevel) 0
+ set state(intl) 0
+ set state(sb) 0
+ setTabs 0.5i
+
+# set up international character table
+
+ array set chars {
+ o^ F4
+ }
+}
+
+
+# beginFont --
+#
+# Arranges for future text to use a special font, rather than
+# the default paragraph font.
+#
+# Arguments:
+# font - Name of new font to use.
+
+proc beginFont {font} {
+ global file state
+
+ textSetup
+ if {[string equal $state(curFont) $font]} {
+ return
+ }
+ endFont
+ puts -nonewline $file $state(start$font)
+ set state(curFont) $font
+}
+
+
+# endFont --
+#
+# Reverts to the default font for the paragraph type.
+#
+# Arguments:
+# None.
+
+proc endFont {} {
+ global state file
+
+ if {[string compare $state(curFont) ""]} {
+ puts -nonewline $file $state(end$state(curFont))
+ set state(curFont) ""
+ }
+}
+
+
+# textSetup --
+#
+# This procedure is called the first time that text is output for a
+# paragraph. It outputs the header information for the paragraph.
+#
+# Arguments:
+# None.
+
+proc textSetup {} {
+ global file state
+
+ if $state(breakPending) {
+ puts $file "\\line"
+ }
+ if $state(paragraphPending) {
+ puts $file [format "\\par\n\\pard\\fi%.0f\\li%.0f" \
+ $state(firstIndent) $state(leftIndent)]
+ foreach tab $state(tabs) {
+ puts $file [format "\\tx%.0f" $tab]
+ }
+ set state(tabs) {}
+ if {$state(sb)} {
+ puts $file "\\sb$state(sb)"
+ set state(sb) 0
+ }
+ }
+ set state(breakPending) 0
+ set state(paragraphPending) 0
+}
+
+
+# text --
+#
+# This procedure adds text to the current state(paragraph). If this is
+# the first text in the state(paragraph) then header information for the
+# state(paragraph) is output before the text.
+#
+# Arguments:
+# string - Text to output in the state(paragraph).
+
+proc text {string} {
+ global file state chars
+
+ textSetup
+ set string [string map [list \
+ "\\" "\\\\" \
+ "\{" "\\\{" \
+ "\}" "\\\}" \
+ "\t" {\tab } \
+ '' "\\rdblquote " \
+ `` "\\ldblquote " \
+ ] $string]
+
+ # Check if this is the beginning of an international character string.
+ # If so, look up the sequence in the chars table and substitute the
+ # appropriate hex value.
+
+ if {$state(intl)} {
+ if {[regexp {^'([^']*)'} $string dummy ch]} {
+ if {[info exists chars($ch)]} {
+ regsub {^'[^']*'} $string "\\\\'$chars($ch)" string
+ } else {
+ puts stderr "Unknown international character '$ch'"
+ }
+ }
+ set state(intl) 0
+ }
+
+ switch $state(textState) {
+ REF {
+ if {$state(inTP) == 0} {
+ set string [insertRef $string]
+ }
+ }
+ SEE {
+ global topics curPkg curSect
+ foreach i [split $string] {
+ if {![regexp -nocase {^[a-z_0-9]+} [string trim $i] i ]} {
+ continue
+ }
+ if {![catch {set ref $topics($curPkg,$curSect,$i)} ]} {
+ regsub $i $string [link $i $ref] string
+ }
+ }
+ }
+ KEY {
+ return
+ }
+ }
+ puts -nonewline $file "$string"
+}
+
+
+
+# insertRef --
+#
+# This procedure looks for a string in the cross reference table and
+# generates a hot-link to the appropriate topic. Tries to find the
+# nearest reference in the manual.
+#
+# Arguments:
+# string - Text to output in the state(paragraph).
+
+proc insertRef {string} {
+ global NAME_file curPkg curSect topics curID
+ set path {}
+ set string [string trim $string]
+ set ref {}
+ if {[info exists topics($curPkg,$curSect,$string)]} {
+ set ref $topics($curPkg,$curSect,$string)
+ } else {
+ set sites [array names topics "$curPkg,*,$string"]
+ set count [llength $sites]
+ if {$count > 0} {
+ set ref $topics([lindex $sites 0])
+ } else {
+ set sites [array names topics "*,*,$string"]
+ set count [llength $sites]
+ if {$count > 0} {
+ set ref $topics([lindex $sites 0])
+ }
+ }
+ }
+
+ if {($ref != {}) && ($ref != $curID)} {
+ set string [link $string $ref]
+ }
+ return $string
+}
+
+
+
+# macro --
+#
+# This procedure is invoked to process macro invocations that start
+# with "." (instead of ').
+#
+# Arguments:
+# name - The name of the macro (without the ".").
+# args - Any additional arguments to the macro.
+
+proc macro {name args} {
+ global state file
+ switch $name {
+ AP {
+ if {[llength $args] != 3 && [llength $args] != 2} {
+ puts stderr "Bad .AP macro: .$name [join $args " "]"
+ }
+ newPara 3.75i -3.75i
+ setTabs {1.25i 2.5i 3.75i}
+ font B
+ text [lindex $args 0]
+ tab
+ font I
+ text [lindex $args 1]
+ tab
+ font R
+ if {[llength $args] == 3} {
+ text "([lindex $args 2])"
+ }
+ tab
+ }
+ AS {} ;# next page and previous page
+ br {
+ lineBreak
+ }
+ BS {}
+ BE {}
+ CE {
+ decrNestingLevel
+ set state(noFill) 0
+ set state(breakPending) 0
+ newPara 0i
+ }
+ CS { ;# code section
+ incrNestingLevel
+ set state(noFill) 1
+ newPara 0i
+ }
+ DE {
+ set state(noFill) 0
+ decrNestingLevel
+ newPara 0i
+ }
+ DS {
+ set state(noFill) 1
+ incrNestingLevel
+ newPara 0i
+ }
+ fi {
+ set state(noFill) 0
+ }
+ IP {
+ IPmacro $args
+ }
+ LP {
+ newPara 0i
+ set state(sb) 80
+ }
+ ne {
+ }
+ nf {
+ set state(noFill) 1
+ }
+ OP {
+ if {[llength $args] != 3} {
+ puts stderr "Bad .OP macro: .$name [join $args " "]"
+ }
+ set state(nestingLevel) 0
+ newPara 0i
+ set state(sb) 120
+ setTabs 4c
+ text "Command-Line Name:"
+ tab
+ font B
+ set x [lindex $args 0]
+ regsub -all {\\-} $x - x
+ text $x
+ lineBreak
+ font R
+ text "Database Name:"
+ tab
+ font B
+ text [lindex $args 1]
+ lineBreak
+ font R
+ text "Database Class:"
+ tab
+ font B
+ text [lindex $args 2]
+ font R
+ set state(inTP) 0
+ newPara 0.5i
+ set state(sb) 80
+ }
+ PP {
+ newPara 0i
+ set state(sb) 120
+ }
+ RE {
+ decrNestingLevel
+ }
+ RS {
+ incrNestingLevel
+ }
+ SE {
+ font R
+ set state(noFill) 0
+ set state(nestingLevel) 0
+ newPara 0i
+ text "See the "
+ font B
+ set temp $state(textState)
+ set state(textState) REF
+ text options
+ set state(textState) $temp
+ font R
+ text " manual entry for detailed descriptions of the above options."
+ }
+ SH {
+ SHmacro $args
+ }
+ SO {
+ SHmacro "STANDARD OPTIONS"
+ set state(nestingLevel) 0
+ newPara 0i
+ setTabs {4c 8c 12c}
+ font B
+ set state(noFill) 1
+ }
+ so {
+ if {$args != "man.macros"} {
+ puts stderr "Unknown macro: .$name [join $args " "]"
+ }
+ }
+ sp { ;# needs work
+ if {$args == ""} {
+ set count 1
+ } else {
+ set count [lindex $args 0]
+ }
+ while {$count > 0} {
+ lineBreak
+ incr count -1
+ }
+ }
+ ta {
+ setTabs $args
+ }
+ TH {
+ THmacro $args
+ }
+ TP {
+ TPmacro $args
+ }
+ UL { ;# underline
+ puts -nonewline $file "{\\ul "
+ text [lindex $args 0]
+ puts -nonewline $file "}"
+ if {[llength $args] == 2} {
+ text [lindex $args 1]
+ }
+ }
+ VE {}
+ VS {}
+ default {
+ puts stderr "Unknown macro: .$name [join $args " "]"
+ }
+ }
+}
+
+
+# link --
+#
+# This procedure returns the string for a hot link to a different
+# context location.
+#
+# Arguments:
+# label - String to display in hot-spot.
+# id - Context string to jump to.
+
+proc link {label id} {
+ return "{\\uldb $label}{\\v $id}"
+}
+
+
+# font --
+#
+# This procedure is invoked to handle font changes in the text
+# being output.
+#
+# Arguments:
+# type - Type of font: R, I, B, or S.
+
+proc font {type} {
+ global state
+ switch $type {
+ P -
+ R {
+ endFont
+ if {$state(textState) == "REF"} {
+ set state(textState) INSERT
+ }
+ }
+ C -
+ B {
+ beginFont Code
+ if {$state(textState) == "INSERT"} {
+ set state(textState) REF
+ }
+ }
+ I {
+ beginFont Emphasis
+ }
+ S {
+ }
+ default {
+ puts stderr "Unknown font: $type"
+ }
+ }
+}
+
+
+
+# formattedText --
+#
+# Insert a text string that may also have \fB-style font changes
+# and a few other backslash sequences in it.
+#
+# Arguments:
+# text - Text to insert.
+
+proc formattedText {text} {
+ global chars
+
+ while {$text != ""} {
+ set index [string first \\ $text]
+ if {$index < 0} {
+ text $text
+ return
+ }
+ text [string range $text 0 [expr {$index-1}]]
+ set c [string index $text [expr {$index+1}]]
+ switch -- $c {
+ f {
+ font [string index $text [expr {$index+2}]]
+ set text [string range $text [expr {$index+3}] end]
+ }
+ e {
+ text "\\"
+ set text [string range $text [expr {$index+2}] end]
+ }
+ - {
+ dash
+ set text [string range $text [expr {$index+2}] end]
+ }
+ | {
+ set text [string range $text [expr {$index+2}] end]
+ }
+ o {
+ text "\\'"
+ regexp "'([^']*)'(.*)" $text all ch text
+ text $chars($ch)
+ }
+ default {
+ puts stderr "Unknown sequence: \\$c"
+ set text [string range $text [expr {$index+2}] end]
+ }
+ }
+ }
+}
+
+
+# dash --
+#
+# This procedure is invoked to handle dash characters ("\-" in
+# troff). It outputs a special dash character.
+#
+# Arguments:
+# None.
+
+proc dash {} {
+ global state
+ if {[string equal $state(textState) "NAME"]} {
+ set state(textState) 0
+ }
+ text "-"
+}
+
+
+# tab --
+#
+# This procedure is invoked to handle tabs in the troff input.
+# Right now it does nothing.
+#
+# Arguments:
+# None.
+
+proc tab {} {
+ global file
+
+ textSetup
+ puts -nonewline $file "\\tab "
+}
+
+
+# setTabs --
+#
+# This procedure handles the ".ta" macro, which sets tab stops.
+#
+# Arguments:
+# tabList - List of tab stops, each consisting of a number
+# followed by "i" (inch) or "c" (cm).
+
+proc setTabs {tabList} {
+ global file state
+
+ set state(tabs) {}
+ foreach arg $tabList {
+ set distance [expr {$state(leftMargin) \
+ + ($state(offset) * $state(nestingLevel)) + [getTwips $arg]}]
+ lappend state(tabs) [expr {round($distance)}]
+ }
+}
+
+
+
+# lineBreak --
+#
+# Generates a line break in the HTML output.
+#
+# Arguments:
+# None.
+
+proc lineBreak {} {
+ global state
+ textSetup
+ set state(breakPending) 1
+}
+
+
+
+# newline --
+#
+# This procedure is invoked to handle newlines in the troff input.
+# It outputs either a space character or a newline character, depending
+# on fill mode.
+#
+# Arguments:
+# None.
+
+proc newline {} {
+ global state
+
+ if {$state(inTP)} {
+ set state(inTP) 0
+ lineBreak
+ } elseif {$state(noFill)} {
+ lineBreak
+ } else {
+ text " "
+ }
+}
+
+
+# pageBreak --
+#
+# This procedure is invoked to generate a page break.
+#
+# Arguments:
+# None.
+
+proc pageBreak {} {
+ global file curVer
+ if {[string equal $curVer ""]} {
+ puts $file {\page}
+ } else {
+ puts $file {\par}
+ puts $file {\pard\sb400\qc}
+ puts $file "Last change: $curVer\\page"
+ }
+}
+
+
+# char --
+#
+# This procedure is called to handle a special character.
+#
+# Arguments:
+# name - Special character named in troff \x or \(xx construct.
+
+proc char {name} {
+ global file state
+
+ switch -exact $name {
+ \\o {
+ set state(intl) 1
+ }
+ \\\ {
+ textSetup
+ puts -nonewline $file " "
+ }
+ \\0 {
+ textSetup
+ puts -nonewline $file " \\emspace "
+ }
+ \\\\ {
+ textSetup
+ puts -nonewline $file "\\\\"
+ }
+ \\(+- {
+ textSetup
+ puts -nonewline $file "\\'b1 "
+ }
+ \\% -
+ \\| {
+ }
+ \\(bu {
+ textSetup
+ puts -nonewline $file "·"
+ }
+ default {
+ puts stderr "Unknown character: $name"
+ }
+ }
+}
+
+
+# macro2 --
+#
+# This procedure handles macros that are invoked with a leading "'"
+# character instead of space. Right now it just generates an
+# error diagnostic.
+#
+# Arguments:
+# name - The name of the macro (without the ".").
+# args - Any additional arguments to the macro.
+
+proc macro2 {name args} {
+ puts stderr "Unknown macro: '$name [join $args " "]"
+}
+
+
+
+# SHmacro --
+#
+# Subsection head; handles the .SH macro.
+#
+# Arguments:
+# name - Section name.
+
+proc SHmacro {argList} {
+ global file state
+
+ set args [join $argList " "]
+ if {[llength $argList] < 1} {
+ puts stderr "Bad .SH macro: .$name $args"
+ }
+
+ # control what the text proc does with text
+
+ switch $args {
+ NAME {set state(textState) NAME}
+ DESCRIPTION {set state(textState) INSERT}
+ INTRODUCTION {set state(textState) INSERT}
+ "WIDGET-SPECIFIC OPTIONS" {set state(textState) INSERT}
+ "SEE ALSO" {set state(textState) SEE}
+ KEYWORDS {set state(textState) KEY; return}
+ }
+
+ if {$state(breakPending) != -1} {
+ set state(breakPending) 1
+ } else {
+ set state(breakPending) 0
+ }
+ set state(noFill) 0
+ nextPara 0i
+ font B
+ text $args
+ font R
+ nextPara .5i
+}
+
+
+
+# IPmacro --
+#
+# This procedure is invoked to handle ".IP" macros, which may take any
+# of the following forms:
+#
+# .IP [1] Translate to a "1Step" state(paragraph).
+# .IP [x] (x > 1) Translate to a "Step" state(paragraph).
+# .IP Translate to a "Bullet" state(paragraph).
+# .IP text count Translate to a FirstBody state(paragraph) with special
+# indent and tab stop based on "count", and tab after
+# "text".
+#
+# Arguments:
+# argList - List of arguments to the .IP macro.
+#
+# HTML limitations: 'count' in '.IP text count' is ignored.
+
+proc IPmacro {argList} {
+ global file state
+
+ set length [llength $argList]
+ if {$length == 0} {
+ newPara 0.5i
+ return
+ }
+ if {$length == 1} {
+ newPara 0.5i -0.5i
+ set state(sb) 80
+ setTabs 0.5i
+ formattedText [lindex $argList 0]
+ tab
+ return
+ }
+ if {$length == 2} {
+ set count [lindex $argList 1]
+ set tab [expr $count * 0.1]i
+ newPara $tab -$tab
+ set state(sb) 80
+ setTabs $tab
+ formattedText [lindex $argList 0]
+ tab
+ return
+ }
+ puts stderr "Bad .IP macro: .IP [join $argList " "]"
+}
+
+
+# TPmacro --
+#
+# This procedure is invoked to handle ".TP" macros, which may take any
+# of the following forms:
+#
+# .TP x Translate to an state(indent)ed state(paragraph) with the
+# specified state(indent) (in 100 twip units).
+# .TP Translate to an state(indent)ed state(paragraph) with
+# default state(indent).
+#
+# Arguments:
+# argList - List of arguments to the .IP macro.
+#
+# HTML limitations: 'x' in '.TP x' is ignored.
+
+proc TPmacro {argList} {
+ global state
+ set length [llength $argList]
+ if {$length == 0} {
+ set val 0.5i
+ } else {
+ set val [expr {([lindex $argList 0] * 100.0)/1440}]i
+ }
+ newPara $val -$val
+ setTabs $val
+ set state(inTP) 1
+ set state(sb) 120
+}
+
+
+# THmacro --
+#
+# This procedure handles the .TH macro. It generates the non-scrolling
+# header section for a given man page, and enters information into the
+# table of contents. The .TH macro has the following form:
+#
+# .TH name section date footer header
+#
+# Arguments:
+# argList - List of arguments to the .TH macro.
+
+proc THmacro {argList} {
+ global file curPkg curSect curID id_keywords state curVer
+
+ if {[llength $argList] != 5} {
+ set args [join $argList " "]
+ puts stderr "Bad .TH macro: .$name $args"
+ }
+ incr curID
+ set name [lindex $argList 0] ;# Tcl_UpVar
+ set page [lindex $argList 1] ;# 3
+ set curVer [lindex $argList 2] ;# 7.4
+ set curPkg [lindex $argList 3] ;# Tcl
+ set curSect [lindex $argList 4] ;# {Tcl Library Procedures}
+
+ regsub -all {\\ } $curSect { } curSect ;# Clean up for [incr\ Tcl]
+
+ puts $file "#{\\footnote $curID}" ;# Context string
+ puts $file "\${\\footnote $name}" ;# Topic title
+ set browse "${curSect}${name}"
+ regsub -all {[ _-]} $browse {} browse
+ puts $file "+{\\footnote $browse}" ;# Browse sequence
+
+ # Suppress duplicates
+ foreach i $id_keywords($curID) {
+ set keys($i) 1
+ }
+ foreach i [array names keys] {
+ set i [string trim $i]
+ if {[string length $i] > 0} {
+ puts $file "K{\\footnote $i}" ;# Keyword strings
+ }
+ }
+ unset keys
+ puts $file "\\pard\\tx3000\\sb100\\sa100\\fs24\\keepn"
+ font B
+ text $name
+ tab
+ text $curSect
+ font R
+ puts $file "\\fs20"
+ set state(breakPending) -1
+}
+
+# nextPara --
+#
+# Set the indents for a new paragraph, and start a paragraph break
+#
+# Arguments:
+# leftIndent - The new left margin for body lines.
+# firstIndent - The offset from the left margin for the first line.
+
+proc nextPara {leftIndent {firstIndent 0i}} {
+ global state
+ set state(leftIndent) [getTwips $leftIndent]
+ set state(firstIndent) [getTwips $firstIndent]
+ set state(paragraphPending) 1
+}
+
+
+# newPara --
+#
+# This procedure sets the left and hanging state(indent)s for a line.
+# State(Indent)s are specified in units of inches or centimeters, and are
+# relative to the current nesting level and left margin.
+#
+# Arguments:
+# leftState(Indent) - The new left margin for lines after the first.
+# firstState(Indent) - The new left margin for the first line of a state(paragraph).
+
+proc newPara {leftIndent {firstIndent 0i}} {
+ global state file
+ if $state(paragraph) {
+ puts -nonewline $file "\\line\n"
+ }
+ set state(leftIndent) [expr {$state(leftMargin) \
+ + ($state(offset) * $state(nestingLevel)) +[getTwips $leftIndent]}]
+ set state(firstIndent) [getTwips $firstIndent]
+ set state(paragraphPending) 1
+}
+
+
+# getTwips --
+#
+# This procedure converts a distance in inches or centimeters into
+# twips (1/1440 of an inch).
+#
+# Arguments:
+# arg - A number followed by "i" or "c"
+
+proc getTwips {arg} {
+ if {[scan $arg "%f%s" distance units] != 2} {
+ puts stderr "bad distance \"$arg\""
+ return 0
+ }
+ switch -- $units {
+ c {
+ set distance [expr {$distance * 567}]
+ }
+ i {
+ set distance [expr {$distance * 1440}]
+ }
+ default {
+ puts stderr "bad units in distance \"$arg\""
+ continue
+ }
+ }
+ return $distance
+}
+
+# incrNestingLevel --
+#
+# This procedure does the work of the .RS macro, which increments
+# the number of state(indent)ations that affect things like .PP.
+#
+# Arguments:
+# None.
+
+proc incrNestingLevel {} {
+ global state
+
+ incr state(nestingLevel)
+ set oldp $state(paragraph)
+ set state(paragraph) 0
+ newPara 0i
+ set state(paragraph) $oldp
+}
+
+# decrNestingLevel --
+#
+# This procedure does the work of the .RE macro, which decrements
+# the number of indentations that affect things like .PP.
+#
+# Arguments:
+# None.
+
+proc decrNestingLevel {} {
+ global state
+
+ if {$state(nestingLevel) == 0} {
+ puts stderr "Nesting level decremented below 0"
+ } else {
+ incr state(nestingLevel) -1
+ }
+}
+
+
diff --git a/tcl/tools/man2html.tcl b/tcl/tools/man2html.tcl
new file mode 100644
index 00000000000..cb60887ba65
--- /dev/null
+++ b/tcl/tools/man2html.tcl
@@ -0,0 +1,181 @@
+#!/proj/tcl/install/5.x-sparc/bin/tclsh7.5
+
+if [catch {
+
+# man2html.tcl --
+#
+# This file contains procedures that work in conjunction with the
+# man2tcl program to generate a HTML files from Tcl manual entries.
+#
+# Copyright (c) 1996 by Sun Microsystems, Inc.
+#
+# SCCS: @(#) man2html.tcl 1.5 96/04/11 20:21:43
+#
+
+set homeDir /home/rjohnson/Projects/tools/generic
+
+# sarray -
+#
+# Save an array to a file so that it can be sourced.
+#
+# Arguments:
+# file - Name of the output file
+# args - Name of the arrays to save
+#
+proc sarray {file args} {
+ set file [open $file w]
+ foreach a $args {
+ upvar $a array
+ if ![array exists array] {
+ puts "sarray: \"$a\" isn't an array"
+ break
+ }
+
+ foreach name [lsort [array names array]] {
+ regsub -all " " $name "\\ " name1
+ puts $file "set ${a}($name1) \{$array($name)\}"
+ }
+ }
+ close $file
+}
+
+
+
+# footer --
+#
+# Builds footer info for HTML pages
+#
+# Arguments:
+# None
+
+proc footer {packages} {
+ lappend f "<HR>"
+ set h {[}
+ foreach package $packages {
+ lappend h "<A HREF=\"../$package/contents.html\">$package</A>"
+ lappend h "|"
+ }
+ lappend f [join [lreplace $h end end {]} ] " "]
+ lappend f "<HR>"
+ lappend f "<PRE>Copyright &#169; 1989-1994 The Regents of the University of California."
+ lappend f "Copyright &#169; 1994-1996 Sun Microsystems, Inc."
+ lappend f "</PRE>"
+ return [join $f "\n"]
+}
+
+
+
+
+# doDir --
+#
+# Given a directory as argument, translate all the man pages in
+# that directory.
+#
+# Arguments:
+# dir - Name of the directory.
+
+proc doDir dir {
+ foreach f [lsort [glob $dir/*.\[13n\]]] {
+ do $f ;# defined in man2html1.tcl & man2html2.tcl
+ }
+}
+
+
+if {$argc < 2} {
+ puts stderr "usage: $argv0 html_dir tcl_dir packages..."
+ puts stderr "usage: $argv0 -clean html_dir"
+ exit 1
+}
+
+if {[lindex $argv 0] == "-clean"} {
+ set html_dir [lindex $argv 1]
+ puts -nonewline "recursively remove: $html_dir? "
+ flush stdout
+ if {[gets stdin] == "y"} {
+ puts "removing: $html_dir"
+ exec rm -r $html_dir
+ }
+ exit 0
+}
+
+set html_dir [lindex $argv 0]
+set tcl_dir [lindex $argv 1]
+set packages [lrange $argv 2 end]
+
+#### need to add glob capability to packages ####
+
+# make sure there are doc directories for each package
+
+foreach i $packages {
+ if ![file exists $tcl_dir/$i/doc] {
+ puts stderr "Error: doc directory for package $i is missing"
+ exit 1
+ }
+ if ![file isdirectory $tcl_dir/$i/doc] {
+ puts stderr "Error: $tcl_dir/$i/doc is not a directory"
+ exit 1
+ }
+}
+
+
+# we want to start with a clean sheet
+
+if [file exists $html_dir] {
+ puts stderr "Error: HTML directory already exists"
+ exit 1
+} else {
+ exec mkdir $html_dir
+}
+
+set footer [footer $packages]
+
+
+# make the hyperlink arrays and contents.html for all packages
+
+foreach package $packages {
+ global homeDir
+ exec mkdir $html_dir/$package
+
+ # build hyperlink database arrays: NAME_file and KEY_file
+ #
+ puts "\nScanning man pages in $tcl_dir/$package/doc..."
+ source $homeDir/man2html1.tcl
+
+ doDir $tcl_dir/$package/doc
+
+ # clean up the NAME_file and KEY_file database arrays
+ #
+ catch {unset KEY_file()}
+ foreach name [lsort [array names NAME_file]] {
+ set file_name $NAME_file($name)
+ if {[llength $file_name] > 1} {
+ set file_name [lsort $file_name]
+ puts stdout "Warning: '$name' multiply defined in: $file_name; using last"
+ set NAME_file($name) [lindex $file_name end]
+ }
+ }
+# sarray $html_dir/$package/xref.tcl NAME_file KEY_file
+
+ # build the contents file from NAME_file
+ #
+ puts "\nGenerating contents.html for $package"
+ doContents $html_dir/$package/contents.html $lib ;# defined in man2html1.tcl
+
+ # now translate the man pages to HTML pages
+ #
+ source $homeDir/man2html2.tcl
+ puts "\nBuilding html pages from man pages in $tcl_dir/$package/doc..."
+ doDir $tcl_dir/$package/doc
+
+ unset NAME_file
+}
+
+
+
+} result] {
+ global errorInfo
+ puts stderr $result
+ puts stderr "in"
+ puts stderr $errorInfo
+}
+
diff --git a/tcl/tools/man2html1.tcl b/tcl/tools/man2html1.tcl
new file mode 100644
index 00000000000..2e8ba526c39
--- /dev/null
+++ b/tcl/tools/man2html1.tcl
@@ -0,0 +1,269 @@
+# man2html1.tcl --
+#
+# This file defines procedures that are used during the first pass of the
+# 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
+#
+
+# Global variables used by these scripts:
+#
+# state - state variable that controls action of text proc.
+#
+# curFile - tail of current man page.
+#
+# file - file pointer; for both xref.tcl and contents.html
+#
+# NAME_file - array indexed by NAME and containing file names used
+# for hyperlinks.
+#
+# KEY_file - array indexed by KEYWORD and containing file names used
+# for hyperlinks.
+#
+# lib - contains package name. Used to label section in contents.html
+#
+# inDT - in dictionary term.
+
+
+
+# text --
+#
+# This procedure adds entries to the hypertext arrays NAME_file
+# and KEY_file.
+#
+# DT: might do this: if first word of $dt matches $name and [llength $name==1]
+# and [llength $dt > 1], then add to NAME_file.
+#
+# Arguments:
+# string - Text to index.
+
+
+proc text string {
+ global state curFile NAME_file KEY_file inDT
+
+ switch $state {
+ NAME {
+ foreach i [split $string ","] {
+ lappend NAME_file([string trim $i]) $curFile
+ }
+ }
+ KEY {
+ foreach i [split $string ","] {
+ lappend KEY_file([string trim $i]) $curFile
+ }
+ }
+ DT -
+ OFF -
+ DASH {}
+ default {
+ puts stderr "text: unknown state: $state"
+ }
+ }
+}
+
+
+# macro --
+#
+# This procedure is invoked to process macro invocations that start
+# with "." (instead of ').
+#
+# Arguments:
+# name - The name of the macro (without the ".").
+# args - Any additional arguments to the macro.
+
+proc macro {name args} {
+ switch $name {
+ SH {
+ global state
+
+ switch $args {
+ NAME {
+ if {$state == "INIT" } {
+ set state NAME
+ }
+ }
+ DESCRIPTION {set state DT}
+ INTRODUCTION {set state DT}
+ KEYWORDS {set state KEY}
+ default {set state OFF}
+ }
+
+ }
+ TP {
+ global inDT
+ set inDT 1
+ }
+ TH {
+ global lib state inDT
+ set inDT 0
+ set state INIT
+ if {[llength $args] != 5} {
+ set args [join $args " "]
+ puts stderr "Bad .TH macro: .$name $args"
+ }
+ set lib [lindex $args 3] ;# Tcl or Tk
+ }
+ }
+}
+
+
+
+# dash --
+#
+# This procedure is invoked to handle dash characters ("\-" in
+# troff). It only function in pass1 is to terminate the NAME state.
+#
+# Arguments:
+# None.
+
+proc dash {} {
+ global state
+ if {$state == "NAME"} {
+ set state DASH
+ }
+}
+
+
+
+# newline --
+#
+# This procedure is invoked to handle newlines in the troff input.
+# It's only purpose is to terminate a DT (dictionary term).
+#
+# Arguments:
+# None.
+
+proc newline {} {
+ global inDT
+ set inDT 0
+}
+
+
+
+
+# initGlobals, tab, font, char, macro2 --
+#
+# These procedures do nothing during the first pass.
+#
+# Arguments:
+# None.
+
+proc initGlobals {} {}
+proc tab {} {}
+proc font type {}
+proc char name {}
+proc macro2 {name args} {}
+
+
+# doListing --
+#
+# Writes an ls like list to a file. Searches NAME_file for entries
+# that match the input pattern.
+#
+# Arguments:
+# file - Output file pointer.
+# pattern - glob style match pattern
+
+proc doListing {file pattern} {
+ global NAME_file
+
+ set max_len 0
+ foreach name [lsort [array names NAME_file]] {
+ set ref $NAME_file($name)
+ if [string match $pattern $ref] {
+ lappend type $name
+ if {[string length $name] > $max_len} {
+ set max_len [string length $name]
+ }
+ }
+ }
+ if [catch {llength $type} ] {
+ puts stderr " doListing: no names matched pattern ($pattern)"
+ return
+ }
+ incr max_len
+ set ncols [expr 90/$max_len]
+ set nrows [expr int( ceil( [llength $type] / $ncols. ) ) ]
+
+# ? max_len ncols nrows
+
+ set index 0
+ foreach f $type {
+ lappend row([expr $index % $nrows]) $f
+ incr index
+ }
+
+ puts -nonewline $file "<PRE>"
+ for {set i 0} {$i<$nrows} {incr i} {
+ foreach name $row($i) {
+ set str [format "%-*s" $max_len $name]
+ regsub $name $str "<A HREF=\"$NAME_file($name).html\">$name</A>" str
+ puts -nonewline $file $str
+ }
+ puts $file {}
+ }
+ puts $file "</PRE>"
+}
+
+
+# doContents --
+#
+# Generates a HTML contents file using the NAME_file array
+# as its input database.
+#
+# 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.
+
+proc doContents {file packageName} {
+ global footer
+
+ set file [open $file w]
+
+ puts $file "<HTML><HEAD><TITLE>$packageName Manual</TITLE></HEAD><BODY>"
+ puts $file "<H3>$packageName</H3>"
+ doListing $file "*.1"
+
+ puts $file "<HR><H3>$packageName Commands</H3>"
+ doListing $file "*.n"
+
+ puts $file "<HR><H3>$packageName Library</H3>"
+ doListing $file "*.3"
+
+ puts $file $footer
+ puts $file "</BODY></HTML>"
+ close $file
+}
+
+
+
+
+# do --
+#
+# This is the toplevel procedure that searches a man page
+# for hypertext links. It builds a data base consisting of
+# two arrays: NAME_file and KEY file. It runs the man2tcl
+# program to turn the man page into a script, then it evals
+# that script.
+#
+# Arguments:
+# fileName - Name of the file to scan.
+
+proc do fileName {
+ global curFile
+ set curFile [file tail $fileName]
+ set file stdout
+ puts " Pass 1 -- $fileName"
+ flush stdout
+ if [catch {eval [exec man2tcl [glob $fileName]]} msg] {
+ global errorInfo
+ puts stderr $msg
+ puts "in"
+ puts $errorInfo
+ exit 1
+ }
+}
+
diff --git a/tcl/tools/man2html2.tcl b/tcl/tools/man2html2.tcl
new file mode 100644
index 00000000000..789b4dbceba
--- /dev/null
+++ b/tcl/tools/man2html2.tcl
@@ -0,0 +1,871 @@
+# man2html2.tcl --
+#
+# This file defines procedures that are used during the second pass of the
+# man page to html conversion process. It is sourced by man2html.tcl.
+#
+# Copyright (c) 1996 by Sun Microsystems, Inc.
+#
+# SCCS: @(#) man2html2.tcl 1.2 96/03/21 10:48:30
+#
+
+# Global variables used by these scripts:
+#
+# NAME_file - array indexed by NAME and containing file names used
+# for hyperlinks.
+#
+# textState - state variable defining action of 'text' proc.
+#
+# nestStk - stack oriented list containing currently active
+# HTML tags (UL, OL, DL). Local to 'nest' proc.
+#
+# inDT - set by 'TPmacro', cleared by 'newline'. Used to insert
+# the <DT> tag while in a dictionary list <DL>.
+#
+# curFont - Name of special font that is currently in
+# use. Null means the default paragraph font
+# is being used.
+#
+# file - Where to output the generated HTML.
+#
+# fontStart - Array to map font names to starting sequences.
+#
+# fontEnd - Array to map font names to ending sequences.
+#
+# noFillCount - Non-zero means don't fill the next $noFillCount
+# lines: force a line break at each newline. Zero
+# means filling is enabled, so don't output line
+# breaks for each newline.
+#
+# footer - info inserted at bottom of each page. Normally read
+# from the xref.tcl file
+
+# initGlobals --
+#
+# This procedure is invoked to set the initial values of all of the
+# global variables, before processing a man page.
+#
+# Arguments:
+# None.
+
+proc initGlobals {} {
+ global file noFillCount textState
+ global fontStart fontEnd curFont inPRE charCnt
+
+ nest init
+ set inPRE 0
+ set textState 0
+ set curFont ""
+ set fontStart(Code) "<B>"
+ set fontStart(Emphasis) "<I>"
+ set fontEnd(Code) "</B>"
+ set fontEnd(Emphasis) "</I>"
+ set noFillCount 0
+ set charCnt 0
+ setTabs 0.5i
+}
+
+
+# beginFont --
+#
+# Arranges for future text to use a special font, rather than
+# the default paragraph font.
+#
+# Arguments:
+# font - Name of new font to use.
+
+proc beginFont font {
+ global curFont file fontStart
+
+ if {$curFont == $font} {
+ return
+ }
+ endFont
+ puts -nonewline $file $fontStart($font)
+ set curFont $font
+}
+
+
+# endFont --
+#
+# Reverts to the default font for the paragraph type.
+#
+# Arguments:
+# None.
+
+proc endFont {} {
+ global curFont file fontEnd
+
+ if {$curFont != ""} {
+ puts -nonewline $file $fontEnd($curFont)
+ set curFont ""
+ }
+}
+
+
+
+# text --
+#
+# This procedure adds text to the current paragraph. If this is
+# the first text in the paragraph then header information for the
+# paragraph is output before the text.
+#
+# Arguments:
+# string - Text to output in the paragraph.
+
+proc text string {
+ global file textState inDT charCnt
+
+ set pos [string first "\t" $string]
+ if {$pos >= 0} {
+ text [string range $string 0 [expr $pos-1]]
+ tab
+ text [string range $string [expr $pos+1] end]
+ return
+ }
+ incr charCnt [string length $string]
+ regsub -all {&} $string {\&amp;} string
+ regsub -all {<} $string {\&lt;} string
+ regsub -all {>} $string {\&gt;} string
+ regsub -all {"} $string {\&quot;} string
+ switch $textState {
+ REF {
+ if {$inDT == {}} {
+ set string [insertRef $string]
+ }
+ }
+ SEE {
+ global NAME_file
+ foreach i [split $string] {
+ if ![regexp -nocase {^[a-z_]+} [string trim $i] i ] {
+# puts "Warning: $i in SEE ALSO not found"
+ continue
+ }
+ if ![catch {set ref $NAME_file($i)} ] {
+ regsub $i $string "<A HREF=\"$ref.html\">$i</A>" string
+ }
+ }
+ }
+ }
+ puts -nonewline $file "$string"
+}
+
+
+
+# insertRef --
+#
+#
+# Arguments:
+# string - Text to output in the paragraph.
+
+proc insertRef string {
+ global NAME_file self
+ set path {}
+ if ![catch {set ref $NAME_file([string trim $string])} ] {
+ if {"$ref.html" != $self} {
+ set string "<A HREF=\"${path}$ref.html\">$string</A>"
+# puts "insertRef: $self $ref.html ---$string--"
+ }
+ }
+ return $string
+}
+
+
+
+# macro --
+#
+# This procedure is invoked to process macro invocations that start
+# with "." (instead of ').
+#
+# Arguments:
+# name - The name of the macro (without the ".").
+# args - Any additional arguments to the macro.
+
+proc macro {name args} {
+ switch $name {
+ AP {
+ if {[llength $args] != 3} {
+ puts stderr "Bad .AP macro: .$name [join $args " "]"
+ }
+ setTabs {1.25i 2.5i 3.75i}
+ TPmacro {}
+ font B
+ text "[lindex $args 0] "
+ font I
+ text "[lindex $args 1]"
+ font R
+ text " ([lindex $args 2])"
+ newline
+ }
+ AS {} ;# next page and previous page
+ br {
+ lineBreak
+ }
+ BS {}
+ BE {}
+ CE {
+ global file noFillCount inPRE
+ puts $file </PRE></BLOCKQUOTE>
+ set inPRE 0
+ }
+ CS { ;# code section
+ global file noFillCount inPRE
+ puts -nonewline $file <BLOCKQUOTE><PRE>
+ set inPRE 1
+ }
+ DE {
+ global file noFillCount inPRE
+ puts $file </PRE></BLOCKQUOTE>
+ set inPRE 0
+ set noFillCount 0
+ }
+ DS {
+ global file noFillCount inPRE
+ puts -nonewline $file <BLOCKQUOTE><PRE>
+ set noFillCount 10000000
+ set inPRE 1
+ }
+ fi {
+ global noFillCount
+ set noFillCount 0
+ }
+ IP {
+ IPmacro $args
+ }
+ LP {
+ nest decr
+ nest incr
+ newPara
+ }
+ ne {
+ }
+ nf {
+ global noFillCount
+ set noFillCount 1000000
+ }
+ OP {
+ global inDT file inPRE
+ if {[llength $args] != 3} {
+ puts stderr "Bad .OP macro: .$name [join $args " "]"
+ }
+ nest para DL DT
+ set inPRE 1
+ puts -nonewline $file <PRE>
+ setTabs 4c
+ text "Command-Line Name:"
+ tab
+ font B
+ set x [lindex $args 0]
+ regsub -all {\\-} $x - x
+ text $x
+ newline
+ font R
+ text "Database Name:"
+ tab
+ font B
+ text [lindex $args 1]
+ newline
+ font R
+ text "Database Class:"
+ tab
+ font B
+ text [lindex $args 2]
+ font R
+ puts -nonewline $file </PRE>
+ set inDT "\n<DD>" ;# next newline writes inDT
+ set inPRE 0
+ newline
+ }
+ PP {
+ nest decr
+ nest incr
+ newPara
+ }
+ RE {
+ nest decr
+ }
+ RS {
+ nest incr
+ }
+ SE {
+ global noFillCount textState inPRE file
+
+ font R
+ puts -nonewline $file </PRE>
+ set inPRE 0
+ set noFillCount 0
+ nest reset
+ newPara
+ text "See the "
+ font B
+ set temp $textState
+ set textState REF
+ text options
+ set textState $temp
+ font R
+ text " manual entry for detailed descriptions of the above options."
+ }
+ SH {
+ SHmacro $args
+ }
+ SO {
+ global noFillCount inPRE file
+
+ SHmacro "STANDARD OPTIONS"
+ setTabs {4c 8c 12c}
+ set noFillCount 1000000
+ puts -nonewline $file <PRE>
+ set inPRE 1
+ font B
+ }
+ so {
+ if {$args != "man.macros"} {
+ puts stderr "Unknown macro: .$name [join $args " "]"
+ }
+ }
+ sp { ;# needs work
+ if {$args == ""} {
+ set count 1
+ } else {
+ set count [lindex $args 0]
+ }
+ while {$count > 0} {
+ lineBreak
+ incr count -1
+ }
+ }
+ ta {
+ setTabs $args
+ }
+ TH {
+ THmacro $args
+ }
+ TP {
+ TPmacro $args
+ }
+ UL { ;# underline
+ global file
+ puts -nonewline $file "<B><U>"
+ text [lindex $args 0]
+ puts -nonewline $file "</U></B>"
+ if {[llength $args] == 2} {
+ text [lindex $args 1]
+ }
+ }
+ VE {
+# global file
+# puts -nonewline $file "</FONT>"
+ }
+ VS {
+# global file
+# if {[llength $args] > 0} {
+# puts -nonewline $file "<BR>"
+# }
+# puts -nonewline $file "<FONT COLOR=\"GREEN\">"
+ }
+ default {
+ puts stderr "Unknown macro: .$name [join $args " "]"
+ }
+ }
+
+# global nestStk; puts "$name [format "%-20s" $args] $nestStk"
+# flush stdout; flush stderr
+}
+
+
+# font --
+#
+# This procedure is invoked to handle font changes in the text
+# being output.
+#
+# Arguments:
+# type - Type of font: R, I, B, or S.
+
+proc font type {
+ global textState
+ switch $type {
+ P -
+ R {
+ endFont
+ if {$textState == "REF"} {
+ set textState INSERT
+ }
+ }
+ B {
+ beginFont Code
+ if {$textState == "INSERT"} {
+ set textState REF
+ }
+ }
+ I {
+ beginFont Emphasis
+ }
+ S {
+ }
+ default {
+ puts stderr "Unknown font: $type"
+ }
+ }
+}
+
+
+
+# formattedText --
+#
+# Insert a text string that may also have \fB-style font changes
+# and a few other backslash sequences in it.
+#
+# Arguments:
+# text - Text to insert.
+
+proc formattedText text {
+# puts "formattedText: $text"
+ while {$text != ""} {
+ set index [string first \\ $text]
+ if {$index < 0} {
+ text $text
+ return
+ }
+ text [string range $text 0 [expr $index-1]]
+ set c [string index $text [expr $index+1]]
+ switch -- $c {
+ f {
+ font [string index $text [expr $index+2]]
+ set text [string range $text [expr $index+3] end]
+ }
+ e {
+ text \\
+ set text [string range $text [expr $index+2] end]
+ }
+ - {
+ dash
+ set text [string range $text [expr $index+2] end]
+ }
+ | {
+ set text [string range $text [expr $index+2] end]
+ }
+ default {
+ puts stderr "Unknown sequence: \\$c"
+ set text [string range $text [expr $index+2] end]
+ }
+ }
+ }
+}
+
+
+
+# dash --
+#
+# This procedure is invoked to handle dash characters ("\-" in
+# troff). It outputs a special dash character.
+#
+# Arguments:
+# None.
+
+proc dash {} {
+ global textState charCnt
+ if {$textState == "NAME"} {
+ set textState 0
+ }
+ incr charCnt
+ text "-"
+}
+
+
+# tab --
+#
+# This procedure is invoked to handle tabs in the troff input.
+# Right now it does nothing.
+#
+# Arguments:
+# None.
+
+proc tab {} {
+ global inPRE charCnt tabString
+# ? charCnt
+ if {$inPRE == 1} {
+ set pos [expr $charCnt % [string length $tabString] ]
+ set spaces [string first "1" [string range $tabString $pos end] ]
+ text [format "%*s" [incr spaces] " "]
+ } else {
+# puts "tab: found tab outside of <PRE> block"
+ }
+}
+
+
+# setTabs --
+#
+# This procedure handles the ".ta" macro, which sets tab stops.
+#
+# Arguments:
+# tabList - List of tab stops, each consisting of a number
+# followed by "i" (inch) or "c" (cm).
+
+proc setTabs {tabList} {
+ global file breakPending tabString
+
+# puts "setTabs: --$tabList--"
+ set last 0
+ set tabString {}
+ set charsPerInch 14.
+ set numTabs [llength $tabList]
+ foreach arg $tabList {
+ if {[scan $arg "%f%s" distance units] != 2} {
+ puts stderr "bad distance \"$arg\""
+ return 0
+ }
+ switch -- $units {
+ c {
+ set distance [expr $distance * $charsPerInch / 2.54 ]
+ }
+ i {
+ set distance [expr $distance * $charsPerInch]
+ }
+ default {
+ puts stderr "bad units in distance \"$arg\""
+ continue
+ }
+ }
+# ? distance
+ lappend tabString [format "%*s1" [expr round($distance-$last-1)] " "]
+ set last $distance
+ }
+ set tabString [join $tabString {}]
+# puts "setTabs: --$tabString--"
+}
+
+
+
+# lineBreak --
+#
+# Generates a line break in the HTML output.
+#
+# Arguments:
+# None.
+
+proc lineBreak {} {
+ global file inPRE
+ puts $file "<BR>"
+}
+
+
+
+# newline --
+#
+# This procedure is invoked to handle newlines in the troff input.
+# It outputs either a space character or a newline character, depending
+# on fill mode.
+#
+# Arguments:
+# None.
+
+proc newline {} {
+ global noFillCount file inDT inPRE charCnt
+
+ if {$inDT != {} } {
+ puts $file "\n$inDT"
+ set inDT {}
+ } elseif {$noFillCount == 0 || $inPRE == 1} {
+ puts $file {}
+ } else {
+ lineBreak
+ incr noFillCount -1
+ }
+ set charCnt 0
+}
+
+
+
+# char --
+#
+# This procedure is called to handle a special character.
+#
+# Arguments:
+# name - Special character named in troff \x or \(xx construct.
+
+proc char name {
+ global file charCnt
+
+ incr charCnt
+# puts "char: $name"
+ switch -exact $name {
+ \\0 { ;# \0
+ puts -nonewline $file " "
+ }
+ \\\\ { ;# \
+ puts -nonewline $file "\\"
+ }
+ \\(+- { ;# +/-
+ puts -nonewline $file "&#177;"
+ }
+ \\% {} ;# \%
+ \\| { ;# \|
+ }
+ default {
+ puts stderr "Unknown character: $name"
+ }
+ }
+}
+
+
+# macro2 --
+#
+# This procedure handles macros that are invoked with a leading "'"
+# character instead of space. Right now it just generates an
+# error diagnostic.
+#
+# Arguments:
+# name - The name of the macro (without the ".").
+# args - Any additional arguments to the macro.
+
+proc macro2 {name args} {
+ puts stderr "Unknown macro: '$name [join $args " "]"
+}
+
+
+
+# SHmacro --
+#
+# Subsection head; handles the .SH macro.
+#
+# Arguments:
+# name - Section name.
+
+proc SHmacro argList {
+ global file noFillCount textState charCnt
+
+ set args [join $argList " "]
+ if {[llength $argList] < 1} {
+ puts stderr "Bad .SH macro: .$name $args"
+ }
+
+ set noFillCount 0
+ nest reset
+
+ puts -nonewline $file "<H3>"
+ text $args
+ puts $file "</H3>"
+
+# ? args textState
+
+ # control what the text proc does with text
+
+ switch $args {
+ NAME {set textState NAME}
+ DESCRIPTION {set textState INSERT}
+ INTRODUCTION {set textState INSERT}
+ "WIDGET-SPECIFIC OPTIONS" {set textState INSERT}
+ "SEE ALSO" {set textState SEE}
+ KEYWORDS {set textState 0}
+ }
+ set charCnt 0
+}
+
+
+
+# IPmacro --
+#
+# This procedure is invoked to handle ".IP" macros, which may take any
+# of the following forms:
+#
+# .IP [1] Translate to a "1Step" paragraph.
+# .IP [x] (x > 1) Translate to a "Step" paragraph.
+# .IP Translate to a "Bullet" paragraph.
+# .IP text count Translate to a FirstBody paragraph with special
+# indent and tab stop based on "count", and tab after
+# "text".
+#
+# Arguments:
+# argList - List of arguments to the .IP macro.
+#
+# HTML limitations: 'count' in '.IP text count' is ignored.
+
+proc IPmacro argList {
+ global file
+
+ setTabs 0.5i
+ set length [llength $argList]
+ if {$length == 0} {
+ nest para UL LI
+ return
+ }
+ if {$length == 1} {
+ nest para OL LI
+ return
+ }
+ if {$length > 1} {
+ nest para DL DT
+ formattedText [lindex $argList 0]
+ puts $file "\n<DD>"
+ return
+ }
+ puts stderr "Bad .IP macro: .IP [join $argList " "]"
+}
+
+
+# TPmacro --
+#
+# This procedure is invoked to handle ".TP" macros, which may take any
+# of the following forms:
+#
+# .TP x Translate to an indented paragraph with the
+# specified indent (in 100 twip units).
+# .TP Translate to an indented paragraph with
+# default indent.
+#
+# Arguments:
+# argList - List of arguments to the .IP macro.
+#
+# HTML limitations: 'x' in '.TP x' is ignored.
+
+
+proc TPmacro {argList} {
+ global inDT
+ nest para DL DT
+ set inDT "\n<DD>" ;# next newline writes inDT
+ setTabs 0.5i
+}
+
+
+
+# THmacro --
+#
+# This procedure handles the .TH macro. It generates the non-scrolling
+# header section for a given man page, and enters information into the
+# table of contents. The .TH macro has the following form:
+#
+# .TH name section date footer header
+#
+# Arguments:
+# argList - List of arguments to the .TH macro.
+
+proc THmacro {argList} {
+ global file
+
+ if {[llength $argList] != 5} {
+ set args [join $argList " "]
+ puts stderr "Bad .TH macro: .$name $args"
+ }
+ set name [lindex $argList 0] ;# Tcl_UpVar
+ set page [lindex $argList 1] ;# 3
+ set vers [lindex $argList 2] ;# 7.4
+ set lib [lindex $argList 3] ;# Tcl
+ set pname [lindex $argList 4] ;# {Tcl Library Procedures}
+
+ puts -nonewline $file "<HTML><HEAD><TITLE>"
+ text "$lib - $name ($page)"
+ puts $file "</TITLE></HEAD><BODY>\n"
+
+ puts -nonewline $file "<H1><CENTER>"
+ text $pname
+ puts $file "</CENTER></H1>\n"
+}
+
+
+
+# newPara --
+#
+# This procedure sets the left and hanging indents for a line.
+# Indents are specified in units of inches or centimeters, and are
+# relative to the current nesting level and left margin.
+#
+# Arguments:
+# None
+
+proc newPara {} {
+ global file nestStk
+
+ if {[lindex $nestStk end] != "NEW" } {
+ nest decr
+ }
+ puts -nonewline $file "<P>"
+}
+
+
+
+# nest --
+#
+# This procedure takes care of inserting the tags associated with the
+# IP, TP, RS, RE, LP and PP macros. Only 'nest para' takes arguments.
+#
+# Arguments:
+# op - operation: para, incr, decr, reset, init
+# listStart - begin list tag: OL, UL, DL.
+# listItem - item tag: LI, LI, DT.
+
+proc nest {op {listStart "NEW"} {listItem {} } } {
+ global file nestStk inDT charCnt
+# puts "nest: $op $listStart $listItem"
+ switch $op {
+ para {
+ set top [lindex $nestStk end]
+ if {$top == "NEW" } {
+ set nestStk [lreplace $nestStk end end $listStart]
+ puts $file "<$listStart>"
+ } elseif {$top != $listStart} {
+ puts stderr "nest para: bad stack"
+ exit 1
+ }
+ puts $file "\n<$listItem>"
+ set charCnt 0
+ }
+ incr {
+ lappend nestStk NEW
+ }
+ decr {
+ if {[llength $nestStk] == 0} {
+ puts stderr "nest error: nest length is zero"
+ set nestStk NEW
+ }
+ set tag [lindex $nestStk end]
+ if {$tag != "NEW"} {
+ puts $file "</$tag>"
+ }
+ set nestStk [lreplace $nestStk end end]
+ }
+ reset {
+ while {[llength $nestStk] > 0} {
+ nest decr
+ }
+ set nestStk NEW
+ }
+ init {
+ set nestStk NEW
+ set inDT {}
+ }
+ }
+ set charCnt 0
+}
+
+
+
+# do --
+#
+# This is the toplevel procedure that translates a man page
+# to Frame. It runs the man2tcl program to turn the man page
+# into a script, then it evals that script.
+#
+# Arguments:
+# fileName - Name of the file to translate.
+
+proc do fileName {
+ global file self html_dir package footer
+ set self "[file tail $fileName].html"
+ set file [open "$html_dir/$package/$self" w]
+ puts " Pass 2 -- $fileName"
+ flush stdout
+ initGlobals
+ if [catch {eval [exec man2tcl [glob $fileName]]} msg] {
+ global errorInfo
+ puts stderr $msg
+ puts "in"
+ puts stderr $errorInfo
+ exit 1
+ }
+ nest reset
+ puts $file $footer
+ puts $file "</BODY></HTML>"
+ close $file
+}
+
+
+
diff --git a/tcl/tools/man2tcl.c b/tcl/tools/man2tcl.c
new file mode 100644
index 00000000000..3bb82496826
--- /dev/null
+++ b/tcl/tools/man2tcl.c
@@ -0,0 +1,405 @@
+/*
+ * man2tcl.c --
+ *
+ * This file contains a program that turns a man page of the
+ * form used for Tcl and Tk into a Tcl script that invokes
+ * a Tcl command for each construct in the man page. The
+ * script can then be eval'ed to translate the manual entry
+ * into some other format such as MIF or HTML.
+ *
+ * Usage:
+ *
+ * man2tcl ?fileName?
+ *
+ * Copyright (c) 1995 Sun Microsystems, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+static char sccsid[] = "@(#) man2tcl.c 1.3 95/08/12 17:34:08";
+
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#ifndef NO_ERRNO_H
+#include <errno.h>
+#endif
+
+/*
+ * Imported things that aren't defined in header files:
+ */
+
+extern int errno;
+
+/*
+ * Current line number, used for error messages.
+ */
+
+static int lineNumber;
+
+/*
+ * The variable below is set to 1 if an error occurs anywhere
+ * while reading in the file.
+ */
+
+static int status;
+
+/*
+ * The variable below is set to 1 if output should be generated.
+ * If it's 0, it means we're doing a pre-pass to make sure that
+ * the file can be properly parsed.
+ */
+
+static int writeOutput;
+
+/*
+ * Prototypes for procedures defined in this file:
+ */
+
+static void DoMacro(char *line);
+static void DoText(char *line);
+static void QuoteText(char *string, int count);
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * main --
+ *
+ * This procedure is the main program, which does all of the work
+ * of the program.
+ *
+ * Results:
+ * None: exits with a 0 return status to indicate success, or
+ * 1 to indicate that there were problems in the translation.
+ *
+ * Side effects:
+ * A Tcl script is output to standard output. Error messages may
+ * be output on standard error.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+main(argc, argv)
+ int argc; /* Number of command-line arguments. */
+ char **argv; /* Values of command-line arguments. */
+{
+ FILE *f;
+#define MAX_LINE_SIZE 500
+ char line[MAX_LINE_SIZE];
+ char *p;
+
+ /*
+ * Find the file to read, and open it if it isn't stdin.
+ */
+
+ if (argc == 1) {
+ f = stdin;
+ } else if (argc == 2) {
+ f = fopen(argv[1], "r");
+ if (f == NULL) {
+ fprintf(stderr, "Couldn't read \"%s\": %s\n", argv[1],
+ strerror(errno));
+ exit(1);
+ }
+ } else {
+ fprintf(stderr, "Usage: %s ?fileName?\n", argv[0]);
+ }
+
+ /*
+ * Make two passes over the file. In the first pass, just check
+ * to make sure we can handle everything. If there are problems,
+ * generate output and stop. If everything is OK, make a second
+ * pass to actually generate output.
+ */
+
+ for (writeOutput = 0; writeOutput < 2; writeOutput++) {
+ lineNumber = 0;
+ status = 0;
+ while (fgets(line, MAX_LINE_SIZE, f) != NULL) {
+ for (p = line; *p != 0; p++) {
+ if (*p == '\n') {
+ *p = 0;
+ break;
+ }
+ }
+ lineNumber++;
+
+ if ((line[0] == '\'') && (line[1] == '\\') && (line[2] == '\"')) {
+ /*
+ * This line is a comment. Ignore it.
+ */
+
+ continue;
+ }
+
+ if ((line[0] == '.') || (line[0] == '\'')) {
+ /*
+ * This line is a macro invocation.
+ */
+
+ DoMacro(line);
+ } else {
+ /*
+ * This line is text, possibly with formatting characters
+ * embedded in it.
+ */
+
+ DoText(line);
+ }
+ }
+ if (status != 0) {
+ break;
+ }
+ fseek(f, 0, SEEK_SET);
+ }
+ exit(status);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DoMacro --
+ *
+ * This procedure is called to handle a macro invocation.
+ * It parses the arguments to the macro and generates a
+ * Tcl command to handle the invocation.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * A Tcl command is written to stdout.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+DoMacro(line)
+ char *line; /* The line of text that contains the
+ * macro invocation. */
+{
+ char *p, *end;
+
+ /*
+ * If there is no macro name, then just skip the whole line.
+ */
+
+ if ((line[1] == 0) || (isspace(line[1]))) {
+ return;
+ }
+
+ if (writeOutput) {
+ printf("macro");
+ }
+ if (*line != '.') {
+ if (writeOutput) {
+ printf("2");
+ }
+ }
+
+ /*
+ * Parse the arguments to the macro (including the name), in order.
+ */
+
+ p = line+1;
+ while (1) {
+ if (writeOutput) {
+ putc(' ', stdout);
+ }
+ if (*p == '"') {
+ /*
+ * The argument is delimited by quotes.
+ */
+
+ for (end = p+1; *end != '"'; end++) {
+ if (*end == 0) {
+ fprintf(stderr,
+ "Unclosed quote in macro call on line %d.\n",
+ lineNumber);
+ status = 1;
+ break;
+ }
+ }
+ QuoteText(p+1, (end-(p+1)));
+ } else {
+ for (end = p+1; (*end != 0) && !isspace(*end); end++) {
+ /* Empty loop body. */
+ }
+ QuoteText(p, end-p);
+ }
+ if (*end == 0) {
+ break;
+ }
+ p = end+1;
+ while (isspace(*p)) {
+ /*
+ * Skip empty space before next argument.
+ */
+
+ p++;
+ }
+ if (*p == 0) {
+ break;
+ }
+ }
+ if (writeOutput) {
+ putc('\n', stdout);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DoText --
+ *
+ * This procedure is called to handle a line of troff text.
+ * It parses the text, generating Tcl commands for text and
+ * for formatting stuff such as font changes.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Tcl commands are written to stdout.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+DoText(line)
+ char *line; /* The line of text. */
+{
+ char *p, *end;
+
+ /*
+ * Divide the line up into pieces consisting of backslash sequences,
+ * tabs, and other text.
+ */
+
+ p = line;
+ while (*p != 0) {
+ if (*p == '\t') {
+ if (writeOutput) {
+ printf("tab\n");
+ }
+ p++;
+ } else if (*p != '\\') {
+ /*
+ * Ordinary text.
+ */
+
+ for (end = p+1; (*end != '\\') && (*end != 0); end++) {
+ /* Empty loop body. */
+ }
+ if (writeOutput) {
+ printf("text ");
+ }
+ QuoteText(p, end-p);
+ if (writeOutput) {
+ putc('\n', stdout);
+ }
+ p = end;
+ } else {
+ /*
+ * A backslash sequence. There are particular ones
+ * that we understand; output an error message for
+ * anything else and just ignore the backslash.
+ */
+
+ p++;
+ if (*p == 'f') {
+ /*
+ * Font change.
+ */
+
+ if (writeOutput) {
+ printf("font %c\n", p[1]);
+ }
+ p += 2;
+ } else if (*p == '-') {
+ if (writeOutput) {
+ printf("dash\n");
+ }
+ p++;
+ } else if (*p == 'e') {
+ if (writeOutput) {
+ printf("text \\\\\n");
+ }
+ p++;
+ } else if (*p == '.') {
+ if (writeOutput) {
+ printf("text .\n");
+ }
+ p++;
+ } else if (*p == '&') {
+ p++;
+ } else if (*p == '(') {
+ if ((p[1] == 0) || (p[2] == 0)) {
+ fprintf(stderr, "Bad \\( sequence on line %d.\n",
+ lineNumber);
+ status = 1;
+ } else {
+ if (writeOutput) {
+ printf("char {\\(%c%c}\n", p[1], p[2]);
+ }
+ p += 3;
+ }
+ } else if (*p != 0) {
+ if (writeOutput) {
+ printf("char {\\%c}\n", *p);
+ }
+ p++;
+ }
+ }
+ }
+ if (writeOutput) {
+ printf("newline\n");
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * QuoteText --
+ *
+ * Copy the "string" argument to stdout, adding quote characters
+ * around any special Tcl characters so that they'll just be treated
+ * as ordinary text.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Text is written to stdout.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+QuoteText(string, count)
+ char *string; /* The line of text. */
+ int count; /* Number of characters to write from string. */
+{
+ if (count == 0) {
+ if (writeOutput) {
+ printf("{}");
+ }
+ return;
+ }
+ for ( ; count > 0; string++, count--) {
+ if ((*string == '$') || (*string == '[') || (*string == '{')
+ || (*string == ' ') || (*string == ';') || (*string == '\\')
+ || (*string == '"') || (*string == '\t')) {
+ if (writeOutput) {
+ putc('\\', stdout);
+ }
+ }
+ if (writeOutput) {
+ putc(*string, stdout);
+ }
+ }
+}
diff --git a/tcl/tools/regexpTestLib.tcl b/tcl/tools/regexpTestLib.tcl
new file mode 100644
index 00000000000..d43cd4ed594
--- /dev/null
+++ b/tcl/tools/regexpTestLib.tcl
@@ -0,0 +1,266 @@
+# regexpTestLib.tcl --
+#
+# This file contains tcl procedures used by spencer2testregexp.tcl and
+# spencer2regexp.tcl, which are programs written to convert Henry
+# Spencer's test suite to tcl test files.
+#
+# Copyright (c) 1996 by Sun Microsystems, Inc.
+#
+# SCCS: @(#) regexpTestLib.tcl 1.4 98/01/22 14:48:34
+#
+
+proc readInputFile {} {
+ global inFileName
+ global lineArray
+
+ set fileId [open $inFileName r]
+
+ set i 0
+ while {[gets $fileId line] >= 0} {
+
+ set len [string length $line]
+
+ if {($len > 0) && ([string index $line [expr $len - 1]] == "\\")} {
+ if {[info exists lineArray(c$i)] == 0} {
+ set lineArray(c$i) 1
+ } else {
+ incr lineArray(c$i)
+ }
+ set line [string range $line 0 [expr $len - 2]]
+ append lineArray($i) $line
+ continue
+ }
+ if {[info exists lineArray(c$i)] == 0} {
+ set lineArray(c$i) 1
+ } else {
+ incr lineArray(c$i)
+ }
+ append lineArray($i) $line
+ incr i
+ }
+
+ close $fileId
+ return $i
+}
+
+#
+# strings with embedded @'s are truncated
+# unpreceeded @'s are replaced by {}
+#
+proc removeAts {ls} {
+ set len [llength $ls]
+ set newLs {}
+ foreach item $ls {
+ regsub @.* $item "" newItem
+ lappend newLs $newItem
+ }
+ return $newLs
+}
+
+proc convertErrCode {code} {
+
+ set errMsg "couldn't compile regular expression pattern:"
+
+ if {[string compare $code "INVARG"] == 0} {
+ return "$errMsg invalid argument to regex routine"
+ } elseif {[string compare $code "BADRPT"] == 0} {
+ return "$errMsg ?+* follows nothing"
+ } elseif {[string compare $code "BADBR"] == 0} {
+ return "$errMsg invalid repetition count(s)"
+ } elseif {[string compare $code "BADOPT"] == 0} {
+ return "$errMsg invalid embedded option"
+ } elseif {[string compare $code "EPAREN"] == 0} {
+ return "$errMsg unmatched ()"
+ } elseif {[string compare $code "EBRACE"] == 0} {
+ return "$errMsg unmatched {}"
+ } elseif {[string compare $code "EBRACK"] == 0} {
+ return "$errMsg unmatched \[\]"
+ } elseif {[string compare $code "ERANGE"] == 0} {
+ return "$errMsg invalid character range"
+ } elseif {[string compare $code "ECTYPE"] == 0} {
+ return "$errMsg invalid character class"
+ } elseif {[string compare $code "ECOLLATE"] == 0} {
+ return "$errMsg invalid collating element"
+ } elseif {[string compare $code "EESCAPE"] == 0} {
+ return "$errMsg invalid escape sequence"
+ } elseif {[string compare $code "BADPAT"] == 0} {
+ return "$errMsg invalid regular expression"
+ } elseif {[string compare $code "ESUBREG"] == 0} {
+ return "$errMsg invalid backreference number"
+ } elseif {[string compare $code "IMPOSS"] == 0} {
+ return "$errMsg can never match"
+ }
+ return "$errMsg $code"
+}
+
+proc writeOutputFile {numLines fcn} {
+ global outFileName
+ global lineArray
+
+ # open output file and write file header info to it.
+
+ set fileId [open $outFileName w]
+
+ puts $fileId "# Commands covered: $fcn"
+ puts $fileId "#"
+ puts $fileId "# This Tcl-generated file contains tests for the $fcn tcl command."
+ puts $fileId "# Sourcing this file into Tcl runs the tests and generates output for"
+ puts $fileId "# errors. No output means no errors were found. Setting VERBOSE to"
+ puts $fileId "# -1 will run tests that are known to fail."
+ puts $fileId "#"
+ puts $fileId "# Copyright (c) 1998 Sun Microsystems, Inc."
+ puts $fileId "#"
+ puts $fileId "# See the file \"license.terms\" for information on usage and redistribution"
+ puts $fileId "# of this file, and for a DISCLAIMER OF ALL WARRANTIES."
+ puts $fileId "#"
+ puts $fileId "\# SCCS: \%Z\% \%M\% \%I\% \%E\% \%U\%"
+ puts $fileId "\nproc print \{arg\} \{puts \$arg\}\n"
+ puts $fileId "if \{\[string compare test \[info procs test\]\] == 1\} \{"
+ puts $fileId " source defs ; set VERBOSE -1\n\}\n"
+ puts $fileId "if \{\$VERBOSE != -1\} \{"
+ puts $fileId " proc print \{arg\} \{\}\n\}\n"
+ puts $fileId "#"
+ puts $fileId "# The remainder of this file is Tcl tests that have been"
+ puts $fileId "# converted from Henry Spencer's regexp test suite."
+ puts $fileId "#\n"
+
+ set lineNum 0
+ set srcLineNum 1
+ while {$lineNum < $numLines} {
+
+ set currentLine $lineArray($lineNum)
+
+ # copy comment string to output file and continue
+
+ if {[string index $currentLine 0] == "#"} {
+ puts $fileId $currentLine
+ incr srcLineNum $lineArray(c$lineNum)
+ incr lineNum
+ continue
+ }
+
+ set len [llength $currentLine]
+
+ # copy empty string to output file and continue
+
+ if {$len == 0} {
+ puts $fileId "\n"
+ incr srcLineNum $lineArray(c$lineNum)
+ incr lineNum
+ continue
+ }
+ if {($len < 3)} {
+ puts "warning: test is too short --\n\t$currentLine"
+ incr srcLineNum $lineArray(c$lineNum)
+ incr lineNum
+ continue
+ }
+
+ puts $fileId [convertTestLine $currentLine $len $lineNum $srcLineNum]
+
+ incr srcLineNum $lineArray(c$lineNum)
+ incr lineNum
+ }
+
+ close $fileId
+}
+
+proc convertTestLine {currentLine len lineNum srcLineNum} {
+
+ regsub -all {(?b)\\} $currentLine {\\\\} currentLine
+ set re [lindex $currentLine 0]
+ set flags [lindex $currentLine 1]
+ set str [lindex $currentLine 2]
+
+ # based on flags, decide whether to skip the test
+
+ if {[findSkipFlag $flags]} {
+ regsub -all {\[|\]|\(|\)|\{|\}|\#} $currentLine {\&} line
+ set msg "\# skipping char mapping test from line $srcLineNum\n"
+ append msg "print \{... skip test from line $srcLineNum: $line\}"
+ return $msg
+ }
+
+ # perform mapping if '=' flag exists
+
+ set noBraces 0
+ if {[regexp {=|>} $flags] == 1} {
+ regsub -all {_} $currentLine {\\ } currentLine
+ regsub -all {A} $currentLine {\\007} currentLine
+ regsub -all {B} $currentLine {\\b} currentLine
+ regsub -all {E} $currentLine {\\033} currentLine
+ regsub -all {F} $currentLine {\\f} currentLine
+ regsub -all {N} $currentLine {\\n} currentLine
+
+ # if and \r substitutions are made, do not wrap re, flags,
+ # str, and result in braces
+
+ set noBraces [regsub -all {R} $currentLine {\\\u000D} currentLine]
+ regsub -all {T} $currentLine {\\t} currentLine
+ regsub -all {V} $currentLine {\\v} currentLine
+ if {[regexp {=} $flags] == 1} {
+ set re [lindex $currentLine 0]
+ }
+ set str [lindex $currentLine 2]
+ }
+ set flags [removeFlags $flags]
+
+ # find the test result
+
+ set numVars [expr $len - 3]
+ set vars {}
+ set vals {}
+ set result 0
+ set v 0
+
+ if {[regsub {\*} "$flags" "" newFlags] == 1} {
+ # an error is expected
+
+ if {[string compare $str "EMPTY"] == 0} {
+ # empty regexp is not an error
+ # skip this test
+
+ return "\# skipping the empty-re test from line $srcLineNum\n"
+ }
+ set flags $newFlags
+ set result "\{1 \{[convertErrCode $str]\}\}"
+ } elseif {$numVars > 0} {
+ # at least 1 match is made
+
+ if {[regexp {s} $flags] == 1} {
+ set result "\{0 1\}"
+ } else {
+ while {$v < $numVars} {
+ append vars " var($v)"
+ append vals " \$var($v)"
+ incr v
+ }
+ set tmp [removeAts [lrange $currentLine 3 $len]]
+ set result "\{0 \{1 $tmp\}\}"
+ if {$noBraces} {
+ set result "\[subst $result\]"
+ }
+ }
+ } else {
+ # no match is made
+
+ set result "\{0 0\}"
+ }
+
+ # set up the test and write it to the output file
+
+ set cmd [prepareCmd $flags $re $str $vars $noBraces]
+ if {$cmd == -1} {
+ return "\# skipping test with metasyntax from line $srcLineNum\n"
+ }
+
+ set test "test regexp-1.$srcLineNum \{converted from line $srcLineNum\} \{\n"
+ append test "\tcatch {unset var}\n"
+ append test "\tlist \[catch \{ \n"
+ append test "\t\tset match \[$cmd\] \n"
+ append test "\t\tlist \$match $vals \n"
+ append test "\t\} msg\] \$msg \n"
+ append test "\} $result \n"
+ return $test
+}
+
diff --git a/tcl/tools/tcl.hpj.in b/tcl/tools/tcl.hpj.in
new file mode 100644
index 00000000000..3400816b9ef
--- /dev/null
+++ b/tcl/tools/tcl.hpj.in
@@ -0,0 +1,19 @@
+; This file is maintained by HCW. Do not modify this file directly.
+
+[OPTIONS]
+HCW=0
+LCID=0x409 0x0 0x0 ;English (United States)
+REPORT=Yes
+TITLE=Tcl/Tk Reference Manual
+CNT=tcl83.cnt
+COPYRIGHT=Copyright © 1999 Scriptics Corporation
+HLP=tcl83.hlp
+
+[FILES]
+tcl.rtf
+
+[WINDOWS]
+main="Tcl/Tk Reference Manual",,0
+
+[CONFIG]
+BrowseButtons()
diff --git a/tcl/tools/tcl.wse.in b/tcl/tools/tcl.wse.in
new file mode 100644
index 00000000000..9ca4b0f9fc6
--- /dev/null
+++ b/tcl/tools/tcl.wse.in
@@ -0,0 +1,2356 @@
+Document Type: WSE
+item: Global
+ Version=6.01
+ Title=Tcl 8.3 for Windows Installation
+ Flags=00010100
+ Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ Japanese Font Name=MS Gothic
+ Japanese Font Size=10
+ Start Gradient=0 0 255
+ End Gradient=0 0 0
+ Windows Flags=00000000000000010010110000001000
+ Log Pathname=%MAINDIR%\INSTALL.LOG
+ Message Font=MS Sans Serif
+ Font Size=8
+ Disk Label=tcl8.3.2
+ Disk Filename=setup
+ Patch Flags=0000000000000001
+ Patch Threshold=85
+ Patch Memory=4000
+ Variable Name1=_SYS_
+ Variable Default1=C:\WINDOWS\SYSTEM
+ Variable Flags1=00001000
+ Variable Name2=_ODBC16_
+ Variable Default2=C:\WINDOWS\SYSTEM
+ Variable Flags2=00001000
+ Variable Name3=_WISE_
+ Variable Default3=${__WISE__}
+ Variable Flags3=00001000
+end
+item: Open/Close INSTALL.LOG
+ Flags=00000001
+end
+item: Check if File/Dir Exists
+ Pathname=%SYS%
+ Flags=10000100
+end
+item: Set Variable
+ Variable=SYS
+ Value=%WIN%
+end
+item: End Block
+end
+item: Set Variable
+ Variable=VER
+ Value=8.3
+end
+item: Set Variable
+ Variable=PATCHLEVEL
+ Value=${__TCL_PATCH_LEVEL__}
+end
+item: Set Variable
+ Variable=APPTITLE
+ Value=Tcl/Tk %PATCHLEVEL% for Windows
+end
+item: Set Variable
+ Variable=URL
+ Value=http://dev.scriptics.com/registration/%PATCHLEVEL%.html
+end
+item: Set Variable
+ Variable=GROUP
+ Value=Tcl
+end
+item: Set Variable
+ Variable=DISABLED
+ Value=!
+end
+item: Set Variable
+ Variable=MAINDIR
+ Value=Tcl
+end
+item: Check Configuration
+ Flags=10111011
+end
+item: Get Registry Key Value
+ Variable=PROGRAM_FILES
+ Key=SOFTWARE\Microsoft\Windows\CurrentVersion
+ Default=C:\Program Files
+ Value Name=ProgramFilesDir
+ Flags=00000100
+end
+item: Set Variable
+ Variable=MAINDIR
+ Value=%PROGRAM_FILES%\%MAINDIR%
+end
+item: Set Variable
+ Variable=EXPLORER
+ Value=1
+end
+item: Else Statement
+end
+item: Set Variable
+ Variable=MAINDIR
+ Value=C:\%MAINDIR%
+end
+item: End Block
+end
+item: Set Variable
+ Variable=BACKUP
+ Value=%MAINDIR%\BACKUP
+end
+item: Set Variable
+ Variable=DOBACKUP
+ Value=B
+end
+item: Set Variable
+ Variable=BRANDING
+ Value=0
+end
+remarked item: If/While Statement
+ Variable=BRANDING
+ Value=1
+end
+remarked item: Read INI Value
+ Variable=NAME
+ Pathname=%INST%\CUSTDATA.INI
+ Section=Registration
+ Item=Name
+end
+remarked item: Read INI Value
+ Variable=COMPANY
+ Pathname=%INST%\CUSTDATA.INI
+ Section=Registration
+ Item=Company
+end
+remarked item: If/While Statement
+ Variable=NAME
+end
+remarked item: Set Variable
+ Variable=DOBRAND
+ Value=1
+end
+remarked item: End Block
+end
+remarked item: End Block
+end
+item: Set Variable
+ Variable=TYPE
+ Value=C
+end
+item: Set Variable
+ Variable=COMPONENTS
+ Value=ABC
+end
+item: Wizard Block
+ Direction Variable=DIRECTION
+ Display Variable=DISPLAY
+ X Position=0
+ Y Position=0
+ Filler Color=8421440
+ Flags=00000001
+end
+item: Custom Dialog Set
+ Name=Splash
+ Display Variable=DISPLAY
+ item: Dialog
+ Title=%APPTITLE% Installation
+ Title French=Bienvenue
+ Title German=Willkommen
+ Title Portuguese=Bem-vindo
+ Title Spanish=Bienvenido
+ Title Italian=Benvenuto
+ Title Danish=Velkommen
+ Title Dutch=Welkom
+ Title Norwegian=Velkommen
+ Title Swedish=Välkommen
+ Width=273
+ Height=250
+ Font Name=Helv
+ Font Size=8
+ item: Push Button
+ Rectangle=166 214 208 228
+ Variable=DIRECTION
+ Value=N
+ Create Flags=01010000000000010000000000000001
+ Text=&Next >
+ end
+ item: Push Button
+ Rectangle=212 214 254 228
+ Action=3
+ Create Flags=01010000000000010000000000000000
+ Text=Cancel
+ end
+ item: Static
+ Rectangle=0 0 268 233
+ Action=2
+ Enabled Color=00000000000000001111111111111111
+ Create Flags=01010000000000000000000000001011
+ Pathname=${__TCLBASEDIR__}\tools\white.bmp
+ end
+ item: Static
+ Rectangle=5 5 268 215
+ Destination Dialog=1
+ Action=2
+ Enabled Color=00000000000000001111111111111111
+ Create Flags=01010000000000000000000000001011
+ Pathname=${__TCLBASEDIR__}\tools\tclSplash.bmp
+ end
+ end
+end
+item: End Block
+end
+item: Wizard Block
+ Direction Variable=DIRECTION
+ Display Variable=DISPLAY
+ Bitmap Pathname=%_WISE_%\DIALOGS\TEMPLATE\WIZARD.BMP
+ X Position=9
+ Y Position=10
+ Filler Color=8421440
+ Dialog=Welcome
+ Dialog=Select Destination Directory
+ Dialog=Select Installation Type
+ Dialog=Select Components
+ Dialog=Select Program Manager Group
+ Variable=
+ Variable=
+ Variable=
+ Variable=TYPE
+ Variable=EXPLORER
+ Value=
+ Value=
+ Value=
+ Value=C
+ Value=1
+ Compare=0
+ Compare=0
+ Compare=0
+ Compare=1
+ Compare=0
+ Flags=00000011
+end
+item: Custom Dialog Set
+ Name=Welcome
+ Display Variable=DISPLAY
+ item: Dialog
+ Title=%APPTITLE% Installation
+ Title French=Installation de %APPTITLE%
+ Title German=Installation von %APPTITLE%
+ Title Spanish=Instalación de %APPTITLE%
+ Title Italian=Installazione di %APPTITLE%
+ Width=271
+ Height=224
+ Font Name=Helv
+ Font Size=8
+ item: Static
+ Rectangle=86 8 258 42
+ Create Flags=01010000000000000000000000000000
+ Flags=0000000000000001
+ Name=Times New Roman
+ Font Style=-24 0 0 0 700 255 0 0 0 3 2 1 18
+ Text=Welcome!
+ Text French=Bienvenue !
+ Text German=Willkommen!
+ Text Spanish=¡Bienvenido!
+ Text Italian=Benvenuti!
+ end
+ item: Push Button
+ Rectangle=150 187 195 202
+ Variable=DIRECTION
+ Value=N
+ Create Flags=01010000000000010000000000000001
+ Text=&Next >
+ Text French=&Suite >
+ Text German=&Weiter >
+ Text Spanish=&Siguiente >
+ Text Italian=&Avanti >
+ end
+ item: Push Button
+ Rectangle=105 187 150 202
+ Variable=DISABLED
+ Value=!
+ Create Flags=01010000000000010000000000000000
+ Text=< &Back
+ Text French=< &Retour
+ Text German=< &Zurück
+ Text Spanish=< &Atrás
+ Text Italian=< &Indietro
+ end
+ item: Push Button
+ Rectangle=211 187 256 202
+ Action=3
+ Create Flags=01010000000000010000000000000000
+ Text=&Cancel
+ Text French=&Annuler
+ Text German=&Abbrechen
+ Text Spanish=&Cancelar
+ Text Italian=&Annulla
+ end
+ item: Static
+ Rectangle=85 41 255 130
+ Create Flags=01010000000000000000000000000000
+ Text=This installation program will install %APPTITLE%.
+ Text=
+ Text=Press the Next button to start the installation. You can press the Exit Setup button now if you do not want to install %APPTITLE% at this time.
+ Text=
+ Text=It is strongly recommended that you exit all Windows programs before running this installation program.
+ Text French=Ce programme d'installation va installer %APPTITLE%.
+ Text French=
+ Text French=Cliquez sur le bouton Suite pour démarrer l'installation. Vous pouvez cliquer sur le bouton Quitter l'installation si vous ne voulez pas installer %APPTITLE% tout de suite.
+ Text German=Mit diesem Installationsprogramm wird %APPTITLE% installiert.
+ Text German=
+ Text German=Klicken Sie auf "Weiter", um mit der Installation zu beginnen. Klicken Sie auf "Abbrechen", um die Installation von %APPTITLE% abzubrechen.
+ Text Spanish=Este programa de instalación instalará %APPTITLE%.
+ Text Spanish=
+ Text Spanish=Presione el botón Siguiente para iniciar la instalación. Puede presionar el botón Salir de instalación si no desea instalar %APPTITLE% en este momento.
+ Text Italian=Questo programma installerà %APPTITLE%.
+ Text Italian=
+ Text Italian=Per avvviare l'installazione premere il pulsante Avanti. Se non si desidera installare %APPTITLE% ora, premere il pulsante Esci dall'installazione.
+ end
+ item: Static
+ Rectangle=8 180 256 181
+ Action=3
+ Create Flags=01010000000000000000000000000111
+ end
+ end
+end
+item: Custom Dialog Set
+ Name=Select Destination Directory
+ Display Variable=DISPLAY
+ item: Dialog
+ Title=%APPTITLE% Installation
+ Title French=Installation de %APPTITLE%
+ Title German=Installation von %APPTITLE%
+ Title Spanish=Instalación de %APPTITLE%
+ Title Italian=Installazione di %APPTITLE%
+ Width=271
+ Height=224
+ Font Name=Helv
+ Font Size=8
+ item: Push Button
+ Rectangle=150 187 195 202
+ Variable=DIRECTION
+ Value=N
+ Create Flags=01010000000000010000000000000001
+ Text=&Next >
+ Text French=&Suite >
+ Text German=&Weiter >
+ Text Spanish=&Siguiente >
+ Text Italian=&Avanti >
+ end
+ item: Push Button
+ Rectangle=105 187 150 202
+ Variable=DIRECTION
+ Value=B
+ Create Flags=01010000000000010000000000000000
+ Flags=0000000000000001
+ Text=< &Back
+ Text French=< &Retour
+ Text German=< &Zurück
+ Text Spanish=< &Atrás
+ Text Italian=< &Indietro
+ end
+ item: Push Button
+ Rectangle=211 187 256 202
+ Action=3
+ Create Flags=01010000000000010000000000000000
+ Text=&Cancel
+ Text French=&Annuler
+ Text German=&Abbrechen
+ Text Spanish=&Cancelar
+ Text Italian=&Annulla
+ end
+ item: Static
+ Rectangle=8 180 256 181
+ Action=3
+ Create Flags=01010000000000000000000000000111
+ end
+ item: Static
+ Rectangle=86 8 258 42
+ Create Flags=01010000000000000000000000000000
+ Flags=0000000000000001
+ Name=Times New Roman
+ Font Style=-24 0 0 0 700 255 0 0 0 3 2 1 18
+ Text=Select Destination Directory
+ Text French=Sélectionner le répertoire de destination
+ Text German=Zielverzeichnis wählen
+ Text Spanish=Seleccione el directorio de destino
+ Text Italian=Selezionare Directory di destinazione
+ end
+ item: Static
+ Rectangle=86 39 256 114
+ Create Flags=01010000000000000000000000000000
+ Text=Please select the directory where the %APPTITLE% files are to be installed.
+ Text=
+ Text=To install in the default directory below, click Next.
+ Text=
+ Text=To install in a different directory, click Browse and select another directory.
+ Text French=Veuillez sélectionner le répertoire dans lequel les fichiers %APPTITLE% doivent être installés.
+ Text German=Geben Sie an, in welchem Verzeichnis die %APPTITLE%-Dateien installiert werden sollen.
+ Text Spanish=Por favor seleccione el directorio donde desee instalar los archivos de %APPTITLE%.
+ Text Italian=Selezionare la directory dove verranno installati i file %APPTITLE%.
+ end
+ item: Static
+ Rectangle=86 130 256 157
+ Action=1
+ Create Flags=01010000000000000000000000000111
+ end
+ item: Push Button
+ Rectangle=205 138 250 153
+ Variable=MAINDIR_SAVE
+ Value=%MAINDIR%
+ Destination Dialog=1
+ Action=2
+ Create Flags=01010000000000010000000000000000
+ Text=Browse
+ Text French=Parcourir
+ Text German=Durchsuchen
+ Text Spanish=Buscar
+ Text Italian=Sfoglie
+ end
+ item: Static
+ Rectangle=91 140 198 151
+ Create Flags=01010000000000000000000000000000
+ Text=%MAINDIR%
+ Text French=%MAINDIR%
+ Text German=%MAINDIR%
+ Text Spanish=%MAINDIR%
+ Text Italian=%MAINDIR%
+ end
+ end
+ item: Dialog
+ Title=Select Destination Directory
+ Title French=Sélectionner le répertoire de destination
+ Title German=Zielverzeichnis wählen
+ Title Spanish=Seleccione el directorio de destino
+ Title Italian=Selezionare Directory di destinazione
+ Width=221
+ Height=173
+ Font Name=Helv
+ Font Size=8
+ item: Listbox
+ Rectangle=5 5 163 149
+ Variable=MAINDIR
+ Create Flags=01010000100000010000000101000000
+ Flags=0000110000100010
+ Text=%MAINDIR%
+ Text French=%MAINDIR%
+ Text German=%MAINDIR%
+ Text Spanish=%MAINDIR%
+ Text Italian=%MAINDIR%
+ end
+ item: Push Button
+ Rectangle=167 6 212 21
+ Create Flags=01010000000000010000000000000001
+ Text=OK
+ Text French=OK
+ Text German=OK
+ Text Spanish=Aceptar
+ Text Italian=OK
+ end
+ item: Push Button
+ Rectangle=167 25 212 40
+ Variable=MAINDIR
+ Value=%MAINDIR_SAVE%
+ Create Flags=01010000000000010000000000000000
+ Flags=0000000000000001
+ Text=Cancel
+ Text French=Annuler
+ Text German=Abbrechen
+ Text Spanish=Cancelar
+ Text Italian=Annulla
+ end
+ end
+end
+remarked item: Custom Dialog Set
+ Name=Select Installation Type
+ Display Variable=DISPLAY
+ item: Dialog
+ Title=%APPTITLE% Installation
+ Title French=Installation de %APPTITLE%
+ Title German=Installation von %APPTITLE%
+ Title Spanish=Instalación de %APPTITLE%
+ Title Italian=Installazione di %APPTITLE%
+ Width=271
+ Height=224
+ Font Name=Helv
+ Font Size=8
+ item: Push Button
+ Rectangle=150 187 195 202
+ Variable=DIRECTION
+ Value=N
+ Create Flags=01010000000000010000000000000001
+ Text=&Next >
+ Text French=&Suite >
+ Text German=&Weiter >
+ Text Spanish=&Siguiente >
+ Text Italian=&Avanti >
+ end
+ item: Push Button
+ Rectangle=105 187 150 202
+ Variable=DIRECTION
+ Value=B
+ Create Flags=01010000000000010000000000000000
+ Text=< &Back
+ Text French=< &Retour
+ Text German=< &Zurück
+ Text Spanish=< &Atrás
+ Text Italian=< &Indietro
+ end
+ item: Push Button
+ Rectangle=211 187 256 202
+ Action=3
+ Create Flags=01010000000000010000000000000000
+ Text=&Cancel
+ Text French=&Annuler
+ Text German=&Abbrechen
+ Text Spanish=&Cancelar
+ Text Italian=&Annulla
+ end
+ item: Static
+ Rectangle=8 180 256 181
+ Action=3
+ Create Flags=01010000000000000000000000000111
+ end
+ item: Static
+ Rectangle=86 8 258 42
+ Create Flags=01010000000000000000000000000000
+ Flags=0000000000000001
+ Name=Times New Roman
+ Font Style=-24 0 0 0 700 255 0 0 0 3 2 1 18
+ Text=Select Installation Type
+ Text French=Sélectionner les composants
+ Text German=Komponenten auswählen
+ Text Spanish=Seleccione componentes
+ Text Italian=Selezionare i componenti
+ end
+ item: Static
+ Rectangle=194 162 242 172
+ Variable=COMPONENTS
+ Value=MAINDIR
+ Create Flags=01010000000000000000000000000010
+ end
+ item: Static
+ Rectangle=194 153 242 162
+ Variable=COMPONENTS
+ Create Flags=01010000000000000000000000000010
+ end
+ item: Static
+ Rectangle=107 153 196 164
+ Create Flags=01010000000000000000000000000000
+ Text=Disk Space Required:
+ Text French=Espace disque requis :
+ Text German=Notwendiger Speicherplatz:
+ Text Spanish=Espacio requerido en el disco:
+ Text Italian=Spazio su disco necessario:
+ end
+ item: Static
+ Rectangle=107 162 196 172
+ Create Flags=01010000000000000000000000000000
+ Text=Disk Space Remaining:
+ Text French=Espace disque disponible :
+ Text German=Verbleibender Speicherplatz:
+ Text Spanish=Espacio en disco disponible:
+ Text Italian=Spazio su disco disponibile:
+ end
+ item: Static
+ Rectangle=86 145 256 175
+ Action=1
+ Create Flags=01010000000000000000000000000111
+ end
+ item: Static
+ Rectangle=86 42 256 61
+ Create Flags=01010000000000000000000000000000
+ Text=Choose which type of installation to perform by selecting one of the buttons below.
+ Text French=Choisissez les composants que vous voulez installer en cochant les cases ci-dessous.
+ Text German=Wählen Sie die zu installierenden Komponenten, indem Sie in die entsprechenden Kästchen klicken.
+ Text Spanish=Elija los componentes que desee instalar marcando los cuadros de abajo.
+ Text Italian=Scegliere quali componenti installare selezionando le caselle sottostanti.
+ end
+ item: Radio Button
+ Rectangle=86 74 256 128
+ Variable=TYPE
+ Create Flags=01010000000000010000000000001001
+ Text=&Full Installation (Recommended)
+ Text=&Minimal Installation
+ Text=C&ustom Installation
+ Text=
+ end
+ end
+end
+item: Custom Dialog Set
+ Name=Select Components
+ Display Variable=DISPLAY
+ item: Dialog
+ Title=%APPTITLE% Installation
+ Title French=Installation de %APPTITLE%
+ Title German=Installation von %APPTITLE%
+ Title Spanish=Instalación de %APPTITLE%
+ Title Italian=Installazione di %APPTITLE%
+ Width=271
+ Height=224
+ Font Name=Helv
+ Font Size=8
+ item: Push Button
+ Rectangle=150 187 195 202
+ Variable=DIRECTION
+ Value=N
+ Create Flags=01010000000000010000000000000001
+ Text=&Next >
+ Text French=&Suite >
+ Text German=&Weiter >
+ Text Spanish=&Siguiente >
+ Text Italian=&Avanti >
+ end
+ item: Push Button
+ Rectangle=105 187 150 202
+ Variable=DIRECTION
+ Value=B
+ Create Flags=01010000000000010000000000000000
+ Text=< &Back
+ Text French=< &Retour
+ Text German=< &Zurück
+ Text Spanish=< &Atrás
+ Text Italian=< &Indietro
+ end
+ item: Push Button
+ Rectangle=211 187 256 202
+ Action=3
+ Create Flags=01010000000000010000000000000000
+ Text=&Cancel
+ Text French=&Annuler
+ Text German=&Abbrechen
+ Text Spanish=&Cancelar
+ Text Italian=&Annulla
+ end
+ item: Static
+ Rectangle=8 180 256 181
+ Action=3
+ Create Flags=01010000000000000000000000000111
+ end
+ item: Static
+ Rectangle=86 8 258 42
+ Create Flags=01010000000000000000000000000000
+ Flags=0000000000000001
+ Name=Times New Roman
+ Font Style=-24 0 0 0 700 255 0 0 0 3 2 1 18
+ Text=Select Components
+ Text French=Sélectionner les composants
+ Text German=Komponenten auswählen
+ Text Spanish=Seleccione componentes
+ Text Italian=Selezionare i componenti
+ end
+ item: Checkbox
+ Rectangle=86 75 256 129
+ Variable=COMPONENTS
+ Create Flags=01010000000000010000000000000011
+ Flags=0000000000000110
+ Text=Tcl Run-Time Files
+ Text=Example Scripts
+ Text=Help Files
+ Text=Header and Library Files
+ Text=
+ Text French=Tcl Run-Time Files
+ Text French=Example Scripts
+ Text French=Help Files
+ Text French=Header and Library Files
+ Text French=
+ Text German=Tcl Run-Time Files
+ Text German=Example Scripts
+ Text German=Help Files
+ Text German=Header and Library Files
+ Text German=
+ Text Spanish=Tcl Run-Time Files
+ Text Spanish=Example Scripts
+ Text Spanish=Help Files
+ Text Spanish=Header and Library Files
+ Text Spanish=
+ Text Italian=Tcl Run-Time Files
+ Text Italian=Example Scripts
+ Text Italian=Help Files
+ Text Italian=Header and Library Files
+ Text Italian=
+ end
+ item: Static
+ Rectangle=194 162 242 172
+ Variable=COMPONENTS
+ Value=MAINDIR
+ Create Flags=01010000000000000000000000000010
+ end
+ item: Static
+ Rectangle=194 153 242 162
+ Variable=COMPONENTS
+ Create Flags=01010000000000000000000000000010
+ end
+ item: Static
+ Rectangle=107 153 196 164
+ Create Flags=01010000000000000000000000000000
+ Text=Disk Space Required:
+ Text French=Espace disque requis :
+ Text German=Notwendiger Speicherplatz:
+ Text Spanish=Espacio requerido en el disco:
+ Text Italian=Spazio su disco necessario:
+ end
+ item: Static
+ Rectangle=107 162 196 172
+ Create Flags=01010000000000000000000000000000
+ Text=Disk Space Remaining:
+ Text French=Espace disque disponible :
+ Text German=Verbleibender Speicherplatz:
+ Text Spanish=Espacio en disco disponible:
+ Text Italian=Spazio su disco disponibile:
+ end
+ item: Static
+ Rectangle=86 145 256 175
+ Action=1
+ Create Flags=01010000000000000000000000000111
+ end
+ item: Static
+ Rectangle=86 42 256 61
+ Create Flags=01010000000000000000000000000000
+ Text=Choose which components to install by checking the boxes below.
+ Text French=Choisissez les composants que vous voulez installer en cochant les cases ci-dessous.
+ Text German=Wählen Sie die zu installierenden Komponenten, indem Sie in die entsprechenden Kästchen klicken.
+ Text Spanish=Elija los componentes que desee instalar marcando los cuadros de abajo.
+ Text Italian=Scegliere quali componenti installare selezionando le caselle sottostanti.
+ end
+ end
+end
+item: Custom Dialog Set
+ Name=Select Program Manager Group
+ Display Variable=DISPLAY
+ item: Dialog
+ Title=%APPTITLE% Installation
+ Title French=Installation de %APPTITLE%
+ Title German=Installation von %APPTITLE%
+ Title Spanish=Instalación de %APPTITLE%
+ Title Italian=Installazione di %APPTITLE%
+ Width=271
+ Height=224
+ Font Name=Helv
+ Font Size=8
+ item: Push Button
+ Rectangle=150 187 195 202
+ Variable=DIRECTION
+ Value=N
+ Create Flags=01010000000000010000000000000001
+ Text=&Next >
+ Text French=&Suite >
+ Text German=&Weiter >
+ Text Spanish=&Siguiente >
+ Text Italian=&Avanti >
+ end
+ item: Push Button
+ Rectangle=105 187 150 202
+ Variable=DIRECTION
+ Value=B
+ Create Flags=01010000000000010000000000000000
+ Flags=0000000000000001
+ Text=< &Back
+ Text French=< &Retour
+ Text German=< &Zurück
+ Text Spanish=< &Atrás
+ Text Italian=< &Indietro
+ end
+ item: Push Button
+ Rectangle=211 187 256 202
+ Action=3
+ Create Flags=01010000000000010000000000000000
+ Text=&Cancel
+ Text French=&Annuler
+ Text German=&Abbrechen
+ Text Spanish=&Cancelar
+ Text Italian=&Annulla
+ end
+ item: Static
+ Rectangle=8 180 256 181
+ Action=3
+ Create Flags=01010000000000000000000000000111
+ end
+ item: Static
+ Rectangle=86 8 258 42
+ Create Flags=01010000000000000000000000000000
+ Flags=0000000000000001
+ Name=Times New Roman
+ Font Style=-24 0 0 0 700 255 0 0 0 3 2 1 18
+ Text=Select ProgMan Group
+ Text French=Sélectionner le groupe du Gestionnaire de programme
+ Text German=Bestimmung der Programm-Managergruppe
+ Text Spanish=Seleccione grupo del Administrador de programas
+ Text Italian=Selezionare il gruppo ProgMan
+ end
+ item: Static
+ Rectangle=86 44 256 68
+ Create Flags=01010000000000000000000000000000
+ Text=Enter the name of the Program Manager group to add the %APPTITLE% icons to:
+ Text French=Entrez le nom du groupe du Gestionnaire de programme dans lequel vous souhaitez ajouter les icônes de %APPTITLE% :
+ Text German=Geben Sie den Namen der Programmgruppe ein, der das Symbol %APPTITLE% hinzugefügt werden soll:
+ Text Spanish=Escriba el nombre del grupo del Administrador de programas en el que desea agregar los iconos de %APPTITLE%:
+ Text Italian=Inserire il nome del gruppo Program Manager per aggiungere le icone %APPTITLE% a:
+ end
+ item: Combobox
+ Rectangle=86 69 256 175
+ Variable=GROUP
+ Create Flags=01010000000000010000001000000001
+ Flags=0000000000000001
+ Text=%GROUP%
+ Text French=%GROUP%
+ Text German=%GROUP%
+ Text Spanish=%GROUP%
+ Text Italian=%GROUP%
+ end
+ end
+end
+item: Custom Dialog Set
+ Name=Start Installation
+ Display Variable=DISPLAY
+ item: Dialog
+ Title=%APPTITLE% Installation
+ Title French=Installation de %APPTITLE%
+ Title German=Installation von %APPTITLE%
+ Title Spanish=Instalación de %APPTITLE%
+ Title Italian=Installazione di %APPTITLE%
+ Width=271
+ Height=224
+ Font Name=Helv
+ Font Size=8
+ item: Push Button
+ Rectangle=150 187 195 202
+ Variable=DIRECTION
+ Value=N
+ Create Flags=01010000000000010000000000000001
+ Text=&Next >
+ Text French=&Suite >
+ Text German=&Weiter >
+ Text Spanish=&Siguiente >
+ Text Italian=&Avanti >
+ end
+ item: Push Button
+ Rectangle=105 187 150 202
+ Variable=DIRECTION
+ Value=B
+ Create Flags=01010000000000010000000000000000
+ Text=< &Back
+ Text French=< &Retour
+ Text German=< &Zurück
+ Text Spanish=< &Atrás
+ Text Italian=< &Indietro
+ end
+ item: Push Button
+ Rectangle=211 187 256 202
+ Action=3
+ Create Flags=01010000000000010000000000000000
+ Text=&Cancel
+ Text French=&Annuler
+ Text German=&Abbrechen
+ Text Spanish=&Cancelar
+ Text Italian=&Annulla
+ end
+ item: Static
+ Rectangle=8 180 256 181
+ Action=3
+ Create Flags=01010000000000000000000000000111
+ end
+ item: Static
+ Rectangle=86 8 258 42
+ Create Flags=01010000000000000000000000000000
+ Flags=0000000000000001
+ Name=Times New Roman
+ Font Style=-24 0 0 0 700 255 0 0 0 3 2 1 18
+ Text=Ready to Install!
+ Text French=Prêt à installer !
+ Text German=Installationsbereit!
+ Text Spanish=¡Preparado para la instalación!
+ Text Italian=Pronto per l'installazione!
+ end
+ item: Static
+ Rectangle=86 42 256 102
+ Create Flags=01010000000000000000000000000000
+ Text=You are now ready to install %APPTITLE%.
+ Text=
+ Text=Press the Next button to begin the installation or the Back button to reenter the installation information.
+ Text French=Vous êtes maintenant prêt à installer les fichiers %APPTITLE%.
+ Text French=
+ Text French=Cliquez sur le bouton Suite pour commencer l'installation ou sur le bouton Retour pour entrer les informations d'installation à nouveau.
+ Text German=Sie können %APPTITLE% nun installieren.
+ Text German=
+ Text German=Klicken Sie auf "Weiter", um mit der Installation zu beginnen. Klicken Sie auf "Zurück", um die Installationsinformationen neu einzugeben.
+ Text Spanish=Ya está listo para instalar %APPTITLE%.
+ Text Spanish=
+ Text Spanish=Presione el botón Siguiente para comenzar la instalación o presione Atrás para volver a ingresar la información para la instalación.
+ Text Italian=Ora è possibile installare %APPTITLE%.
+ Text Italian=
+ Text Italian=Premere il pulsante Avanti per avviare l'installazione o il pulsante Indietro per reinserire le informazioni di installazione.
+ end
+ end
+end
+item: If/While Statement
+ Variable=DISPLAY
+ Value=Select Destination Directory
+end
+item: Set Variable
+ Variable=BACKUP
+ Value=%MAINDIR%\BACKUP
+end
+item: End Block
+end
+item: End Block
+end
+item: If/While Statement
+ Variable=TYPE
+ Value=B
+end
+item: Set Variable
+ Variable=COMPONENTS
+ Value=A
+end
+item: End Block
+end
+item: If/While Statement
+ Variable=DOBACKUP
+ Value=A
+end
+item: Set Variable
+ Variable=BACKUPDIR
+ Value=%BACKUP%
+end
+item: End Block
+end
+remarked item: If/While Statement
+ Variable=BRANDING
+ Value=1
+end
+remarked item: If/While Statement
+ Variable=DOBRAND
+ Value=1
+end
+remarked item: Edit INI File
+ Pathname=%INST%\CUSTDATA.INI
+ Settings=[Registration]
+ Settings=NAME=%NAME%
+ Settings=COMPANY=%COMPANY%
+ Settings=
+end
+remarked item: End Block
+end
+remarked item: End Block
+end
+item: Set Variable
+ Variable=MAINDIRSHORT
+ Value=%MAINDIR%
+ Flags=00010100
+end
+item: Open/Close INSTALL.LOG
+end
+item: Check Disk Space
+ Component=COMPONENTS
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\license.txt
+ Destination=%MAINDIR%\license.txt
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\win\Readme.txt
+ Destination=%MAINDIR%\Readme.txt
+ Flags=0000000000000010
+end
+item: If/While Statement
+ Variable=COMPONENTS
+ Value=D
+ Flags=00001010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\win\release\tk83.lib
+ Destination=%MAINDIR%\lib\tk83.lib
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\win\release\tkstub83.lib
+ Destination=%MAINDIR%\lib\tkstub83.lib
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\win\release\tcl83.lib
+ Destination=%MAINDIR%\lib\tcl83.lib
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\win\release\tclstub83.lib
+ Destination=%MAINDIR%\lib\tclstub83.lib
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\xlib\X11\Xutil.h
+ Destination=%MAINDIR%\include\X11\Xutil.h
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\xlib\X11\Xlib.h
+ Destination=%MAINDIR%\include\X11\Xlib.h
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\xlib\X11\Xfuncproto.h
+ Destination=%MAINDIR%\include\X11\Xfuncproto.h
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\xlib\X11\Xatom.h
+ Destination=%MAINDIR%\include\X11\Xatom.h
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\xlib\X11\X.h
+ Destination=%MAINDIR%\include\X11\X.h
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\xlib\X11\keysymdef.h
+ Destination=%MAINDIR%\include\X11\keysymdef.h
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\xlib\X11\keysym.h
+ Destination=%MAINDIR%\include\X11\keysym.h
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\xlib\X11\cursorfont.h
+ Destination=%MAINDIR%\include\X11\cursorfont.h
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\generic\tk.h
+ Destination=%MAINDIR%\include\tk.h
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\generic\tkDecls.h
+ Destination=%MAINDIR%\include\tkDecls.h
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\generic\tkIntXlibDecls.h
+ Destination=%MAINDIR%\include\tkIntXlibDecls.h
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\generic\tcl.h
+ Destination=%MAINDIR%\include\tcl.h
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\generic\tclDecls.h
+ Destination=%MAINDIR%\include\tclDecls.h
+ Flags=0000000000000010
+end
+item: End Block
+end
+item: If/While Statement
+ Variable=COMPONENTS
+ Value=A
+ Flags=00001010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\msgcat1.0\pkgIndex.tcl
+ Destination=%MAINDIR%\lib\tcl%VER%\msgcat1.0\pkgIndex.tcl
+ Flags=0000000010000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\msgcat1.0\msgcat.tcl
+ Destination=%MAINDIR%\lib\tcl%VER%\msgcat1.0\msgcat.tcl
+ Flags=0000000010000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\tcltest1.0\pkgIndex.tcl
+ Destination=%MAINDIR%\lib\tcl%VER%\tcltest1.0\pkgIndex.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\tcltest1.0\tcltest.tcl
+ Destination=%MAINDIR%\lib\tcl%VER%\tcltest1.0\tcltest.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\symbol.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\symbol.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\shiftjis.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\shiftjis.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\macUkraine.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\macUkraine.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\macTurkish.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\macTurkish.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\macThai.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\macThai.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\macRomania.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\macRomania.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\macRoman.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\macRoman.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\macJapan.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\macJapan.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\macIceland.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\macIceland.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\macGreek.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\macGreek.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\macDingbats.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\macDingbats.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\macCyrillic.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\macCyrillic.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\macCroatian.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\macCroatian.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\macCentEuro.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\macCentEuro.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\ksc5601.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\ksc5601.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\koi8-r.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\koi8-r.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\jis0212.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\jis0212.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\jis0208.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\jis0208.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\jis0201.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\jis0201.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\iso8859-9.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\iso8859-9.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\iso8859-8.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\iso8859-8.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\iso8859-7.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\iso8859-7.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\iso8859-6.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\iso8859-6.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\iso8859-5.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\iso8859-5.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\iso8859-4.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\iso8859-4.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\iso8859-3.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\iso8859-3.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\iso8859-2.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\iso8859-2.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\iso8859-1.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\iso8859-1.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\iso2022.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\iso2022.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\iso2022-kr.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\iso2022-kr.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\iso2022-jp.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\iso2022-jp.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\gb2312.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\gb2312.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\gb1988.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\gb1988.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\gb12345.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\gb12345.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\euc-cn.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\euc-cn.enc
+ Flags=0000000010000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\euc-jp.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\euc-jp.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\euc-kr.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\euc-kr.enc
+ Flags=0000000010000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\dingbats.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\dingbats.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp950.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp950.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp949.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp949.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp936.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp936.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp932.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp932.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp874.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp874.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp869.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp869.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp866.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp866.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp865.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp865.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp864.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp864.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp863.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp863.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp862.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp862.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp861.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp861.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp860.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp860.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp857.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp857.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp855.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp855.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp852.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp852.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp850.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp850.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp775.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp775.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp737.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp737.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp437.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp437.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp1258.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp1258.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp1257.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp1257.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp1256.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp1256.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp1255.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp1255.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp1254.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp1254.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp1253.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp1253.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp1252.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp1252.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp1251.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp1251.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\cp1250.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\cp1250.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\ascii.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\ascii.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\encoding\big5.enc
+ Destination=%MAINDIR%\lib\tcl%VER%\encoding\big5.enc
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\opt0.4\pkgIndex.tcl
+ Destination=%MAINDIR%\lib\tcl%VER%\opt0.4\pkgIndex.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\opt0.4\optparse.tcl
+ Destination=%MAINDIR%\lib\tcl%VER%\opt0.4\optparse.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\http2.3\pkgIndex.tcl
+ Destination=%MAINDIR%\lib\tcl%VER%\http2.3\pkgIndex.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\http2.3\http.tcl
+ Destination=%MAINDIR%\lib\tcl%VER%\http2.3\http.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\msgbox.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\msgbox.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\optMenu.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\optMenu.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\clrpick.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\clrpick.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\entry.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\entry.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\comdlg.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\comdlg.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\bgerror.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\bgerror.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\obsolete.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\obsolete.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\button.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\button.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\xmfbox.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\xmfbox.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\console.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\console.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\listbox.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\listbox.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\menu.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\menu.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\dialog.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\dialog.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\focus.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\focus.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\palette.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\palette.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\tkfbox.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\tkfbox.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\tk.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\tk.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\text.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\text.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\tearoff.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\tearoff.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\tclIndex
+ Destination=%MAINDIR%\lib\tk%VER%\tclIndex
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\scrlbar.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\scrlbar.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\scale.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\scale.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\safetk.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\safetk.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\http1.0\pkgIndex.tcl
+ Destination=%MAINDIR%\lib\tcl%VER%\http1.0\pkgIndex.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\http1.0\http.tcl
+ Destination=%MAINDIR%\lib\tcl%VER%\http1.0\http.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\reg1.0\pkgIndex.tcl
+ Destination=%MAINDIR%\lib\tcl%VER%\reg1.0\pkgIndex.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\win\release\tclreg83.dll
+ Destination=%MAINDIR%\lib\tcl%VER%\reg1.0\tclreg83.dll
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\dde1.1\pkgIndex.tcl
+ Destination=%MAINDIR%\lib\tcl%VER%\dde1.1\pkgIndex.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\win\release\tcldde83.dll
+ Destination=%MAINDIR%\lib\tcl%VER%\dde1.1\tcldde83.dll
+ Flags=0000000000000010
+end
+item: Install File
+ Source=C:\WINNT\SYSTEM32\Msvcrt.dll
+ Destination=%MAINDIR%\bin\msvcrt.dll
+ Flags=0010001000000011
+end
+item: Install File
+ Source=${__TKBASEDIR__}\win\release\wish83.exe
+ Destination=%MAINDIR%\bin\wish83.exe
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\win\release\tclsh83.exe
+ Destination=%MAINDIR%\bin\tclsh83.exe
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\win\release\tclpip83.dll
+ Destination=%MAINDIR%\bin\tclpip83.dll
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\win\release\tcl83.dll
+ Destination=%MAINDIR%\bin\tcl83.dll
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\win\release\tk83.dll
+ Destination=%MAINDIR%\bin\tk83.dll
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\auto.tcl
+ Destination=%MAINDIR%\lib\tcl%VER%\auto.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\history.tcl
+ Destination=%MAINDIR%\lib\tcl%VER%\history.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\init.tcl
+ Destination=%MAINDIR%\lib\tcl%VER%\init.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\package.tcl
+ Destination=%MAINDIR%\lib\tcl%VER%\package.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\parray.tcl
+ Destination=%MAINDIR%\lib\tcl%VER%\parray.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\safe.tcl
+ Destination=%MAINDIR%\lib\tcl%VER%\safe.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\tclIndex
+ Destination=%MAINDIR%\lib\tcl%VER%\tclIndex
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\library\word.tcl
+ Destination=%MAINDIR%\lib\tcl%VER%\word.tcl
+ Flags=0000000000000010
+end
+item: End Block
+end
+item: If/While Statement
+ Variable=COMPONENTS
+ Value=B
+ Flags=00001010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\images\tai-ku.gif
+ Destination=%MAINDIR%\lib\tk%VER%\images\tai-ku.gif
+ Flags=0000000010000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\images\teapot.ppm
+ Destination=%MAINDIR%\lib\tk%VER%\demos\images\teapot.ppm
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\images\tcllogo.gif
+ Destination=%MAINDIR%\lib\tk%VER%\demos\images\tcllogo.gif
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\images\pattern.bmp
+ Destination=%MAINDIR%\lib\tk%VER%\demos\images\pattern.bmp
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\images\noletter.bmp
+ Destination=%MAINDIR%\lib\tk%VER%\demos\images\noletter.bmp
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\images\letters.bmp
+ Destination=%MAINDIR%\lib\tk%VER%\demos\images\letters.bmp
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\images\gray25.bmp
+ Destination=%MAINDIR%\lib\tk%VER%\demos\images\gray25.bmp
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\images\flagup.bmp
+ Destination=%MAINDIR%\lib\tk%VER%\demos\images\flagup.bmp
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\images\flagdown.bmp
+ Destination=%MAINDIR%\lib\tk%VER%\demos\images\flagdown.bmp
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\images\face.bmp
+ Destination=%MAINDIR%\lib\tk%VER%\demos\images\face.bmp
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\images\earthris.gif
+ Destination=%MAINDIR%\lib\tk%VER%\demos\images\earthris.gif
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\images\earth.gif
+ Destination=%MAINDIR%\lib\tk%VER%\demos\images\earth.gif
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\vscale.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\vscale.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\twind.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\twind.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\text.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\text.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\style.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\style.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\states.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\states.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\search.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\search.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\sayings.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\sayings.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\ruler.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\ruler.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\radio.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\radio.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\puzzle.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\puzzle.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\plot.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\plot.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\msgbox.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\msgbox.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\menubu.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\menubu.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\menu.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\menu.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\label.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\label.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\items.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\items.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\image2.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\image2.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\image1.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\image1.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\icon.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\icon.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\hscale.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\hscale.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\form.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\form.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\ixset
+ Destination=%MAINDIR%\lib\tk%VER%\demos\ixset.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\rolodex
+ Destination=%MAINDIR%\lib\tk%VER%\demos\rolodex.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\square
+ Destination=%MAINDIR%\lib\tk%VER%\demos\square.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\Readme
+ Destination=%MAINDIR%\lib\tk%VER%\demos\Readme
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\hello
+ Destination=%MAINDIR%\lib\tk%VER%\demos\hello.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\tclIndex
+ Destination=%MAINDIR%\lib\tk%VER%\demos\tclIndex
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\browse
+ Destination=%MAINDIR%\lib\tk%VER%\demos\browse.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\timer
+ Destination=%MAINDIR%\lib\tk%VER%\demos\timer.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\widget
+ Destination=%MAINDIR%\lib\tk%VER%\demos\widget.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\tcolor
+ Destination=%MAINDIR%\lib\tk%VER%\demos\tcolor.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\rmt
+ Destination=%MAINDIR%\lib\tk%VER%\demos\rmt.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\floor.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\floor.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\filebox.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\filebox.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\images\pwrdLogo75.gif
+ Destination=%MAINDIR%\lib\tk%VER%\images\pwrdLogo75.gif
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\images\pwrdLogo200.gif
+ Destination=%MAINDIR%\lib\tk%VER%\images\pwrdLogo200.gif
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\images\pwrdLogo175.gif
+ Destination=%MAINDIR%\lib\tk%VER%\images\pwrdLogo175.gif
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\images\pwrdLogo150.gif
+ Destination=%MAINDIR%\lib\tk%VER%\images\pwrdLogo150.gif
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\images\pwrdLogo100.gif
+ Destination=%MAINDIR%\lib\tk%VER%\images\pwrdLogo100.gif
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\images\logoMed.gif
+ Destination=%MAINDIR%\lib\tk%VER%\images\logoMed.gif
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\images\logoLarge.gif
+ Destination=%MAINDIR%\lib\tk%VER%\images\logoLarge.gif
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\images\logo64.gif
+ Destination=%MAINDIR%\lib\tk%VER%\images\logo64.gif
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\images\logo100.gif
+ Destination=%MAINDIR%\lib\tk%VER%\images\logo100.gif
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\images\Readme
+ Destination=%MAINDIR%\lib\tk%VER%\images\Readme
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\arrow.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\arrow.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\bind.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\bind.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\bitmap.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\bitmap.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\button.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\button.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\check.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\check.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\clrpick.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\clrpick.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\colors.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\colors.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\cscroll.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\cscroll.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\ctext.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\ctext.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\dialog1.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\dialog1.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\dialog2.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\dialog2.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\entry1.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\entry1.tcl
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TKBASEDIR__}\library\demos\entry2.tcl
+ Destination=%MAINDIR%\lib\tk%VER%\demos\entry2.tcl
+ Flags=0000000000000010
+end
+item: End Block
+end
+item: If/While Statement
+ Variable=COMPONENTS
+ Value=C
+ Flags=00001010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\tools\tcl83.cnt
+ Destination=%MAINDIR%\doc\tcl83.cnt
+ Flags=0000000000000010
+end
+item: Install File
+ Source=${__TCLBASEDIR__}\tools\tcl83.hlp
+ Destination=%MAINDIR%\doc\tcl83.hlp
+ Flags=0000000000000010
+end
+item: End Block
+end
+item: Set Variable
+ Variable=MAINDIR
+ Value=%MAINDIR%
+ Flags=00010100
+end
+item: Include Script
+ Pathname=\\pop\tools\1.2\win32-ix86\wise\INCLUDE\uninstal.wse
+end
+item: Check Configuration
+ Flags=10111011
+end
+item: Get Registry Key Value
+ Variable=GROUPDIR
+ Key=Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
+ Default=%WIN%\Start Menu\Programs
+ Value Name=Programs
+ Flags=00000010
+end
+item: Set Variable
+ Variable=GROUP
+ Value=%GROUPDIR%\%GROUP%
+end
+item: If/While Statement
+ Variable=COMPONENTS
+ Value=A
+ Flags=00001010
+end
+item: Create Shortcut
+ Source=%MAINDIR%\bin\wish83.exe
+ Destination=%GROUP%\Wish.lnk
+ Working Directory=%MAINDIR%
+end
+item: End Block
+end
+item: If/While Statement
+ Variable=COMPONENTS
+ Value=A
+ Flags=00001010
+end
+item: Create Shortcut
+ Source=%MAINDIR%\bin\tclsh83.exe
+ Destination=%GROUP%\Tclsh.lnk
+ Working Directory=%MAINDIR%
+ Key Type=1536
+ Flags=00000001
+end
+item: End Block
+end
+item: If/While Statement
+ Variable=COMPONENTS
+ Value=C
+ Flags=00001010
+end
+item: Create Shortcut
+ Source=%MAINDIR%\doc\tcl83.hlp
+ Destination=%GROUP%\Tcl Help.lnk
+ Working Directory=%MAINDIR%
+end
+item: End Block
+end
+item: Create Shortcut
+ Source=%MAINDIR%\Readme.txt
+ Destination=%GROUP%\Readme.lnk
+ Working Directory=%MAINDIR%
+end
+item: If/While Statement
+ Variable=COMPONENTS
+ Value=B
+ Flags=00001010
+end
+item: Create Shortcut
+ Source=%MAINDIR%\lib\tk%VER%\demos\widget.tcl
+ Destination=%GROUP%\Widget Tour.lnk
+ Working Directory=%MAINDIR%
+ Key Type=1536
+ Flags=00000001
+end
+item: End Block
+end
+item: Else Statement
+end
+item: If/While Statement
+ Variable=COMPONENTS
+ Value=B
+ Flags=00001010
+end
+item: Add ProgMan Icon
+ Group=%GROUP%
+ Icon Name=Widget Tour
+ Command Line=%MAINDIR%\lib\tk%VER%\demos\widget.tcl
+ Icon Pathname=%MAINDIR%\bin\wish83.exe
+ Default Directory=%MAINDIR%
+end
+item: End Block
+end
+item: If/While Statement
+ Variable=COMPONENTS
+ Value=C
+ Flags=00001010
+end
+item: Add ProgMan Icon
+ Group=%GROUP%
+ Icon Name=Tcl Help
+ Command Line=%MAINDIR%\doc\tcl83.hlp
+ Default Directory=%MAINDIR%
+end
+item: End Block
+end
+item: Add ProgMan Icon
+ Group=%GROUP%
+ Icon Name=Readme
+ Command Line=%MAINDIR%\Readme.txt
+ Default Directory=%MAINDIR%
+end
+item: If/While Statement
+ Variable=COMPONENTS
+ Value=A
+ Flags=00001010
+end
+item: Add ProgMan Icon
+ Group=%GROUP%
+ Icon Name=Wish
+ Command Line=%MAINDIR%\bin\wish83.exe
+ Default Directory=%MAINDIR%
+end
+item: End Block
+end
+item: If/While Statement
+ Variable=COMPONENTS
+ Value=A
+ Flags=00001010
+end
+item: Add ProgMan Icon
+ Group=%GROUP%
+ Icon Name=Tclsh
+ Command Line=%MAINDIR%\bin\tclsh83.exe
+ Default Directory=%MAINDIR%
+end
+item: End Block
+end
+item: End Block
+end
+item: Self-Register OCXs/DLLs
+ Description=Updating System Configuration, Please Wait...
+end
+item: Edit Registry
+ Total Keys=1
+ Key=SOFTWARE\Scriptics\Tcl\%VER%
+ New Value=%MAINDIR%
+ Value Name=Root
+ Root=2
+end
+item: Edit Registry
+ Total Keys=1
+ Key=TclScript\DefaultIcon
+ New Value=%MAINDIR%\bin\tk83.dll
+end
+item: Edit Registry
+ Total Keys=1
+ Key=.tcl
+ New Value=TclScript
+end
+item: Edit Registry
+ Total Keys=1
+ Key=TclScript
+ New Value=TclScript
+end
+item: Edit Registry
+ Total Keys=1
+ Key=TclScript\shell\open\command
+ New Value=%MAINDIRSHORT%\bin\wish83.exe "%%1" %%*
+end
+item: Edit Registry
+ Total Keys=1
+ Key=TclScript\shell\edit
+ New Value=&Edit
+end
+item: Edit Registry
+ Total Keys=1
+ Key=TclScript\shell\edit\command
+ New Value=notepad "%%1"
+end
+item: Add Directory to Path
+ Directory=%MAINDIR%\bin
+end
+item: Check Configuration
+ Flags=10111011
+end
+item: Set Variable
+ Variable=TO_SCRIPTICS
+ Value=A
+end
+item: Else Statement
+end
+item: Set Variable
+ Variable=TO_SCRIPTICS
+end
+item: End Block
+end
+item: Wizard Block
+ Direction Variable=DIRECTION
+ Display Variable=DISPLAY
+ Bitmap Pathname=%_WISE_%\DIALOGS\TEMPLATE\WIZARD.BMP
+ X Position=9
+ Y Position=10
+ Filler Color=8421440
+ Flags=00000011
+end
+item: Custom Dialog Set
+ Name=Finished
+ Display Variable=DISPLAY
+ item: Dialog
+ Title=%APPTITLE% Installation
+ Title French=Installation de %APPTITLE%
+ Title German=Installation von %APPTITLE%
+ Title Spanish=Instalación de %APPTITLE%
+ Title Italian=Installazione di %APPTITLE%
+ Width=271
+ Height=224
+ Font Name=Helv
+ Font Size=8
+ item: Push Button
+ Rectangle=150 187 195 202
+ Variable=DIRECTION
+ Value=N
+ Create Flags=01010000000000010000000000000001
+ Text=&Finish
+ Text French=&Fin
+ Text German=&Weiter
+ Text Spanish=&Terminar
+ Text Italian=&Fine
+ end
+ item: Push Button
+ Rectangle=105 187 150 202
+ Variable=DISABLED
+ Value=!
+ Create Flags=01010000000000010000000000000000
+ Text=< &Back
+ Text French=< &Retour
+ Text German=< &Zurück
+ Text Spanish=< &Atrás
+ Text Italian=< &Indietro
+ end
+ item: Push Button
+ Rectangle=211 187 256 202
+ Variable=DISABLED
+ Value=!
+ Action=3
+ Create Flags=01010000000000010000000000000000
+ Text=&Cancel
+ Text French=&Annuler
+ Text German=&Abbrechen
+ Text Spanish=&Cancelar
+ Text Italian=&Annulla
+ end
+ item: Static
+ Rectangle=8 180 256 181
+ Action=3
+ Create Flags=01010000000000000000000000000111
+ end
+ item: Static
+ Rectangle=86 8 258 42
+ Create Flags=01010000000000000000000000000000
+ Flags=0000000000000001
+ Name=Times New Roman
+ Font Style=-24 0 0 0 700 255 0 0 0 3 2 1 18
+ Text=Installation Completed!
+ Text French=Installation terminée !
+ Text German=Die Installation ist abgeschlossen!
+ Text Spanish=¡Instalación terminada!
+ Text Italian=Installazione completata!
+ end
+ item: Static
+ Rectangle=86 42 256 153
+ Create Flags=01010000000000000000000000000000
+ Text=%APPTITLE% has been successfully installed.
+ Text=
+ Text=Click the Finish button to exit this installation.
+ Text=
+ Text=You can learn more about Tcl/Tk %VER%, including release notes, updates, tutorials, and more at %URL%. Check the box below to start your web browser and go there now.
+ Text=
+ Text=The installer may ask you to reboot your computer, this is to update your PATH and is not necessary to do immediately.
+ Text French=%APPTITLE% est maintenant installé.
+ Text French=
+ Text French=Cliquez sur le bouton Fin pour quitter l'installation.
+ Text German=%APPTITLE% wurde erfolgreich installiert.
+ Text German=
+ Text German=Klicken Sie auf "Weiter", um die Installation zu beenden.
+ Text Spanish=%APPTITLE% se ha instalado con éxito.
+ Text Spanish=
+ Text Spanish=Presione el botón Terminar para salir de esta instalación.
+ Text Italian=L'installazione %APPTITLE% è stata portata a termine con successo.
+ Text Italian=
+ Text Italian=Premere il pulsante Fine per uscire dall'installazione.
+ end
+ item: Checkbox
+ Rectangle=88 143 245 157
+ Variable=TO_SCRIPTICS
+ Enabled Color=00000000000000001111111111111111
+ Create Flags=01010000000000010000000000000011
+ Text=Show me important information about
+ Text=
+ end
+ item: Static
+ Rectangle=99 156 245 170
+ Enabled Color=00000000000000001111111111111111
+ Create Flags=01010000000000000000000000000000
+ Text=Tcl/Tk %VER% and TclPro
+ end
+ end
+end
+item: End Block
+end
+item: Check Configuration
+ Flags=10111011
+end
+item: If/While Statement
+ Variable=TO_SCRIPTICS
+ Value=A
+ Flags=00000010
+end
+item: Execute Program
+ Command Line=%URL%
+end
+item: End Block
+end
+item: Execute Program
+ Pathname=explorer
+ Command Line=%GROUP%
+end
+item: End Block
+end
diff --git a/tcl/tools/tclSplash.bmp b/tcl/tools/tclSplash.bmp
new file mode 100644
index 00000000000..19e3c4a7c04
--- /dev/null
+++ b/tcl/tools/tclSplash.bmp
Binary files differ
diff --git a/tcl/tools/tcltk-man2html.tcl b/tcl/tools/tcltk-man2html.tcl
new file mode 100755
index 00000000000..3893e55bf75
--- /dev/null
+++ b/tcl/tools/tcltk-man2html.tcl
@@ -0,0 +1,1675 @@
+#!/bin/sh
+# The next line is executed by /bin/sh, but not tcl \
+exec tclsh8.2 "$0" ${1+"$@"}
+
+package require Tcl 8.2
+
+# Convert Ousterhout format man pages into highly crosslinked
+# hypertext.
+#
+# Along the way detect many unmatched font changes and other odd
+# things.
+#
+# Note well, this program is a hack rather than a piece of software
+# engineering. In that sense it's probably a good example of things
+# that a scripting language, like Tcl, can do well. It is offered as
+# an example of how someone might convert a specific set of man pages
+# into hypertext, not as a general solution to the problem. If you
+# try to use this, you'll be very much on your own.
+#
+# Copyright (c) 1995-1997 Roger E. Critchlow Jr
+#
+# The authors hereby grant permission to use, copy, modify, distribute,
+# and license this software and its documentation for any purpose, provided
+# that existing copyright notices are retained in all copies and that this
+# notice is included verbatim in any distributions. No written agreement,
+# license, or royalty fee is required for any of the authorized uses.
+# Modifications to this software may be copyrighted by their authors
+# and need not follow the licensing terms described here, provided that
+# the new terms are clearly indicated on the first page of each file where
+# they apply.
+#
+# IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
+# FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+# ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
+# DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+# THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
+# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
+# IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
+# NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
+# MODIFICATIONS.
+#
+# Revisions:
+# May 15, 1995 - initial release
+# May 16, 1995 - added a back to home link to toplevel table of
+# contents.
+# May 18, 1995 - broke toplevel table of contents into separate
+# pages for each section, and broke long table of contents
+# into a one page for each man page.
+# Mar 10, 1996 - updated for tcl7.5b3/tk4.1b3
+# Apr 14, 1996 - incorporated command line parsing from Tom Tromey,
+# <tromey@creche.cygnus.com> -- thanks Tom.
+# - updated for tcl7.5/tk4.1 final release.
+# - converted to same copyright as the man pages.
+# Sep 14, 1996 - made various modifications for tcl7.6b1/tk4.2b1
+# Oct 18, 1996 - added tcl7.6/tk4.2 to the list of distributions.
+# Oct 22, 1996 - major hacking on indentation code and elsewhere.
+# Mar 4, 1997 -
+# May 28, 1997 - added tcl8.0b1/tk8.0b1 to the list of distributions
+# - cleaned source for tclsh8.0 execution
+# - renamed output files for windoze installation
+# - added spaces to tables
+# Oct 24, 1997 - moved from 8.0b1 to 8.0 release
+#
+
+set Version "0.20"
+
+proc parse_command_line {} {
+ global argv Version
+
+ # These variables determine where the man pages come from and where
+ # the converted pages go to.
+ global tcltkdir tkdir tcldir webdir
+
+ # Set defaults based on original code.
+ set tcltkdir ../..
+ set tkdir {}
+ set tcldir {}
+ set webdir ../html
+
+ # Directory names for Tcl and Tk, in priority order.
+ set tclDirList {tcl8.3 tcl8.2 tcl8.1 tcl8.0 tcl}
+ set tkDirList {tk8.3 tk8.2 tk8.1 tk8.0 tk}
+
+ # Handle arguments a la GNU:
+ # --version
+ # --help
+ # --srcdir=/path
+ # --htmldir=/path
+
+ foreach option $argv {
+ switch -glob -- $option {
+ --version {
+ puts "tcltk-man-html $Version"
+ exit 0
+ }
+
+ --help {
+ puts "usage: tcltk-man-html \[OPTION\] ...\n"
+ puts " --help print this help, then exit"
+ puts " --version print version number, then exit"
+ puts " --srcdir=DIR find tcl and tk source below DIR"
+ puts " --htmldir=DIR put generated HTML in DIR"
+ exit 0
+ }
+
+ --srcdir=* {
+ # length of "--srcdir=" is 9.
+ set tcltkdir [string range $option 9 end]
+ }
+
+ --htmldir=* {
+ # length of "--htmldir=" is 10
+ set webdir [string range $option 10 end]
+ }
+
+ default {
+ puts stderr "tcltk-man-html: unrecognized option -- `$option'"
+ exit 1
+ }
+ }
+ }
+
+ # Find Tcl.
+ foreach dir $tclDirList {
+ if {[file isdirectory $tcltkdir/$dir]} then {
+ set tcldir $dir
+ break
+ }
+ }
+ if {$tcldir == ""} then {
+ puts stderr "tcltk-man-html: couldn't find Tcl below $tcltkdir"
+ exit 1
+ }
+
+ # Find Tk.
+ foreach dir $tkDirList {
+ if {[file isdirectory $tcltkdir/$dir]} then {
+ set tkdir $dir
+ break
+ }
+ }
+ if {$tkdir == ""} then {
+ puts stderr "tcltk-man-html: couldn't find Tk below $tcltkdir"
+ exit 1
+ }
+
+ # the title for the man pages overall
+ global overall_title
+ set overall_title "[capitalize $tcldir]/[capitalize $tkdir] Manual"
+}
+
+proc capitalize {string} {
+ return [string toupper $string 0]
+}
+
+##
+##
+##
+set manual(report-level) 1
+
+proc manerror {msg} {
+ global manual
+ set name {}
+ set subj {}
+ if {[info exists manual(name)]} {
+ set name $manual(name)
+ }
+ if {[info exists manual(section)] && [string length $manual(section)]} {
+ puts stderr "$name: $manual(section): $msg"
+ } else {
+ puts stderr "$name: $msg"
+ }
+}
+
+proc manreport {level msg} {
+ global manual
+ if {$level < $manual(report-level)} {
+ manerror $msg
+ }
+}
+
+proc fatal {msg} {
+ global manual
+ manerror $msg
+ exit 1
+}
+##
+## parsing
+##
+proc unquote arg {
+ return [string map [list \" {}] $arg]
+}
+
+proc parse-directive {line codename restname} {
+ upvar $codename code $restname rest
+ return [regexp {^(\.[.a-zA-Z0-9]*) *(.*)} $line all code rest]
+}
+
+proc process-text {text} {
+ global manual
+ # preprocess text
+ set text [string map [list \
+ {\&} "\t" \
+ {&} {&amp;} \
+ {\\} {&#92;} \
+ {\e} {&#92;} \
+ {\ } {&nbsp;} \
+ {\|} {&nbsp;} \
+ {\0} { } \
+ {\%} {} \
+ "\\\n" "\n" \
+ \" {&quot;} \
+ {<} {&lt;} \
+ {>} {&gt;} \
+ {\(+-} {&#177;} \
+ {\fP} {\fR} \
+ {\.} . \
+ ] $text]
+ regsub -all {\\o'o\^'} $text {\&ocirc;} text; # o-circumflex in re_syntax.n
+ regsub -all {\\-\\\|\\-} $text -- text; # two hyphens
+ regsub -all -- {\\-\\\^\\-} $text -- text; # two hyphens
+ regsub -all {\\-} $text - text; # a hyphen
+ regsub -all "\\\\\n" $text "\\&\#92;\n" text; # backslashed newline
+ while {[regexp {\\} $text]} {
+ # C R
+ if {[regsub {^([^\\]*)\\fC([^\\]*)\\fR(.*)$} $text {\1<TT>\2</TT>\3} text]} continue
+ # B R
+ if {[regsub {^([^\\]*)\\fB([^\\]*)\\fR(.*)$} $text {\1<B>\2</B>\3} text]} continue
+ # B I
+ if {[regsub {^([^\\]*)\\fB([^\\]*)\\fI(.*)$} $text {\1<B>\2</B>\\fI\3} text]} continue
+ # I R
+ if {[regsub {^([^\\]*)\\fI([^\\]*)\\fR(.*)$} $text {\1<I>\2</I>\3} text]} continue
+ # I B
+ if {[regsub {^([^\\]*)\\fI([^\\]*)\\fB(.*)$} $text {\1<I>\2</I>\\fB\3} text]} continue
+ # B B, I I, R R
+ if {[regsub {^([^\\]*)\\fB([^\\]*)\\fB(.*)$} $text {\1\\fB\2\3} ntext]
+ || [regsub {^([^\\]*)\\fI([^\\]*)\\fI(.*)$} $text {\1\\fI\2\3} ntext]
+ || [regsub {^([^\\]*)\\fR([^\\]*)\\fR(.*)$} $text {\1\\fR\2\3} ntext]} {
+ manerror "process-text: impotent font change: $text"
+ set text $ntext
+ continue
+ }
+ # unrecognized
+ manerror "process-text: uncaught backslash: $text"
+ set text [string map [list "\\" "#92;"] $text]
+ }
+ return $text
+}
+##
+## pass 2 text input and matching
+##
+proc open-text {} {
+ global manual
+ set manual(text-length) [llength $manual(text)]
+ set manual(text-pointer) 0
+}
+proc more-text {} {
+ global manual
+ return [expr {$manual(text-pointer) < $manual(text-length)}]
+}
+proc next-text {} {
+ global manual
+ if {[more-text]} {
+ set text [lindex $manual(text) $manual(text-pointer)]
+ incr manual(text-pointer)
+ return $text
+ }
+ manerror "read past end of text"
+ error "fatal"
+}
+proc is-a-directive {line} {
+ return [expr {[string first . $line] == 0}]
+}
+proc split-directive {line opname restname} {
+ upvar $opname op $restname rest
+ set op [string range $line 0 2]
+ set rest [string trim [string range $line 3 end]]
+}
+proc next-op-is {op restname} {
+ global manual
+ upvar $restname rest
+ if {[more-text]} {
+ set text [lindex $manual(text) $manual(text-pointer)]
+ if {[string equal -length 3 $text $op]} {
+ set rest [string range $text 4 end]
+ incr manual(text-pointer)
+ return 1
+ }
+ }
+ return 0
+}
+proc backup-text {n} {
+ global manual
+ if {$manual(text-pointer)-$n >= 0} {
+ incr manual(text-pointer) -$n
+ }
+}
+proc match-text args {
+ global manual
+ set nargs [llength $args]
+ if {$manual(text-pointer) + $nargs > $manual(text-length)} {
+ return 0
+ }
+ set nback 0
+ foreach arg $args {
+ if {![more-text]} {
+ backup-text $nback
+ return 0
+ }
+ set arg [string trim $arg]
+ set targ [string trim [lindex $manual(text) $manual(text-pointer)]]
+ if {[string equal $arg $targ]} {
+ incr nback
+ incr manual(text-pointer)
+ continue
+ }
+ if {[regexp {^@([_a-zA-Z0-9]+)$} $arg all name]} {
+ upvar $name var
+ set var $targ
+ incr nback
+ incr manual(text-pointer)
+ continue
+ }
+ if {[regexp {^(\.[a-zA-Z][a-zA-Z])@([_a-zA-Z0-9]+)$} $arg all op name]\
+ && [string equal $op [lindex $targ 0]]} {
+ upvar $name var
+ set var [lrange $targ 1 end]
+ incr nback
+ incr manual(text-pointer)
+ continue
+ }
+ backup-text $nback
+ return 0
+ }
+ return 1
+}
+proc expand-next-text {n} {
+ global manual
+ return [join [lrange $manual(text) $manual(text-pointer) \
+ [expr {$manual(text-pointer)+$n-1}]] \n\n]
+}
+##
+## pass 2 output
+##
+proc man-puts {text} {
+ global manual
+ lappend manual(output-$manual(wing-file)-$manual(name)) $text
+}
+
+##
+## build hypertext links to tables of contents
+##
+proc long-toc {text} {
+ global manual
+ set here M[incr manual(section-toc-n)]
+ set there L[incr manual(long-toc-n)]
+ lappend manual(section-toc) "<DD><A HREF=\"$manual(name).htm#$here\" NAME=\"$there\">$text</A>"
+ return "<A NAME=\"$here\">$text</A>"
+}
+proc option-toc {name class switch} {
+ global manual
+ if {[string equal $manual(section) "WIDGET-SPECIFIC OPTIONS"]} {
+ # link the defined option into the long table of contents
+ set link [long-toc "$switch, $name, $class"]
+ regsub -- "$switch, $name, $class" $link "$switch" link
+ return $link
+ } elseif {[string equal $manual(name):$manual(section) \
+ "options:DESCRIPTION"]} {
+ # link the defined standard option to the long table of
+ # contents and make a target for the standard option references
+ # from other man pages.
+ set first [lindex $switch 0]
+ set here M$first
+ set there L[incr manual(long-toc-n)]
+ set manual(standard-option-$first) "<A HREF=\"$manual(name).htm#$here\">$switch, $name, $class</A>"
+ lappend manual(section-toc) "<DD><A HREF=\"$manual(name).htm#$here\" NAME=\"$there\">$switch, $name, $class</A>"
+ return "<A NAME=\"$here\">$switch</A>"
+ } else {
+ error "option-toc in $manual(name) section $manual(section)"
+ }
+}
+proc std-option-toc {name} {
+ global manual
+ if {[info exists manual(standard-option-$name)]} {
+ lappend manual(section-toc) <DD>$manual(standard-option-$name)
+ return $manual(standard-option-$name)
+ }
+ set here M[incr manual(section-toc-n)]
+ set there L[incr manual(long-toc-n)]
+ set other M$name
+ lappend manual(section-toc) "<DD><A HREF=\"options.htm#$other\">$name</A>"
+ return "<A HREF=\"options.htm#$other\">$name</A>"
+}
+##
+## process the widget option section
+## in widget and options man pages
+##
+proc output-widget-options {rest} {
+ global manual
+ man-puts <DL>
+ lappend manual(section-toc) <DL>
+ backup-text 1
+ set para {}
+ while {[next-op-is .OP rest]} {
+ switch -exact [llength $rest] {
+ 3 {
+ set switch [lindex $rest 0]
+ set name [lindex $rest 1]
+ set class [lindex $rest 2]
+ }
+ 5 {
+ set switch [lrange $rest 0 2]
+ set name [lindex $rest 3]
+ set class [lindex $rest 4]
+ }
+ default {
+ fatal "bad .OP $rest"
+ }
+ }
+ if {![regexp {^(<.>)([-a-zA-Z0-9 ]+)(</.>)$} $switch all oswitch switch cswitch]} {
+ if {![regexp {^(<.>)([-a-zA-Z0-9 ]+) or ([-a-zA-Z0-9 ]+)(</.>)$} $switch all oswitch switch1 switch2 cswitch]} {
+ error "not Switch: $switch"
+ } else {
+ set switch "$switch1$cswitch or $oswitch$switch2"
+ }
+ }
+ if {![regexp {^(<.>)([a-zA-Z0-9]*)(</.>)$} $name all oname name cname]} {
+ error "not Name: $name"
+ }
+ if {![regexp {^(<.>)([a-zA-Z0-9]*)(</.>)$} $class all oclass class cclass]} {
+ error "not Class: $class"
+ }
+ man-puts "$para<DT>Command-Line Name: $oswitch[option-toc $name $class $switch]$cswitch"
+ man-puts "<DT>Database Name: $oname$name$cname"
+ man-puts "<DT>Database Class: $oclass$class$cclass"
+ man-puts <DD>[next-text]
+ set para <P>
+ }
+ man-puts </DL>
+ lappend manual(section-toc) </DL>
+}
+
+##
+## process .RS lists
+##
+proc output-RS-list {} {
+ global manual
+ if {[next-op-is .IP rest]} {
+ output-IP-list .RS .IP $rest
+ if {[match-text .RE .sp .RS @rest .IP @rest2]} {
+ man-puts <P>$rest
+ output-IP-list .RS .IP $rest2
+ }
+ if {[match-text .RE .sp .RS @rest .RE]} {
+ man-puts <P>$rest
+ return
+ }
+ if {[next-op-is .RE rest]} {
+ return
+ }
+ }
+ man-puts <DL><P><DD>
+ while {[more-text]} {
+ set line [next-text]
+ if {[is-a-directive $line]} {
+ split-directive $line code rest
+ switch -exact $code {
+ .RE {
+ break
+ }
+ .SH {
+ manerror "unbalanced .RS at section end"
+ backup-text 1
+ break
+ }
+ default {
+ output-directive $line
+ }
+ }
+ } else {
+ man-puts $line
+ }
+ }
+ man-puts </DL>
+}
+
+##
+## process .IP lists which may be plain indents,
+## numeric lists, or definition lists
+##
+proc output-IP-list {context code rest} {
+ global manual
+ if {[string equal $rest {}]} {
+ # blank label, plain indent, no contents entry
+ man-puts <DL><P><DD>
+ while {[more-text]} {
+ set line [next-text]
+ if {[is-a-directive $line]} {
+ split-directive $line code rest
+ if {[string equal $code ".IP"] && [string equal $rest {}]} {
+ man-puts "<P>"
+ continue
+ }
+ if {[lsearch {.br .DS .RS} $code] >= 0} {
+ output-directive $line
+ } else {
+ backup-text 1
+ break
+ }
+ } else {
+ man-puts $line
+ }
+ }
+ man-puts </DL>
+ } else {
+ # labelled list, make contents
+ if {[string compare $context ".SH"]} {
+ man-puts <P>
+ }
+ man-puts <DL>
+ lappend manual(section-toc) <DL>
+ backup-text 1
+ set accept_RE 0
+ while {[more-text]} {
+ set line [next-text]
+ if {[is-a-directive $line]} {
+ split-directive $line code rest
+ switch -exact $code {
+ .IP {
+ if {$accept_RE} {
+ output-IP-list .IP $code $rest
+ continue
+ }
+ if {[string equal $manual(section) "ARGUMENTS"] || \
+ [regexp {^\[[0-9]+\]$} $rest]} {
+ man-puts "<P><DT>$rest<DD>"
+ } else {
+ man-puts "<P><DT>[long-toc $rest]<DD>"
+ }
+ if {[string equal $manual(name):$manual(section) \
+ "selection:DESCRIPTION"]} {
+ if {[match-text .RE @rest .RS .RS]} {
+ man-puts <DT>[long-toc $rest]<DD>
+ }
+ }
+ }
+ .sp -
+ .br -
+ .DS -
+ .CS {
+ output-directive $line
+ }
+ .RS {
+ if {[match-text .RS]} {
+ output-directive $line
+ incr accept_RE 1
+ } elseif {[match-text .CS]} {
+ output-directive .CS
+ incr accept_RE 1
+ } elseif {[match-text .PP]} {
+ output-directive .PP
+ incr accept_RE 1
+ } elseif {[match-text .DS]} {
+ output-directive .DS
+ incr accept_RE 1
+ } else {
+ output-directive $line
+ }
+ }
+ .PP {
+ if {[match-text @rest1 .br @rest2 .RS]} {
+ # yet another nroff kludge as above
+ man-puts "<P><DT>[long-toc $rest1]"
+ man-puts "<DT>[long-toc $rest2]<DD>"
+ incr accept_RE 1
+ } elseif {[match-text @rest .RE]} {
+ # gad, this is getting ridiculous
+ if { ! $accept_RE} {
+ man-puts "</DL><P>$rest<DL>"
+ backup-text 1
+ break
+ } else {
+ man-puts "<P>$rest"
+ incr accept_RE -1
+ }
+ } elseif {$accept_RE} {
+ output-directive $line
+ } else {
+ backup-text 1
+ break
+ }
+ }
+ .RE {
+ if { ! $accept_RE} {
+ backup-text 1
+ break
+ }
+ incr accept_RE -1
+ }
+ default {
+ backup-text 1
+ break
+ }
+ }
+ } else {
+ man-puts $line
+ }
+ }
+ man-puts <P></DL>
+ lappend manual(section-toc) </DL>
+ if {$accept_RE} {
+ manerror "missing .RE in output-IP-list"
+ }
+ }
+}
+##
+## handle the NAME section lines
+## there's only one line in the NAME section,
+## consisting of a comma separated list of names,
+## followed by a hyphen and a short description.
+##
+proc output-name {line} {
+ global manual
+ # split name line into pieces
+ regexp {^([^-]+) - (.*)$} $line all head tail
+ # output line to manual page untouched
+ man-puts $line
+ # output line to long table of contents
+ lappend manual(section-toc) <DL><DD>$line</DL>
+ # separate out the names for future reference
+ foreach name [split $head ,] {
+ set name [string trim $name]
+ if {[llength $name] > 1} {
+ manerror "name has a space: {$name}\nfrom: $line"
+ }
+ lappend manual(wing-toc) $name
+ lappend manual(name-$name) $manual(wing-file)/$manual(name)
+ }
+}
+##
+## build a cross-reference link if appropriate
+##
+proc cross-reference {ref} {
+ global manual
+ if {[string match Tcl_* $ref]} {
+ set lref $ref
+ } elseif {[string match Tk_* $ref]} {
+ set lref $ref
+ } elseif {[string equal $ref "Tcl"]} {
+ set lref $ref
+ } else {
+ set lref [string tolower $ref]
+ }
+ ##
+ ## nothing to reference
+ ##
+ if { ! [info exists manual(name-$lref)]} {
+ foreach name {array file history info interp string trace
+ after clipboard grab image option pack place selection tk tkwait update winfo wm} {
+ if {[regexp "^$name \[a-z0-9]*\$" $lref] && \
+ [string compare $manual(tail) "$name.n"]} {
+ return "<A HREF=\"../$manual(name-$name).htm\">$ref</A>"
+ }
+ }
+ if {[lsearch {stdin stdout stderr end} $lref] >= 0} {
+ # no good place to send these
+ # tcl tokens?
+ # also end
+ }
+ return $ref
+ }
+ ##
+ ## would be a self reference
+ ##
+ foreach name $manual(name-$lref) {
+ if {[lsearch $name $manual(wing-file)/$manual(name)] >= 0} {
+ return $ref
+ }
+ }
+ ##
+ ## multiple choices for reference
+ ##
+ if {[llength $manual(name-$lref)] > 1} {
+ set tcl_i [lsearch -glob $manual(name-$lref) *TclCmd*]
+ set tcl_ref [lindex $manual(name-$lref) $tcl_i]
+ set tk_i [lsearch -glob $manual(name-$lref) *TkCmd*]
+ set tk_ref [lindex $manual(name-$lref) $tk_i]
+ if {$tcl_i >= 0 && "$manual(wing-file)" == {TclCmd} || "$manual(wing-file)" == {TclLib}} {
+ return "<A HREF=\"../$tcl_ref.htm\">$ref</A>"
+ }
+ if {$tk_i >= 0 && "$manual(wing-file)" == {TkCmd} || "$manual(wing-file)" == {TkLib}} {
+ return "<A HREF=\"../$tk_ref.htm\">$ref</A>"
+ }
+ if {"$lref" == {exit} && "$manual(tail)" == {tclsh.1} && $tcl_i >= 0} {
+ return "<A HREF=\"../$tcl_ref.htm\">$ref</A>"
+ }
+ puts stderr "multiple cross reference to $ref in $manual(name-$lref) from $manual(wing-file)/$manual(tail)"
+ return $ref
+ }
+ ##
+ ## exceptions, sigh, to the rule
+ ##
+ switch $manual(tail) {
+ canvas.n {
+ if {$lref == {focus}} {
+ upvar tail tail
+ set clue [string first command $tail]
+ if {$clue < 0 || $clue > 5} {
+ return $ref
+ }
+ }
+ if {[lsearch {bitmap image text} $lref] >= 0} {
+ return $ref
+ }
+ }
+ checkbutton.n -
+ radiobutton.n {
+ if {[lsearch {image} $lref] >= 0} {
+ return $ref
+ }
+ }
+ menu.n {
+ if {[lsearch {checkbutton radiobutton} $lref] >= 0} {
+ return $ref
+ }
+ }
+ options.n {
+ if {[lsearch {bitmap image set} $lref] >= 0} {
+ return $ref
+ }
+ }
+ regexp.n {
+ if {[lsearch {string} $lref] >= 0} {
+ return $ref
+ }
+ }
+ source.n {
+ if {[lsearch {text} $lref] >= 0} {
+ return $ref
+ }
+ }
+ history.n {
+ if {[lsearch {exec} $lref] >= 0} {
+ return $ref
+ }
+ }
+ return.n {
+ if {[lsearch {error continue break} $lref] >= 0} {
+ return $ref
+ }
+ }
+ scrollbar.n {
+ if {[lsearch {set} $lref] >= 0} {
+ return $ref
+ }
+ }
+ }
+ ##
+ ## return the cross reference
+ ##
+ return "<A HREF=\"../$manual(name-$lref).htm\">$ref</A>"
+}
+##
+## reference generation errors
+##
+proc reference-error {msg text} {
+ global manual
+ puts stderr "$manual(tail): $msg: {$text}"
+ return $text
+}
+##
+## insert as many cross references into this text string as are appropriate
+##
+proc insert-cross-references {text} {
+ global manual
+ ##
+ ## we identify cross references by:
+ ## ``quotation''
+ ## <B>emboldening</B>
+ ## Tcl_ prefix
+ ## Tk_ prefix
+ ## [a-zA-Z0-9]+ manual entry
+ ## and we avoid messing with already anchored text
+ ##
+ ##
+ ## find where each item lives
+ ##
+ array set offset [list \
+ anchor [string first {<A } $text] \
+ end-anchor [string first {</A>} $text] \
+ quote [string first {``} $text] \
+ end-quote [string first {''} $text] \
+ bold [string first {<B>} $text] \
+ end-bold [string first {</B>} $text] \
+ tcl [string first {Tcl_} $text] \
+ tk [string first {Tk_} $text] \
+ Tcl1 [string first {Tcl manual entry} $text] \
+ Tcl2 [string first {Tcl overview manual entry} $text] \
+ ]
+ ##
+ ## accumulate a list
+ ##
+ foreach name [array names offset] {
+ if {$offset($name) >= 0} {
+ set invert($offset($name)) $name
+ lappend offsets $offset($name)
+ }
+ }
+ ##
+ ## if nothing, then we're done.
+ ##
+ if { ! [info exists offsets]} {
+ return $text
+ }
+ ##
+ ## sort the offsets
+ ##
+ set offsets [lsort -integer $offsets]
+ ##
+ ## see which we want to use
+ ##
+ switch -exact $invert([lindex $offsets 0]) {
+ anchor {
+ if {$offset(end-anchor) < 0} { return [reference-error {Missing end anchor} $text]; }
+ set head [string range $text 0 $offset(end-anchor)]
+ set tail [string range $text [expr $offset(end-anchor)+1] end]
+ return $head[insert-cross-references $tail]
+ }
+ quote {
+ if {$offset(end-quote) < 0} { return [reference-error {Missing end quote} $text]; }
+ if {"$invert([lindex $offsets 1])" == {tk}} { set offsets [lreplace $offsets 1 1]; }
+ if {"$invert([lindex $offsets 1])" == {tcl}} { set offsets [lreplace $offsets 1 1]; }
+ switch -exact $invert([lindex $offsets 1]) {
+ end-quote {
+ set head [string range $text 0 [expr $offset(quote)-1]]
+ set body [string range $text [expr $offset(quote)+2] [expr $offset(end-quote)-1]]
+ set tail [string range $text [expr $offset(end-quote)+2] end]
+ return $head``[cross-reference $body]''[insert-cross-references $tail]
+ }
+ bold -
+ anchor {
+ set head [string range $text 0 [expr $offset(end-quote)+1]]
+ set tail [string range $text [expr $offset(end-quote)+2] end]
+ return $head[insert-cross-references $tail]
+ }
+ }
+ return [reference-error {Uncaught quote case} $text]
+ }
+ bold {
+ if {$offset(end-bold) < 0} { return $text; }
+ if {"$invert([lindex $offsets 1])" == {tk}} { set offsets [lreplace $offsets 1 1]; }
+ if {"$invert([lindex $offsets 1])" == {tcl}} { set offsets [lreplace $offsets 1 1]; }
+ switch -exact $invert([lindex $offsets 1]) {
+ end-bold {
+ set head [string range $text 0 [expr $offset(bold)-1]]
+ set body [string range $text [expr $offset(bold)+3] [expr $offset(end-bold)-1]]
+ set tail [string range $text [expr $offset(end-bold)+4] end]
+ return $head<B>[cross-reference $body]</B>[insert-cross-references $tail]
+ }
+ anchor {
+ set head [string range $text 0 [expr $offset(end-bold)+3]]
+ set tail [string range $text [expr $offset(end-bold)+4] end]
+ return $head[insert-cross-references $tail]
+ }
+ }
+ return [reference-error {Uncaught bold case} $text]
+ }
+ tk {
+ set head [string range $text 0 [expr $offset(tk)-1]]
+ set tail [string range $text $offset(tk) end]
+ if { ! [regexp {^(Tk_[a-zA-Z0-9_]+)(.*)$} $tail all body tail]} { return [reference-error {Tk regexp failed} $text]; }
+ return $head[cross-reference $body][insert-cross-references $tail]
+ }
+ tcl {
+ set head [string range $text 0 [expr $offset(tcl)-1]]
+ set tail [string range $text $offset(tcl) end]
+ if { ! [regexp {^(Tcl_[a-zA-Z0-9_]+)(.*)$} $tail all body tail]} { return [reference-error {Tcl regexp failed} $text]; }
+ return $head[cross-reference $body][insert-cross-references $tail]
+ }
+ Tcl1 -
+ Tcl2 {
+ set off [lindex $offsets 0]
+ set head [string range $text 0 [expr $off-1]]
+ set body Tcl
+ set tail [string range $text [expr $off+3] end]
+ return $head[cross-reference $body][insert-cross-references $tail]
+ }
+ end-anchor -
+ end-bold -
+ end-quote {
+ return [reference-error "Out of place $invert([lindex $offsets 0])" $text]
+ }
+ }
+}
+##
+## process formatting directives
+##
+proc output-directive {line} {
+ global manual
+ # process format directive
+ split-directive $line code rest
+ switch -exact $code {
+ .BS -
+ .BE {
+ # man-puts <HR>
+ }
+ .SH {
+ # drain any open lists
+ # announce the subject
+ set manual(section) $rest
+ # start our own stack of stuff
+ set manual($manual(name)-$manual(section)) {}
+ lappend manual(has-$manual(section)) $manual(name)
+ man-puts "<H3>[long-toc $manual(section)]</H3>"
+ # some sections can simply free wheel their way through the text
+ # some sections can be processed in their own loops
+ switch -exact $manual(section) {
+ NAME {
+ if {[lsearch {CrtImgType.3 CrtItemType.3 CrtPhImgFmt.3} $manual(tail)] >= 0} {
+ # these manual pages have two NAME sections
+ if {[info exists manual($manual(tail)-NAME)]} {
+ return
+ }
+ set manual($manual(tail)-NAME) 1
+ }
+ set names {}
+ while {1} {
+ set line [next-text]
+ if {[is-a-directive $line]} {
+ backup-text 1
+ output-name [join $names { }]
+ return
+ } else {
+ lappend names [string trim $line]
+ }
+ }
+ }
+ SYNOPSIS {
+ lappend manual(section-toc) <DL>
+ while {1} {
+ if {[next-op-is .nf rest]
+ || [next-op-is .br rest]
+ || [next-op-is .fi rest]} {
+ continue
+ }
+ if {[next-op-is .SH rest]
+ || [next-op-is .BE rest]
+ || [next-op-is .SO rest]} {
+ backup-text 1
+ break
+ }
+ if {[next-op-is .sp rest]} {
+ #man-puts <P>
+ continue
+ }
+ set more [next-text]
+ if {[is-a-directive $more]} {
+ manerror "in SYNOPSIS found $more"
+ backup-text 1
+ break
+ } else {
+ foreach more [split $more \n] {
+ man-puts $more<BR>
+ if {[lsearch {TclLib TkLib} $manual(wing-file)] < 0} {
+ lappend manual(section-toc) <DD>$more
+ }
+ }
+ }
+ }
+ lappend manual(section-toc) </DL>
+ return
+ }
+ {SEE ALSO} {
+ while {[more-text]} {
+ if {[next-op-is .SH rest]} {
+ backup-text 1
+ return
+ }
+ set more [next-text]
+ if {[is-a-directive $more]} {
+ manerror "$more"
+ backup-text 1
+ return
+ }
+ set nmore {}
+ foreach cr [split $more ,] {
+ set cr [string trim $cr]
+ if { ! [regexp {^<B>.*</B>$} $cr]} {
+ set cr <B>$cr</B>
+ }
+ if {[regexp {^<B>(.*)\([13n]\)</B>$} $cr all name]} {
+ set cr <B>$name</B>
+ }
+ lappend nmore $cr
+ }
+ man-puts [join $nmore {, }]
+ }
+ return
+ }
+ KEYWORDS {
+ while {[more-text]} {
+ if {[next-op-is .SH rest]} {
+ backup-text 1
+ return
+ }
+ set more [next-text]
+ if {[is-a-directive $more]} {
+ manerror "$more"
+ backup-text 1
+ return
+ }
+ set keys {}
+ foreach key [split $more ,] {
+ set key [string trim $key]
+ lappend manual(keyword-$key) [list $manual(name) $manual(wing-file)/$manual(name).htm]
+ set initial [string toupper [string index $key 0]]
+ lappend keys "<A href=\"../Keywords/$initial.htm\#$key\">$key</A>"
+ }
+ man-puts [join $keys {, }]
+ }
+ return
+ }
+ }
+ if {[next-op-is .IP rest]} {
+ output-IP-list .SH .IP $rest
+ return
+ }
+ if {[next-op-is .PP rest]} {
+ return
+ }
+ return
+ }
+ .SO {
+ if {[match-text @stuff .SE]} {
+ output-directive {.SH STANDARD OPTIONS}
+ set opts {}
+ foreach line [split $stuff \n] {
+ foreach option [split $line \t] {
+ lappend opts $option
+ }
+ }
+ man-puts <DL>
+ lappend manual(section-toc) <DL>
+ foreach option [lsort $opts] {
+ man-puts "<DT><B>[std-option-toc $option]</B>"
+ }
+ man-puts </DL>
+ lappend manual(section-toc) </DL>
+ } else {
+ manerror "unexpected .SO format:\n[expand-next-text 2]"
+ }
+ }
+ .OP {
+ output-widget-options $rest
+ return
+ }
+ .IP {
+ output-IP-list .IP .IP $rest
+ return
+ }
+ .PP {
+ man-puts <P>
+ }
+ .RS {
+ output-RS-list
+ return
+ }
+ .RE {
+ manerror "unexpected .RE"
+ return
+ }
+ .br {
+ man-puts <BR>
+ return
+ }
+ .DE {
+ manerror "unexpected .DE"
+ return
+ }
+ .DS {
+ if {[next-op-is .ta rest]} {
+
+ }
+ if {[match-text @stuff .DE]} {
+ man-puts <PRE>$stuff</PRE>
+ } elseif {[match-text .fi @ul1 @ul2 .nf @stuff .DE]} {
+ man-puts "<PRE>[lindex $ul1 1][lindex $ul2 1]\n$stuff</PRE>"
+ } else {
+ manerror "unexpected .DS format:\n[expand-next-text 2]"
+ }
+ return
+ }
+ .CS {
+ if {[next-op-is .ta rest]} {
+
+ }
+ if {[match-text @stuff .CE]} {
+ man-puts <PRE>$stuff</PRE>
+ } else {
+ manerror "unexpected .CS format:\n[expand-next-text 2]"
+ }
+ return
+ }
+ .CE {
+ manerror "unexpected .CE"
+ return
+ }
+ .sp {
+ man-puts <P>
+ }
+ .ta {
+ # these are tab stop settings for short tables
+ switch -exact $manual(name):$manual(section) {
+ {bind:MODIFIERS} -
+ {bind:EVENT TYPES} -
+ {bind:BINDING SCRIPTS AND SUBSTITUTIONS} -
+ {expr:OPERANDS} -
+ {expr:MATH FUNCTIONS} -
+ {history:DESCRIPTION} -
+ {history:HISTORY REVISION} -
+ {switch:DESCRIPTION} -
+ {upvar:DESCRIPTION} {
+ return; # fix.me
+ }
+ default {
+ manerror "ignoring $line"
+ }
+ }
+ }
+ .nf {
+ if {[match-text @more .fi]} {
+ foreach more [split $more \n] {
+ man-puts $more<BR>
+ }
+ } elseif {[match-text .RS @more .RE .fi]} {
+ man-puts <DL><DD>
+ foreach more [split $more \n] {
+ man-puts $more<BR>
+ }
+ man-puts </DL>
+ } elseif {[match-text .RS @more .RS @more2 .RE .RE .fi]} {
+ man-puts <DL><DD>
+ foreach more [split $more \n] {
+ man-puts $more<BR>
+ }
+ man-puts <DL><DD>
+ foreach more2 [split $more2 \n] {
+ man-puts $more2<BR>
+ }
+ man-puts </DL></DL>
+ } elseif {[match-text .RS @more .RS @more2 .RE @more3 .RE .fi]} {
+ man-puts <DL><DD>
+ foreach more [split $more \n] {
+ man-puts $more<BR>
+ }
+ man-puts <DL><DD>
+ foreach more2 [split $more2 \n] {
+ man-puts $more2<BR>
+ }
+ man-puts </DL><DD>
+ foreach more3 [split $more3 \n] {
+ man-puts $more3<BR>
+ }
+ man-puts </DL>
+ } elseif {[match-text .sp .RS @more .RS @more2 .sp .RE .RE .fi]} {
+ man-puts <P><DL><DD>
+ foreach more [split $more \n] {
+ man-puts $more<BR>
+ }
+ man-puts <DL><DD>
+ foreach more2 [split $more2 \n] {
+ man-puts $more2<BR>
+ }
+ man-puts </DL></DL><P>
+ } elseif {[match-text .RS .sp @more .sp .RE .fi]} {
+ man-puts <P><DL><DD>
+ foreach more [split $more \n] {
+ man-puts $more<BR>
+ }
+ man-puts </DL><P>
+ } else {
+ manerror "ignoring $line"
+ }
+ }
+ .fi {
+ manerror "ignoring $line"
+ }
+ .na -
+ .ad -
+ .UL -
+ .ne {
+ manerror "ignoring $line"
+ }
+ default {
+ manerror "unrecognized format directive: $line"
+ }
+ }
+}
+##
+## merge copyright listings
+##
+proc merge-copyrights {l1 l2} {
+ foreach copyright [concat $l1 $l2] {
+ if {[regexp {^Copyright +\(c\) +([0-9]+) +(by +)?([A-Za-z].*)$} $copyright all date by who]} {
+ lappend dates($who) $date
+ continue
+ }
+ if {[regexp {^Copyright +\(c\) +([0-9]+)-([0-9]+) +(by +)?([A-Za-z].*)$} $copyright all from to by who]} {
+ for {set date $from} {$date <= $to} {incr date} {
+ lappend dates($who) $date
+ }
+ continue
+ }
+ if {[regexp {^Copyright +\(c\) +([0-9]+), *([0-9]+) +(by +)?([A-Za-z].*)$} $copyright all date1 date2 by who]} {
+ lappend dates($who) $date1 $date2
+ continue
+ }
+ puts "oops: $copyright"
+ }
+ foreach who [array names dates] {
+ set list [lsort $dates($who)]
+ if {[llength $list] == 1 || [lindex $list 0] == [lrange $list end end]} {
+ lappend merge "Copyright (c) [lindex $list 0] $who"
+ } else {
+ lappend merge "Copyright (c) [lindex $list 0]-[lrange $list end end] $who"
+ }
+ }
+ return [lsort $merge]
+}
+
+proc makedirhier {dir} {
+ if { ! [file isdirectory $dir]} {
+ makedirhier [file dirname $dir]
+ if { ! [file isdirectory $dir]} {
+ if {[catch {exec mkdir $dir} error]} {
+ error "cannot create directory $dir: $error"
+ }
+ }
+ }
+}
+
+##
+## foreach of the man directories specified by args
+## convert manpages into hypertext in the directory
+## specified by html.
+##
+proc make-man-pages {html args} {
+ global env manual overall_title
+ makedirhier $html
+ if { ! [file isdirectory $html]} {
+ exec mkdir $html
+ }
+ set manual(short-toc-n) 1
+ set manual(short-toc-fp) [open $html/contents.htm w]
+ puts $manual(short-toc-fp) "<HTML><HEAD><TITLE>$overall_title</TITLE></HEAD>"
+ puts $manual(short-toc-fp) "<BODY><HR><H3>$overall_title</H3><HR><DL>"
+ set manual(merge-copyrights) {}
+ foreach arg $args {
+ set manual(wing-glob) [lindex $arg 0]
+ set manual(wing-name) [lindex $arg 1]
+ set manual(wing-file) [lindex $arg 2]
+ set manual(wing-description) [lindex $arg 3]
+ set manual(wing-copyrights) {}
+ makedirhier $html/$manual(wing-file)
+ set manual(wing-toc-fp) [open $html/$manual(wing-file)/contents.htm w]
+ # whistle
+ puts stderr "scanning section $manual(wing-name)"
+ # put the entry for this section into the short table of contents
+ puts $manual(short-toc-fp) "<DT><A HREF=\"$manual(wing-file)/contents.htm\">$manual(wing-name)</A><DD>$manual(wing-description)"
+ # initialize the wing table of contents
+ puts $manual(wing-toc-fp) "<HTML><HEAD><TITLE>$manual(wing-name) Manual</TITLE></HEAD>"
+ puts $manual(wing-toc-fp) "<BODY><HR><H3>$manual(wing-name)</H3><HR>"
+ # initialize the short table of contents for this section
+ set manual(wing-toc) {}
+ # initialize the man directory for this section
+ makedirhier $html/$manual(wing-file)
+ # initialize the long table of contents for this section
+ set manual(long-toc-n) 1
+ # get the manual pages for this section
+ set manual(pages) [lsort [glob $manual(wing-glob)]]
+ if {[lsearch -glob $manual(pages) */options.n] >= 0} {
+ set n [lsearch $manual(pages) */options.n]
+ set manual(pages) "[lindex $manual(pages) $n] [lreplace $manual(pages) $n $n]"
+ }
+ # set manual(pages) [lrange $manual(pages) 0 5]
+ foreach manual(page) $manual(pages) {
+ # whistle
+ puts stderr "scanning page $manual(page)"
+ set manual(tail) [file tail $manual(page)]
+ set manual(name) [file root $manual(tail)]
+ set manual(section) {}
+ if {[lsearch {case pack-old menubar} $manual(name)] >= 0} {
+ # obsolete
+ manerror "discarding $manual(name)"
+ continue
+ }
+ set manual(infp) [open "$manual(page)"]
+ set manual(text) {}
+ set manual(partial-text) {}
+ foreach p {.RS .DS .CS .SO} {
+ set manual($p) 0
+ }
+ set manual(stack) {}
+ set manual(section) {}
+ set manual(section-toc) {}
+ set manual(section-toc-n) 1
+ set manual(copyrights) {}
+ lappend manual(all-pages) $manual(wing-file)/$manual(tail)
+ manreport 100 "$manual(name)"
+ while {[gets $manual(infp) line] >= 0} {
+ manreport 100 $line
+ if {[regexp {^[`'][/\\]} $line]} {
+ if {[regexp {Copyright \(c\).*$} $line copyright]} {
+ lappend manual(copyrights) $copyright
+ }
+ # comment
+ continue
+ }
+ if {"$line" == {'}} {
+ # comment
+ continue
+ }
+ if {[parse-directive $line code rest]} {
+ switch -exact $code {
+ .ad -
+ .na -
+ .so -
+ .ne -
+ .AS -
+ .VE -
+ .VS -
+ . {
+ # ignore
+ continue
+ }
+ }
+ if {"$manual(partial-text)" != {}} {
+ lappend manual(text) [process-text $manual(partial-text)]
+ set manual(partial-text) {}
+ }
+ switch -exact $code {
+ .SH {
+ if {[llength $rest] == 0} {
+ gets $manual(infp) rest
+ }
+ lappend manual(text) ".SH [unquote $rest]"
+ }
+ .TH {
+ lappend manual(text) "$code [unquote $rest]"
+ }
+ .HS -
+ .UL -
+ .ta {
+ lappend manual(text) "$code [unquote $rest]"
+ }
+ .BS -
+ .BE -
+ .br -
+ .fi -
+ .sp -
+ .nf {
+ if {"$rest" != {}} {
+ manerror "unexpected argument: $line"
+ }
+ lappend manual(text) $code
+ }
+ .AP {
+ lappend manual(text) [concat .IP [process-text "[lindex $rest 0] \\fB[lindex $rest 1]\\fR ([lindex $rest 2])"]]
+ }
+ .IP {
+ regexp {^(.*) +[0-9]+$} $rest all rest
+ lappend manual(text) ".IP [process-text [unquote [string trim $rest]]]"
+ }
+ .TP {
+ set next [gets $manual(infp)]
+ if {"$next" != {'}} {
+ lappend manual(text) ".IP [process-text $next]"
+ }
+ }
+ .OP {
+ lappend manual(text) [concat .OP [process-text \
+ "\\fB[lindex $rest 0]\\fR \\fB[lindex $rest 1]\\fR \\fB[lindex $rest 2]\\fR"]]
+ }
+ .PP -
+ .LP {
+ lappend manual(text) {.PP}
+ }
+ .RS {
+ incr manual(.RS)
+ lappend manual(text) $code
+ }
+ .RE {
+ incr manual(.RS) -1
+ lappend manual(text) $code
+ }
+ .SO {
+ incr manual(.SO)
+ lappend manual(text) $code
+ }
+ .SE {
+ incr manual(.SO) -1
+ lappend manual(text) $code
+ }
+ .DS {
+ incr manual(.DS)
+ lappend manual(text) $code
+ }
+ .DE {
+ incr manual(.DS) -1
+ lappend manual(text) $code
+ }
+ .CS {
+ incr manual(.CS)
+ lappend manual(text) $code
+ }
+ .CE {
+ incr manual(.CS) -1
+ lappend manual(text) $code
+ }
+ .de {
+ while {[gets $manual(infp) line] >= 0} {
+ if {[regexp {^\.\.} $line]} {
+ break
+ }
+ }
+ }
+ .. {
+ error "found .. outside of .de"
+ }
+ default {
+ manerror "unrecognized format directive: $line"
+ }
+ }
+ } else {
+ if {"$manual(partial-text)" == {}} {
+ set manual(partial-text) $line
+ } else {
+ append manual(partial-text) \n$line
+ }
+ }
+ }
+ if {"$manual(partial-text)" != {}} {
+ lappend manual(text) [process-text $manual(partial-text)]
+ }
+ close $manual(infp)
+ # fixups
+ if {$manual(.RS) != 0} {
+ if {"$manual(name)" != {selection}} {
+ puts "unbalanced .RS .RE"
+ }
+ }
+ if {$manual(.DS) != 0} {
+ puts "unbalanced .DS .DE"
+ }
+ if {$manual(.CS) != 0} {
+ puts "unbalanced .CS .CE"
+ }
+ if {$manual(.SO) != 0} {
+ puts "unbalanced .SO .SE"
+ }
+ # output conversion
+ open-text
+ if {[next-op-is .HS rest]} {
+ set manual($manual(name)-title) "[lrange $rest 1 end] [lindex $rest 0] manual page"
+ while {[more-text]} {
+ set line [next-text]
+ if {[is-a-directive $line]} {
+ output-directive $line
+ } else {
+ man-puts $line
+ }
+ }
+ man-puts <HR><PRE>
+ foreach copyright $manual(copyrights) {
+ man-puts "<A HREF=\"../copyright.htm\">Copyright</A> &#169; [lrange $copyright 2 end]"
+ }
+ man-puts "<A HREF=\"../copyright.htm\">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>"
+ set manual(wing-copyrights) [merge-copyrights $manual(wing-copyrights) $manual(copyrights)]
+ } elseif {[next-op-is .TH rest]} {
+ set manual($manual(name)-title) "[lrange $rest 4 end] - [lindex $rest 0] manual page"
+ while {[more-text]} {
+ set line [next-text]
+ if {[is-a-directive $line]} {
+ output-directive $line
+ } else {
+ man-puts $line
+ }
+ }
+ man-puts <HR><PRE>
+ foreach copyright $manual(copyrights) {
+ man-puts "<A HREF=\"../copyright.htm\">Copyright</A> &#169; [lrange $copyright 2 end]"
+ }
+ man-puts "<A HREF=\"../copyright.htm\">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>"
+ set manual(wing-copyrights) [merge-copyrights $manual(wing-copyrights) $manual(copyrights)]
+ } else {
+ manerror "no .HS or .TH record found"
+ }
+ #
+ # make the long table of contents for this page
+ #
+ set manual(toc-$manual(wing-file)-$manual(name)) [concat <DL> $manual(section-toc) </DL><HR>]
+ }
+
+ #
+ # make the wing table of contents for the section
+ #
+ set width 0
+ foreach name $manual(wing-toc) {
+ if {[string length $name] > $width} {
+ set width [string length $name]
+ }
+ }
+ set perline [expr 120 / $width]
+ set nrows [expr ([llength $manual(wing-toc)]+$perline)/$perline]
+ set n 0
+ catch {unset rows}
+ foreach name [lsort $manual(wing-toc)] {
+ set tail $manual(name-$name)
+ if {[llength $tail] > 1} {
+ manerror "$name is defined in more than one file: $tail"
+ set tail [lindex $tail [expr [llength $tail]-1]]
+ }
+ set tail [file tail $tail]
+ append rows([expr $n%$nrows]) "<td> <a href=\"$tail.htm\">$name</a>"
+ incr n
+ }
+ puts $manual(wing-toc-fp) <table>
+ foreach row [lsort -integer [array names rows]] {
+ puts $manual(wing-toc-fp) <tr>$rows($row)</tr>
+ }
+ puts $manual(wing-toc-fp) </table>
+
+ #
+ # insert wing copyrights
+ #
+ puts $manual(wing-toc-fp) "<HR><PRE>"
+ foreach copyright $manual(wing-copyrights) {
+ puts $manual(wing-toc-fp) "<A HREF=\"../copyright.htm\">Copyright</A> &#169; [lrange $copyright 2 end]"
+ }
+ puts $manual(wing-toc-fp) "<A HREF=\"../copyright.htm\">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr."
+ puts $manual(wing-toc-fp) "</PRE></BODY></HTML>"
+ close $manual(wing-toc-fp)
+ set manual(merge-copyrights) [merge-copyrights $manual(merge-copyrights) $manual(wing-copyrights)]
+ }
+
+ ##
+ ## build the keyword index.
+ ##
+ proc strcasecmp {a b} { return [string compare -nocase $a $b] }
+ set keys [lsort -command strcasecmp [array names manual keyword-*]]
+ makedirhier $html/Keywords
+ catch {eval exec rm -f [glob $html/Keywords/*]}
+ puts $manual(short-toc-fp) {<DT><A HREF="Keywords/contents.htm">Keywords</A><DD>The keywords from the Tcl/Tk man pages.}
+ set keyfp [open $html/Keywords/contents.htm w]
+ puts $keyfp "<HTML><HEAD><TITLE>Tcl/Tk Keywords</TITLE></HEAD>"
+ puts $keyfp "<BODY><HR><H3>Tcl/Tk Keywords</H3><HR><H2>"
+ foreach a {A B C D E F G H I J K L M N O P Q R S T U V W X Y Z} {
+ puts $keyfp "<A HREF=\"$a.htm\">$a</A>"
+ set afp [open $html/Keywords/$a.htm w]
+ puts $afp "<HTML><HEAD><TITLE>Tcl/Tk Keywords - $a</TITLE></HEAD>"
+ puts $afp "<BODY><HR><H3>Tcl/Tk Keywords - $a</H3><HR><H2>"
+ foreach b {A B C D E F G H I J K L M N O P Q R S T U V W X Y Z} {
+ puts $afp "<A HREF=\"$b.htm\">$b</A>"
+ }
+ puts $afp "</H2><HR><DL>"
+ foreach k $keys {
+ if {[regexp -nocase -- "^keyword-$a" $k]} {
+ set k [string range $k 8 end]
+ puts $afp "<DT><A NAME=\"$k\">$k</A><DD>"
+ set refs {}
+ foreach man $manual(keyword-$k) {
+ set name [lindex $man 0]
+ set file [lindex $man 1]
+ lappend refs "<A HREF=\"../$file\">$name</A>"
+ }
+ puts $afp [join $refs {, }]
+ }
+ }
+ puts $afp "</DL><HR><PRE>"
+ # insert merged copyrights
+ foreach copyright $manual(merge-copyrights) {
+ puts $afp "<A HREF=\"copyright.htm\">Copyright</A> &#169; [lrange $copyright 2 end]"
+ }
+ puts $afp "<A HREF=\"copyright.htm\">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr."
+ puts $afp "</PRE></BODY></HTML>"
+ close $afp
+ }
+ puts $keyfp "</H2><HR><PRE>"
+
+ # insert merged copyrights
+ foreach copyright $manual(merge-copyrights) {
+ puts $keyfp "<A HREF=\"copyright.htm\">Copyright</A> &#169; [lrange $copyright 2 end]"
+ }
+ puts $keyfp "<A HREF=\"copyright.htm\">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr."
+ puts $keyfp </PRE><HR></BODY></HTML>
+ close $keyfp
+
+ ##
+ ## finish off short table of contents
+ ##
+ puts $manual(short-toc-fp) {<DT><A HREF="http://www.elf.org">Source</A><DD>More information about these man pages.}
+ puts $manual(short-toc-fp) "</DL><HR><PRE>"
+ # insert merged copyrights
+ foreach copyright $manual(merge-copyrights) {
+ puts $manual(short-toc-fp) "<A HREF=\"copyright.htm\">Copyright</A> &#169; [lrange $copyright 2 end]"
+ }
+ puts $manual(short-toc-fp) "<A HREF=\"copyright.htm\">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr."
+ puts $manual(short-toc-fp) "</PRE></BODY></HTML>"
+ close $manual(short-toc-fp)
+
+ ##
+ ## output man pages
+ ##
+ unset manual(section)
+ foreach path $manual(all-pages) {
+ set manual(wing-file) [file dirname $path]
+ set manual(tail) [file tail $path]
+ set manual(name) [file root $manual(tail)]
+ set text $manual(output-$manual(wing-file)-$manual(name))
+ set ntext 0
+ foreach item $text {
+ incr ntext [llength [split $item \n]]
+ incr ntext
+ }
+ set toc $manual(toc-$manual(wing-file)-$manual(name))
+ set ntoc 0
+ foreach item $toc {
+ incr ntoc [llength [split $item \n]]
+ incr ntoc
+ }
+ puts stderr "rescanning page $manual(name) $ntoc/$ntext"
+ set manual(outfp) [open $html/$manual(wing-file)/$manual(name).htm w]
+ puts $manual(outfp) "<HTML><HEAD><TITLE>$manual($manual(name)-title)</TITLE></HEAD><BODY>"
+ if {($ntext > 60) && ($ntoc > 32) || [lsearch {
+ Hash LinkVar SetVar TraceVar ConfigWidg CrtImgType CrtItemType
+ CrtPhImgFmt DoOneEvent GetBitmap GetColor GetCursor GetDash
+ GetJustify GetPixels GetVisual ParseArgv QueueEvent
+ } $manual(tail)] >= 0} {
+ foreach item $toc {
+ puts $manual(outfp) $item
+ }
+ }
+ foreach item $text {
+ puts $manual(outfp) [insert-cross-references $item]
+ }
+ puts $manual(outfp) </BODY></HTML>
+ close $manual(outfp)
+ }
+ return {}
+}
+
+set usercmddesc {The interpreters which implement Tcl and Tk.}
+set tclcmddesc {The commands which the <B>tclsh</B> interpreter implements.}
+set tkcmddesc {The additional commands which the <B>wish</B> interpreter implements.}
+set tcllibdesc {The C functions which a Tcl extended C program may use.}
+set tklibdesc {The additional C functions which a Tk extended C program may use.}
+
+parse_command_line
+
+if {1} {
+ if {[catch {
+ make-man-pages $webdir \
+ "$tcltkdir/{$tkdir,$tcldir}/doc/*.1 {Tcl/Tk Applications} UserCmd {$usercmddesc}" \
+ "$tcltkdir/$tcldir/doc/*.n {Tcl Commands} TclCmd {$tclcmddesc}" \
+ "$tcltkdir/$tkdir/doc/*.n {Tk Commands} TkCmd {$tkcmddesc}" \
+ "$tcltkdir/$tcldir/doc/*.3 {Tcl Library} TclLib {$tcllibdesc}" \
+ "$tcltkdir/$tkdir/doc/*.3 {Tk Library} TkLib {$tklibdesc}"
+ } error]} {
+ puts $error\n$errorInfo
+ }
+}
+
diff --git a/tcl/tools/uniClass.tcl b/tcl/tools/uniClass.tcl
new file mode 100644
index 00000000000..2820ba44193
--- /dev/null
+++ b/tcl/tools/uniClass.tcl
@@ -0,0 +1,61 @@
+proc emitRange {first last} {
+ global ranges numranges chars numchars
+
+ if {$first < ($last-1)} {
+ append ranges [format "{0x%04x, 0x%04x}, " \
+ $first $last]
+ if {[incr numranges] % 4 == 0} {
+ append ranges "\n "
+ }
+ } else {
+ append chars [format "0x%04x, " $first]
+ incr numchars
+ if {$numchars % 9 == 0} {
+ append chars "\n "
+ }
+ if {$first != $last} {
+ append chars [format "0x%04x, " $last]
+ incr numchars
+ if {$numchars % 9 == 0} {
+ append chars "\n "
+ }
+ }
+ }
+}
+
+proc genTable {type} {
+ global first last ranges numranges chars numchars
+ set first -2
+ set last -2
+
+ set ranges " "
+ set numranges 0
+ set chars " "
+ set numchars 0
+
+ for {set i 0} {$i < 0x10000} {incr i} {
+ if {[string is $type [format %c $i]]} {
+ if {$i == ($last + 1)} {
+ set last $i
+ } else {
+ if {$first > 0} {
+ emitRange $first $last
+ }
+ set first $i
+ set last $i
+ }
+ }
+ }
+ emitRange $first $last
+
+ puts "static crange ${type}RangeTable\[\] = {\n$ranges\n};\n"
+ puts "#define NUM_[string toupper $type]_RANGE (sizeof(${type}RangeTable)/sizeof(crange))\n"
+ puts "static chr ${type}CharTable\[\] = {\n$chars\n};\n"
+ puts "#define NUM_[string toupper $type]_CHAR (sizeof(${type}CharTable)/sizeof(chr))\n"
+}
+
+
+foreach type {alpha digit punct space lower upper graph } {
+ genTable $type
+}
+
diff --git a/tcl/tools/uniParse.tcl b/tcl/tools/uniParse.tcl
new file mode 100644
index 00000000000..4692fd5e29c
--- /dev/null
+++ b/tcl/tools/uniParse.tcl
@@ -0,0 +1,386 @@
+# uniParse.tcl --
+#
+# This program parses the UnicodeData file and generates the
+# corresponding tclUniData.c file with compressed character
+# data tables. The input to this program should be the latest
+# UnicodeData file from:
+# ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData-Latest.txt
+#
+# Copyright (c) 1998-1999 by Scriptics Corporation.
+# All rights reserved.
+#
+# RCS: @(#) $Id$
+
+
+namespace eval uni {
+ set shift 5; # number of bits of data within a page
+ # This value can be adjusted to find the
+ # best split to minimize table size
+
+ variable pMap; # map from page to page index, each entry is
+ # an index into the pages table, indexed by
+ # page number
+ variable pages; # map from page index to page info, each
+ # entry is a list of indices into the groups
+ # table, the list is indexed by the offset
+ variable groups; # list of character info values, indexed by
+ # group number, initialized with the
+ # unassigned character group
+
+ variable categories {
+ Cn Lu Ll Lt Lm Lo Mn Me Mc Nd Nl No Zs Zl Zp
+ Cc Cf Co Cs Pc Pd Ps Pe Pi Pf Po Sm Sc Sk So
+ }; # Ordered list of character categories, must
+ # match the enumeration in the header file.
+
+ variable titleCount 0; # Count of the number of title case
+ # characters. This value is used in the
+ # regular expression code to allocate enough
+ # space for the title case variants.
+}
+
+proc uni::getValue {items index} {
+ variable categories
+ variable titleCount
+
+ # Extract character info
+
+ set category [lindex $items 2]
+ if {[scan [lindex $items 12] %4x toupper] == 1} {
+ set toupper [expr {$index - $toupper}]
+ } else {
+ set toupper {}
+ }
+ if {[scan [lindex $items 13] %4x tolower] == 1} {
+ set tolower [expr {$tolower - $index}]
+ } else {
+ set tolower {}
+ }
+ if {[scan [lindex $items 14] %4x totitle] == 1} {
+ set totitle [expr {$index - $totitle}]
+ } else {
+ set totitle {}
+ }
+
+ set categoryIndex [lsearch -exact $categories $category]
+ if {$categoryIndex < 0} {
+ puts "Unexpected character category: $index($category)"
+ set categoryIndex 0
+ } elseif {$category == "Lt"} {
+ incr titleCount
+ }
+
+ return "$categoryIndex,$toupper,$tolower,$totitle"
+}
+
+proc uni::getGroup {value} {
+ variable groups
+
+ set gIndex [lsearch -exact $groups $value]
+ if {$gIndex == -1} {
+ set gIndex [llength $groups]
+ lappend groups $value
+ }
+ return $gIndex
+}
+
+proc uni::addPage {info} {
+ variable pMap
+ variable pages
+
+ set pIndex [lsearch -exact $pages $info]
+ if {$pIndex == -1} {
+ set pIndex [llength $pages]
+ lappend pages $info
+ }
+ lappend pMap $pIndex
+ return
+}
+
+proc uni::buildTables {data} {
+ variable shift
+
+ variable pMap {}
+ variable pages {}
+ variable groups {{0,,,}}
+ set info {} ;# temporary page info
+
+ set mask [expr {(1 << $shift) - 1}]
+
+ set next 0
+
+ foreach line [split $data \n] {
+ if {$line == ""} {
+ set line "FFFF;;Cn;0;ON;;;;;N;;;;;\n"
+ }
+
+ set items [split $line \;]
+
+ scan [lindex $items 0] %4x index
+ set index [format 0x%0.4x $index]
+
+ set gIndex [getGroup [getValue $items $index]]
+
+ # Since the input table omits unassigned characters, these will
+ # show up as gaps in the index sequence. There are a few special cases
+ # where the gaps correspond to a uniform block of assigned characters.
+ # These are indicated as such in the character name.
+
+ # Enter all unassigned characters up to the current character.
+ if {($index > $next) \
+ && ![regexp "Last>$" [lindex $items 1]]} {
+ for {} {$next < $index} {incr next} {
+ lappend info 0
+ if {($next & $mask) == $mask} {
+ addPage $info
+ set info {}
+ }
+ }
+ }
+
+ # Enter all assigned characters up to the current character
+ for {set i $next} {$i <= $index} {incr i} {
+ # Split character index into offset and page number
+ set offset [expr {$i & $mask}]
+ set page [expr {($i >> $shift)}]
+
+ # Add the group index to the info for the current page
+ lappend info $gIndex
+
+ # If this is the last entry in the page, add the page
+ if {$offset == $mask} {
+ addPage $info
+ set info {}
+ }
+ }
+ set next [expr {$index + 1}]
+ }
+ return
+}
+
+proc uni::main {} {
+ global argc argv0 argv
+ variable pMap
+ variable pages
+ variable groups
+ variable shift
+ variable titleCount
+
+ if {$argc != 2} {
+ puts stderr "\nusage: $argv0 <datafile> <outdir>\n"
+ exit 1
+ }
+ set f [open [lindex $argv 0] r]
+ set data [read $f]
+ close $f
+
+ buildTables $data
+ puts "X = [llength $pMap] Y= [llength $pages] A= [llength $groups]"
+ set size [expr {[llength $pMap] + [llength $pages]*(1<<$shift)}]
+ puts "shift = 6, space = $size"
+ puts "title case count = $titleCount"
+
+ set f [open [file join [lindex $argv 1] tclUniData.c] w]
+ fconfigure $f -translation lf
+ puts $f "/*
+ * tclUtfData.c --
+ *
+ * Declarations of Unicode character information tables. This file is
+ * automatically generated by the tools/uniParse.tcl script. Do not
+ * modify this file by hand.
+ *
+ * Copyright (c) 1998 by Scriptics Corporation.
+ * All rights reserved.
+ *
+ * RCS: @(#) \$Id\$
+ */
+
+/*
+ * A 16-bit Unicode character is split into two parts in order to index
+ * into the following tables. The lower OFFSET_BITS comprise an offset
+ * into a page of characters. The upper bits comprise the page number.
+ */
+
+#define OFFSET_BITS $shift
+
+/*
+ * The pageMap is indexed by page number and returns an alternate page number
+ * that identifies a unique page of characters. Many Unicode characters map
+ * to the same alternate page number.
+ */
+
+static unsigned char pageMap\[\] = {"
+ set line " "
+ set last [expr {[llength $pMap] - 1}]
+ for {set i 0} {$i <= $last} {incr i} {
+ append line [lindex $pMap $i]
+ if {$i != $last} {
+ append line ", "
+ }
+ if {[string length $line] > 70} {
+ puts $f $line
+ set line " "
+ }
+ }
+ puts $f $line
+ puts $f "};
+
+/*
+ * The groupMap is indexed by combining the alternate page number with
+ * the page offset and returns a group number that identifies a unique
+ * set of character attributes.
+ */
+
+static unsigned char groupMap\[\] = {"
+ set line " "
+ set lasti [expr {[llength $pages] - 1}]
+ for {set i 0} {$i <= $lasti} {incr i} {
+ set page [lindex $pages $i]
+ set lastj [expr {[llength $page] - 1}]
+ for {set j 0} {$j <= $lastj} {incr j} {
+ append line [lindex $page $j]
+ if {$j != $lastj || $i != $lasti} {
+ append line ", "
+ }
+ if {[string length $line] > 70} {
+ puts $f $line
+ set line " "
+ }
+ }
+ }
+ puts $f $line
+ puts $f "};
+
+/*
+ * Each group represents a unique set of character attributes. The attributes
+ * are encoded into a 32-bit value as follows:
+ *
+ * Bits 0-4 Character category: see the constants listed below.
+ *
+ * Bits 5-7 Case delta type: 000 = identity
+ * 010 = add delta for lower
+ * 011 = add delta for lower, add 1 for title
+ * 100 = sutract delta for title/upper
+ * 101 = sub delta for upper, sub 1 for title
+ * 110 = sub delta for upper, add delta for lower
+ *
+ * Bits 8-21 Reserved for future use.
+ *
+ * Bits 22-31 Case delta: delta for case conversions. This should be the
+ * highest field so we can easily sign extend.
+ */
+
+static int groups\[\] = {"
+ set line " "
+ set last [expr {[llength $groups] - 1}]
+ for {set i 0} {$i <= $last} {incr i} {
+ foreach {type toupper tolower totitle} [split [lindex $groups $i] ,] {}
+
+ # Compute the case conversion type and delta
+
+ if {$totitle != ""} {
+ if {$totitle == $toupper} {
+ # subtract delta for title or upper
+ set case 4
+ set delta $toupper
+ } elseif {$toupper != ""} {
+ # subtract delta for upper, subtract 1 for title
+ set case 5
+ set delta $toupper
+ } else {
+ # add delta for lower, add 1 for title
+ set case 3
+ set delta $tolower
+ }
+ } elseif {$toupper != ""} {
+ # subtract delta for upper, add delta for lower
+ set case 6
+ set delta $toupper
+ } elseif {$tolower != ""} {
+ # add delta for lower
+ set case 2
+ set delta $tolower
+ } else {
+ # noop
+ set case 0
+ set delta 0
+ }
+
+ set val [expr {($delta << 22) | ($case << 5) | $type}]
+
+ append line [format "%d" $val]
+ if {$i != $last} {
+ append line ", "
+ }
+ if {[string length $line] > 65} {
+ puts $f $line
+ set line " "
+ }
+ }
+ puts $f $line
+ puts $f "};
+
+/*
+ * The following constants are used to determine the category of a
+ * Unicode character.
+ */
+
+#define UNICODE_CATEGORY_MASK 0X1F
+
+enum {
+ UNASSIGNED,
+ UPPERCASE_LETTER,
+ LOWERCASE_LETTER,
+ TITLECASE_LETTER,
+ MODIFIER_LETTER,
+ OTHER_LETTER,
+ NON_SPACING_MARK,
+ ENCLOSING_MARK,
+ COMBINING_SPACING_MARK,
+ DECIMAL_DIGIT_NUMBER,
+ LETTER_NUMBER,
+ OTHER_NUMBER,
+ SPACE_SEPARATOR,
+ LINE_SEPARATOR,
+ PARAGRAPH_SEPARATOR,
+ CONTROL,
+ FORMAT,
+ PRIVATE_USE,
+ SURROGATE,
+ CONNECTOR_PUNCTUATION,
+ DASH_PUNCTUATION,
+ OPEN_PUNCTUATION,
+ CLOSE_PUNCTUATION,
+ INITIAL_QUOTE_PUNCTUATION,
+ FINAL_QUOTE_PUNCTUATION,
+ OTHER_PUNCTUATION,
+ MATH_SYMBOL,
+ CURRENCY_SYMBOL,
+ MODIFIER_SYMBOL,
+ OTHER_SYMBOL
+};
+
+/*
+ * The following macros extract the fields of the character info. The
+ * GetDelta() macro is complicated because we can't rely on the C compiler
+ * to do sign extension on right shifts.
+ */
+
+#define GetCaseType(info) (((info) & 0xE0) >> 5)
+#define GetCategory(info) ((info) & 0x1F)
+#define GetDelta(infO) (((info) > 0) ? ((info) >> 22) : (~(~((info)) >> 22)))
+
+/*
+ * This macro extracts the information about a character from the
+ * Unicode character tables.
+ */
+
+#define GetUniCharInfo(ch) (groups\[groupMap\[(pageMap\[(((int)(ch)) & 0xffff) >> OFFSET_BITS\] << OFFSET_BITS) | ((ch) & ((1 << OFFSET_BITS)-1))\]\])
+"
+
+ close $f
+}
+
+uni::main
+
+return
diff --git a/tcl/tools/white.bmp b/tcl/tools/white.bmp
new file mode 100644
index 00000000000..210bc525c13
--- /dev/null
+++ b/tcl/tools/white.bmp
Binary files differ