Warning: this is a htmlized version!
The original is across this link.
#######
#
# E-scripts on Tcl/Tk.
#
# Note 1: use the eev command (defined in eev.el) and the
# ee alias (in my .zshrc) to execute parts of this file.
# Executing this file as a whole makes no sense.
#
# Note 2: be VERY careful and make sure you understand what
# you're doing.
#
# Note 3: If you use a shell other than zsh things like |&
# and the for loops may not work.
#
# Note 4: I always run as root.
#
# Note 5: some parts are too old and don't work anymore. Some
# never worked.
#
# Note 6: the definitions for the find-xxxfile commands are on my
# .emacs.
#
# Note 7: if you see a strange command check my .zshrc -- it may
# be defined there as a function or an alias.
#
# Note 8: the sections without dates are always older than the
# sections with dates.
#
# This file is at <http://angg.twu.net/a/e/tcl.e>
#           or at <http://angg.twu.net/e/tcl.e.html>.
#        See also <http://angg.twu.net/emacs.html>,
#                 <http://angg.twu.net/a/.emacs[.html]>,
#                 <http://angg.twu.net/a/.zshrc[.html]>,
#                 <http://angg.twu.net/escripts.html>,
#             and <http://angg.twu.net/>.
#
#######



# (find-fline "/snarf/ftp/ftp.neosoft.com/languages/tcl/all.files.list")

# (find-fline "~/TK/diag.006")
# (find-fline "$S/http/www.tclfaq.wservice.com/tcl-faq/part1-5.txt.gz" 4877)




#######
#
# Draft of Osterhout's book
#
#######

# (find-fline "$S/http/www.cica.indiana.edu/cica/faq/tcl/")

# To make each part GhostViewable we have to change the first line on
# each from "%!" to "%!PS-Adobe-2.0" or something like that.

# (find-fline "$S/http/www.cica.indiana.edu/cica/faq/tcl/book.p1.ps")
# (find-fline "$S/http/www.cica.indiana.edu/cica/faq/tcl/book.p2.ps")
# (find-fline "$S/http/www.cica.indiana.edu/cica/faq/tcl/book.p3.ps")
# (find-fline "$S/http/www.cica.indiana.edu/cica/faq/tcl/book.p4.ps")

cd /snarf/http/www.cica.indiana.edu/cica/faq/tcl/

gv /snarf/http/www.cica.indiana.edu/cica/faq/tcl/book.p1.ps &
gv /snarf/http/www.cica.indiana.edu/cica/faq/tcl/book.p2.ps &
gv /snarf/http/www.cica.indiana.edu/cica/faq/tcl/book.p3.ps &
gv /snarf/http/www.cica.indiana.edu/cica/faq/tcl/book.p4.ps &



#######
#
# Eedit
#
#######

# (find-fline "~/TK/Edit")




#######
#
# Tcl8.0 source
#
#######

apti libreadlineg2-dev

pdsc /big/slinks2/dists/slink/main/source/libs/tcl8.0_8.0.4-2.dsc
cd /usr/src/tcl8.0-8.0.4/
etags $(find generic unix -name '*.[ch]')

cd /usr/src/tcl8.0-8.0.4/
debian/rules binary |& tee odrb

# (find-vldifile "tcl8.0.list")
# (find-vldifile "tcl8.0-dev.list")
# (find-fline "/usr/doc/tcl8.0/")
# (find-fline "/usr/doc/tcl8.0-dev/")

# (find-tclfile "")
# (find-tcltag "Tcl_ListObjCmd")
# (find-tclfile "generic/tclListObj.c")

# (find-tcltag "main")



######
#
# Tk8.0 source
#
######

pdsc /big/slinks2/dists/slink/main/source/libs/tk8.0_8.0.4-2.dsc
cd /usr/src/tk8.0-8.0.4/

# (find-vldifile "tk8.0.list")
# (find-vldifile "tk8.0-dev.list")
# (find-fline "/usr/doc/tk8.0/")
# (find-fline "/usr/doc/tk8.0-dev/")

# (eeman "3tk image")
# (eeman "3tk bitmap" "-data")
# (find-tkfile "generic/tkWindow.c" "\"image\"")
# (find-tkfile "generic/tkImage.c" "Tk_ImageCmd(")
# (find-tkfile "generic/tkImgBmap.c")
# (find-tkfile "tests/imgBmap.test")




#####
#
# The "placer" geometry manager
#
#####

# (find-vldifile "tk8.0-dev.list")
for i in $(grep /usr/man/man3/ /var/lib/dpkg/info/tk8.0-dev.list); do
  echo $i
  gzip -cd < $i | agrep wm
done
# (eeman "3tk place")
# (find-tkfile "tests/place.test")

cd /usr/src/tk8.0-8.0.4/tests/
expectk -Debug 1 place.test

tubak place.test




#######
#
# Tcl7.x source
#
#######

pdsc /big/slinks2/dists/slink/main/source/libs/tcl7.6_7.6p2-7.dsc
cd /usr/src/tcl7.6-7.6p2/
etags $(find generic unix -name '*.[ch]')

# (find-tcl7file "")
# (find-tcl7file "generic/tclCmdIL.c")
# (find-tcl7tag "Tcl_ListCmd")
# (find-tcl7file "generic/tclUtil.c")
# (find-tcl7tag "Tcl_Merge")




#######
#
# Some docs and examples
#
#######

(find-fline "/usr/doc/tcl8.0/")
(find-fline "/usr/doc/tcl8.0/README.gz" "Tcl newsgroup")
(find-fline "/usr/lib/tcl8.0/")

(find-enode "Regexps")
(find-elnode "Match Data")

(find-fline "~/EXPECT/")

(find-fline "/usr/doc/dotfile/")
(w3-open-local "/usr/doc/dotfile/html/dotdotfiles.html")

/snarf/http/www.cica.indiana.edu/cica/faq/tcl/

dpkg -L dotfile dotfile-doc





#######
#
# tix 4.1
#
#######

# (find-slink "tix41")
# (find-slink "tix41-dev")

# (find-vldifile "tix41.list")
# (find-vldifile "tix41-dev.list")
# (find-fline "/usr/doc/tix41/")
# (find-fline "/usr/doc/tix41/examples/")
# (find-fline "/usr/doc/tix41/txt/")

apti tix41 tix41-dev

cd /usr/doc/tix41/examples/
./widget




#######
#
# tkref
#
#######

#  «tkref»

rm -Rv /usr/src/tkref/
mkdir /usr/src/tkref/
cd /usr/src/tkref/

tar -xvzf /snarf/ftp/ftp.neosoft.com/languages/tcl/sorted/info/ref/QuickRef.tar.gz
tar -xvzf /snarf/ftp/ftp.neosoft.com/languages/tcl/sorted/packages-7.6/info/ref/tkref-4.1.0.tar.gz
tar -xvzf /snarf/ftp/ftp.neosoft.com/languages/tcl/sorted/packages-7.6/info/ref/tkrefcard.tar.gz
tar -xvzf /snarf/ftp/ftp.neosoft.com/languages/tcl/sorted/packages-8.0/info/ref/tkref-8.0.2.tar.gz

# needs "multicol.sty", which is in tetex-nonfree...
# (find-es "tex" "tetex-0.9-nonfree")
# (find-fline "/usr/src/tkref/tkref-8.0.2/")

cd /usr/src/tkref/tkref-8.0.2/
make refbase.dvi
xdvi refbase.dvi &

cd /usr/src/tkref/tkref-8.0.2/
make PERL=perl TMPDIR=/tmp
gv refguide.ps &



xdvi /usr/src/tkref/tkref-8.0.2/refbase.dvi &





#######
#
# cgi.tcl-0.7
# 99aug30
#
#######

#  «cgi.tcl»

rm -Rv /usr/src/cgi.tcl-0.7/
cd /usr/src/
tar -xvzf /snarf/http/expect.nist.gov/cgi.tcl/cgi.tcl.tar.gz
cd /usr/src/cgi.tcl-0.7/

rm -Rv	/usr/lib/tcl8.0/cgi/
mkdir	/usr/lib/tcl8.0/cgi/
cd	/usr/lib/tcl8.0/cgi/
cp -v /usr/src/cgi.tcl-0.7/cgi.tcl .
echo 'pkg_mkIndex . cgi.tcl' | tclsh

rm -Rv	/var/www/cgi-tcl/
mkdir	/var/www/cgi-tcl/
cd /usr/src/cgi.tcl-0.7/example/
cp -v *	/var/www/cgi-tcl/
for i in *.cgi; do
  echo Fixing: $i
  tclsh ../fixline1 /usr/bin < $i > /var/www/cgi-tcl/$i
  chmod 755 /var/www/cgi-tcl/$i
done
# (find-fline "/var/www/cgi-tcl/example.tcl" "production environment")
cat >> /var/www/cgi-tcl/example.tcl <<'---'
cgi_root {}
# http://localhost/cgi-tcl
---

# (find-fline "~/EXPECT/tclquery.cgi")
cd /var/www/cgi-tcl/
ln -s ~/EXPECT/tclquery.cgi .

lynx http://localhost/cgi-tcl/


# (find-fline "/var/www/cgi-tcl/")
# (find-fline "/var/www/cgi-tcl/example.tcl")
# (find-fline "/usr/lib/tcl8.0/cgi/")
# (find-fline "/usr/lib/tcl8.0/cgi/cgi.tcl")

# (find-fline "/var/log/apache/")
# (find-fline "/var/log/apache/error.log")

# (find-cgitclfile "")
# (find-cgitclfile "fixline1")
# (find-cgitclfile "example/")
# (find-cgitclfile "example/README")
# (find-cgitclfile "doc/ref.txt")
# (find-cgitclfile "doc/ref.txt" "can be given arguments to fake input")
# (find-cgitclfile "doc/ref.txt" "cgi_cgi_set")
# (find-cgitclfile "cgi.tcl" "proc cgi_cgi")
# (find-cgitclfile "cgi.tcl" "proc cgi_cgi_set")
# (find-cgitclfile "doc/ref.txt" "** Getting at the input")

# (find-fline "/usr/lib/tcl8.0/")
# (find-fline "/usr/lib/tcl8.0/parray.tcl")

expect -c '
  package require cgi
  cgi_input "name=libes&old=foo&new1=bar&new2=hello"
  puts [cgi_import_list]
  puts ""
  foreach name [cgi_import_list] {
    puts "$name [cgi_import_as $name value]"
    # cgi_import_as $name value
    # puts "$name $value"
  }
'

# (find-es "http" "tcl_http")




# (find-vldifile "tcl8.0-dev.list")
# (find-fline "/usr/doc/tcl8.0-dev/")
# (eeman "pkgMkIndex")
# (eeman "pkg_mkIndex")

cd /usr/src/cgi.tcl-0.7/example/
for i in *; do printf "%-22s" $i:; head -n 1 < $i; done
# (find-node "(sh-utils)printf invocation")





#######
#
# Using cgi.tcl
#
#######

lynx http://localhost/cgi-tcl/

cat 

# (find-fline "/var/www/cgi-tcl/")
# (find-fline "/var/www/cgi-tcl/my.cgi")

lynx http://localhost/cgi-tcl/my.cgi

#!/usr/bin/tclsh
# (find-cgitclfile "doc/ref.txt" "\ncgi_input")
# (find-cgitclfile "doc/ref.txt" "-- Variables")
# (find-cgitclfile "doc/ref.txt" "black & white")
package require cgi
cgi_input
puts "Content-type: text/plain"
puts ""
puts [cgi_import_list]
foreach v [cgi_import_list] {
  puts "$v [cgi_import $v]"
}






#######
#
# cgi.tcl-0.7 (old)
#
#######

rm -Rv /usr/src/cgi.tcl-0.7/
cd /usr/src/
tar -xvzf /snarf/http/expect.nist.gov/cgi.tcl/cgi.tcl.tar.gz
cd /usr/src/cgi.tcl-0.7/
./configure
# (find-cgitclfile "Makefile")
make PREFIX=/usr

rm -Rv /var/www/cgi.tcl
mkdir /var/www/cgi.tcl
cd /usr/src/cgi.tcl-0.7/example/
for i in *.cgi; do
  sed 's:#!/depot/path/tclsh:#!/usr/bin/tclsh:
       s:package require cgi:source cgi.tcl:'	\
	$i > /var/www/cgi.tcl/$i
done
cp README *.tcl *.pl *.cnt ../cgi.tcl /var/www/cgi.tcl/
chown -Rc edrx:edrx /var/www/cgi.tcl/
chmod 777 /var/www/cgi.tcl/*.{cgi,pl}
# (find-fline "/var/www/cgi.tcl/example.tcl" "pitch.nist")
# (find-fline "/var/www/cgi.tcl/")

lynx http://127.0.0.1/cgi.tcl/
lynx http://127.0.0.1/cgi.tcl/examples.cgi

# pkgIndex.tcl:
#
# (find-fline "/usr/lib/tcl8.0/")
# (find-fline "/usr/lib/tcl8.0/tclIndex")
# (find-fline "/usr/lib/tcl8.0/init.tcl" "# auto_mkindex --")
# (find-fline "/usr/lib/tcl8.0/init.tcl" "# pkg_mkindex --")
# (find-cgitclfile "pkgcreate")
# (find-cgitclfile "pkgIndex.tcl")
# (find-cgitclfile "Makefile" "updating of pkgIndex.tcl")
# (find-cgitclfile "cgi.tcl")

echo 'pkg_mkIndex /usr/src/cgi.tcl-0.7' | tclsh





# (w3-open-local "/snarf/http/www.beedub.com/book/2nd/library.doc.html")

mycat /var/lib/dpkg/info/tix41* |& l

ln -s /usr/src/cgi.tcl-0.7/example /var/www/cgi.tcl
chown -Rc edrx:edrx /usr/src/cgi.tcl-0.7/example

sed 's:#!/depot/path/tclsh:#!/usr/bin/tclsh:' cookie.cgi

cd /usr/src/cgi.tcl-0.7/
# (find-cgitclfile "")
# (find-fline "~/TCL/h")


# (find-fline "/snarf/http/www.tclfaq.wservice.com/tcl-faq/part1-5.txt.gz")

http://expect.nist.gov/doc/tcl-debug.ps.Z
http://conch.msen.com/~clif/TclTutor.0.96.tar.gz
ftp://130.246.72.228/pub/cookbook/cookbook.tar.gz
ftp://ftp.scriptics.com/pub/tcl/doc/engManual.tar.Z
ftp://ftp.scriptics.com/pub/tcl/doc/styleGuide.tar.Z
ftp://ftp.neosoft.com/languages/tcl/sorted/info/ref/tkrefcard.tar.gz
ftp://ftp.neosoft.com/languages/tcl/sorted/info/ref/QuickRef.tar.gz

# (find-fline "/snarf/ftp/ftp.neosoft.com/languages/tcl/all.files.list")
~/ICON/lslR2find < /snarf/ftp/ftp.neosoft.com/languages/tcl/all.files.list

agrep -i ':^|debug' /snarf/ftp/ftp.neosoft.com/languages/tcl/all.files.list

./alcatel/code/debug.tar.gz
./alcatel/extensions/debugger.gz
./sorted/packages-7.6/devel/l-debug.tar.gz

sne ftp://ftp.neosoft.com/languages/tcl/alcatel/code/tdebug-1.0.tar.gz





######
#
# TDebug-1.7
#
######

rm -Rv /usr/src/tdebug-1.7/
mkdir  /usr/src/tdebug-1.7/
cd /usr/src/tdebug-1.7/
tar -xvzf /snarf/ftp/ftp.neosoft.com/languages/tcl/stuff/TDebug-1.7.tar.gz

cd /usr/src/tdebug-1.7/
patch TdChoose.tcl <<'%%%'
1c1
< #!/usr/local/bin/wish -f
---
> #!/usr/bin/wish -f
%%%

cd /usr/src/tdebug-1.7/
lynx README.html

# (find-fline "$S/ftp/ftp.neosoft.com/languages/tcl/stuff/TDebug-1.7.tar.gz")









cd /usr/src/tk8.0-8.0.4/tests/
tubak place.test










########
#
# weblint
#
########

# (find-slink "weblint")
# (find-fline "/usr/doc/weblint/")

# (find-fline "$S/http/www.yahoo.com/Computers_and_Internet/Information_and_Documentation/Data_Formats/HTML/")




#######
#
# Cookbook
#
#######

# Not working very well, and not very interesting.

rm -Rv /usr/src/cookbook/
cd /usr/src/
tar -xvzf /snarf/ftp/130.246.72.228/pub/cookbook/cookbook.tar.gz
cd /usr/src/cookbook/

# (find-fline "/usr/src/cookbook/ch1/Make_htcl")
# (find-fline "/usr/src/cookbook/ch1/htclInit.c")
# (find-fline "/usr/src/cookbook/ch1/htclInit.c")
# (find-fline "/usr/src/cookbook/ch1/hyper.tcl")
# (find-fline "/usr/src/cookbook/ch1/contents")

cd ch1/
gcc -c -o htclInit.o htclInit.c
gcc -ltcl8.0 -ltk8.0 -o htcl htclInit.c

$(LOCAL_LIBRARIES)





########
#
# impress
#
########

cd /usr/src/
rm -Rv 04alpha
tar -xvzf /snarf/http/www.ntlug.org/~ccox/impress/impress_complete.tar.gz
cd /usr/src/04alpha/

# (find-fline "/usr/src/04alpha/impress.tcl")

lynx /snarf/http/www.ntlug.org/~ccox/impress/Docs.html
lynx /snarf/http/www.tcltk.com/tclets/impress/





######
#
# tk8.0 examples
#
######

# (code-c-d "tkex" "/usr/doc/tk8.0/examples/")
# (find-tkexfile "widget")

# Nice places to put tuba breakpoints:
# (find-tkexfile "widget" "set demo")
# (find-tkexfile "widget" "proc showCode")

# (find-fline "/usr/lib/tk8.0/demos/widget" "The canvas item types")

(cd /usr/src/tcl8.0-8.0p2/doc; ls -C
 echo; cd /usr/src/tk8.0-8.0p2/doc; ls -C) | l

# (find-tkfile "")
# (find-tkfile "generic/tkCmds.c")
# (find-fline "/usr/doc/tk8.0/examples/plot.tcl")




wget -r -nc -np -A htm,html,gif,jpg -l 20 -X man http://www.scriptics.com/

cd /usr/doc/tk8.0/examples/
a2ps -o ~/o.ps -M A4dj -6 -A --highlight-level=none \
  widget plot.tcl arrow.tcl ruler.tcl items.tcl
cd
rm o.p[0-9][0-9]
gs -sDEVICE=djet500 -r300 -sOutputFile=o.p%02d -dNOPAUSE -dBATCH o.ps
rm o.zip; zip o.zip o.p0?
laf o.zip





######
#
# neosoft text packages
#
######

# (code-c-d "tclarch" "/snarf/ftp/ftp.neosoft.com/languages/tcl/")
# (find-tclarchfile "all.files.list" "text:")

-rwxrwxr-x  1 root    neobot      24874 Oct 30  1996 Tdoc1.2.1-info.tar.gz
-rwxrwxr-x  2 root    neobot       7355 Oct 29  1996 TkEmacs1.3.README
-rwxrwxr-x  2 root    neobot       7347 May 18  1994 beth.4.1.README
-rwxrwxr-x  2 root    neobot      13695 Jan 20  1995 tcllex-5.03.tar.gz
-rwxrwxr-x  1 root    neobot      37831 Mar 10  1997 tkinfo-1.3.tar.gz

# (find-tclarchfile "sorted/packages-7.6/text/tcllex-5.03.tar.gz")
# (find-tclarchfile "sorted/packages-7.6/text/tkinfo-1.3.tar.gz")
# (find-tclarchfile "sorted/packages-7.6/text/")




######
#
# Tuba-2.5.b1
# 99nov11
#
######

#  «tuba»

rm -Rv /usr/src/tuba-2.5.b1/
cd /usr/src/
tar -xvzf /snarf/http/www.geocities.com/SiliconValley/Ridge/2549/tuba/tuba-2.5.b1.tar.gz
cd /usr/src/tuba-2.5.b1/

cd /usr/src/tuba-2.5.b1/src/
# make -f Makefile.Linux Tclparser.so	|& tee ../om
make -f Makefile.Linux SHLIB_LD='g++ -shared' Tclparser.so	|& tee ../om

# (find-fline "/usr/src/tuba-2.5.b1/")
# (find-fline "/usr/src/tuba-2.5.b1/om")
# (find-fline "/usr/src/tuba-2.5.b1/src/Makefile.Linux")

# (find-tubafile "tuba")
# (find-tubafile "tuba_lib.tcl")
# (find-tubafile ".tubarc")

# An example, using my "tubak" alias:
# (find-fline "/usr/doc/tk8.0/examples/widget")
cd /usr/doc/tk8.0/examples/
tubak widget





#######
#
# blt8.0_2.4f
#
#######

apti blt8.0 blt8.0-dev

# (find-vldifile "blt8.0.list")
# (find-vldifile "blt8.0-dev.list")
# (find-fline "/usr/doc/blt8.0/")

# (find-fline "/usr/lib/blt2.4/demos/")
cd /usr/lib/blt2.4/demos/
./barchart
./barchart2
./barchart3
./barchart4
./barchart5
./bgexec
./bgexec2
#./bgexec3
#./bgexec4
./bitmap
./busy
./calendar
#./eps
./form
./graph
./graph2
./graph3
./graph4
./graph5
./graph6
./graph7
./hier
./hier2
./hier3
./hier4
./htext
#./htext.txt
./spline
./stripchart
./tabset
./tabset2
./tabset3
./tabset4


pdsc /big/slinks2/dists/slink/main/source/libs/blt8.0_2.4f-3.dsc
cd /usr/src/blt8.0-2.4f/
debian/rules binary |& tee odrb

# (code-c-d "blt" "/usr/src/blt8.0-2.4f/")
# (find-bltfile "src/bltDnd.c")
# (find-bltfile "src/bltPs.c")
# (find-bltfile "src/bltDebug.c")
# (find-bltfile "src/bltGrHairs.c")
# (find-bltfile "src/bltGraph.c")
# (find-bltfile "demos/")
# (find-bltfile "library/")





#######
#
# Tcl/Tk CD (infomagic, aug 95)
#
#######

# (find-fline "/cdrom/alcatel/code/INDEX" "tdcad")
# (find-fline "/cdrom/alcatel/code/INDEX" "tkcron")
# (find-fline "/cdrom/alcatel/code/INDEX" "make-a-wish")
# (find-fline "/cdrom/alcatel/code/INDEX" "budge")
# (find-fline "/cdrom/alcatel/code/INDEX" "picasso")
# (find-fline "/cdrom/alcatel/code/INDEX" "tkprompt")
# (find-fline "/cdrom/alcatel/code/INDEX" "replayxt")
# (find-fline "/cdrom/alcatel/code/INDEX" "tkHelloWorld")
# (find-fline "/cdrom/alcatel/code/INDEX" "evap")
# (find-fline "/cdrom/alcatel/code/INDEX" "mankala")
# (find-fline "/cdrom/alcatel/code/INDEX" "tkcvs")
# (find-fline "/cdrom/alcatel/code/INDEX" "tcl-cgi")
# (find-fline "/cdrom/alcatel/code/INDEX" "stl-0.3")

# (find-fline "/cdrom/alcatel/code/")
# (find-fline "/cdrom/alcatel/code/stl-0.3/stl/")
# (find-fline "/cdrom/olive.kek.jp/News/")

# (find-fline "/cdrom/olive.kek.jp/News/news92/comp.lang.tcl.92_digest")

tdcad
tkcron

gv /cdrom/alcatel/workshop/1993/tcl93-proceedings/tcl93-proceedings/body/mclennan.ps

# (defun tclndx (s) (find-fline "~/CB/tcltk95-ls-lR.i" s))
# (tclndx "xf")
# (tclndx "TkSteal3.6h/TkSteal/")
# (find-fline "/cdrom/alcatel/extensions/TkSteal3.6h/TkSteal/")
# (find-fline "/cdrom/alcatel/extensions/raster0.1/README")
# (find-fline "/cdrom/alcatel/extensions/INDEX")
# (find-fline "/cdrom/alcatel/extensions/dlwish/dlwish.README")
# (find-fline "/cdrom/alcatel/code/make-a-wish/make-a-wish-1.2.README")






######
#
# MazeMan
#
######

# Not working!!!

rm -Rv /usr/src/MazeMan_1.0/
cd /cdrom/alcatel/code/MazeMan/
cp -dipvR MazeMan_1.0 /usr/src/
cd /usr/src/MazeMan_1.0/

cd /usr/src/MazeMan_1.0/src/
# (find-fline "/usr/src/MazeMan_1.0/src/Makefile")
make INCLUDES= CC=gcc LIBS='-L/usr/X11R6/lib -ltk8.0 -ltcl8.0 -lX11 -lm'

# (find-fline "/snarf/ftp/ftp.neosoft.com/languages/tcl/all.files.list")
http://www.neosoft.com/tcl

psne ftp://ftp.neosoft.com/languages/tcl/alcatel/code/MazeMan_1.0.tar.gz
# (find-fline "/snarf/ftp/ftp.neosoft.com/languages/tcl/alcatel/code/MazeMan_1.0.tar.gz")





######
#
# et - Embedded Tcl/Tk
#
######

#  «et»

# (find-slink "et")
apti et

# (find-fline "/usr/doc/et/")
# (find-fline "/usr/doc/et/html/")
# (find-etfile "")
# (find-etfile "color.c")
# (find-etfile "color.tcl")

lynx /usr/doc/et/html/index.html

# (find-vldifile "et.list")
# (find-fline "/usr/doc/et/")

pdsc /big/slinks1/dists/slink/main/source/devel/et_80b2-8.dsc
cd /usr/src/et-80b2/
make CFLAGS="-O" \
 LIBS="-ltk8.0 -ltcl8.0 -ldl -L/usr/X11R6/lib -lX11 -lm -lc" \
 ET2CFLAGS="-I/usr/lib/tk8.0 -I/usr/lib/tcl8.0"		\
 color	|& tee omc

cd /usr/src/et-80b2/

# (find-etfile "omc")

# (find-etfile "doc/ET.doc" 1234)
# (find-etfile "Makefile")
# (find-etfile "doc/Makefile")
# (find-etfile "debian/")
# (find-etfile "debian/rules")

# (find-etfile "et80.c" 562)
# (find-etfile "et80.c" 754)

# (find-etfile "doc/ET.doc")
# (find-fline "/usr/doc/et/html/ET0015.html")
lynx /usr/doc/et/html/ET0015.html

# (code-c-d "et" "/usr/src/et-80b2/")
# (find-etfile "Makefile")

# (find-etfile "")
# (find-etfile "" "httpd")




#####
#
# tclsh's interactive mode
#
#####

# (find-fline "/usr/lib/tcl8.0/init.tcl" "interactive")
# (find-fline "/usr/lib/tcl8.0/tclAppInit.c" "interactive")
# (find-tclfile "")
# (find-tclfile "unix/Makefile" "\ntclsh:")
# (find-tclfile "odrb" "tclsh")

# (find-tclfile "unix/rl-tclMain.c")
# (find-tclfile "unix/tclAppInit.c")




#####
#
# swig - a more pretentious et
# 99nov21
#
#####

apti swig swig-doc swig-examples

# (find-vldifile "swig.list")
# (find-vldifile "swig-doc.list")
# (find-vldifile "swig-examples.list")
# (find-fline "/usr/doc/swig/examples/OpenGL/")

# (find-fline "/usr/doc/swig/examples/tcl/tree/")

cd /usr/doc/swig/
gzip -dv Makefile.template

cd /usr/doc/swig/examples/tcl/tree/
make SWIG=swig	|& tee om

cd /usr/doc/swig/examples/tcl/graph/
gzip -dv *.gz
make SWIG=swig	|& tee om
#
cd /usr/doc/swig/examples/tcl/graph/
wish graph.tcl

# (find-swigefile "tcl/graph/graph.tcl" "Button 2 adds")


cd /usr/doc/swig/html/
lynx	     /usr/doc/swig/html/Introduction.html
edrxnetscape /usr/doc/swig/html/Introduction.html &

rm -Rv /tmp/html/
mkdir  /tmp/html/
cd     /tmp/html/
wget -nv -r -A html http://127.0.0.1/doc/swig/html/Index.html |& tee o
perl -nle 'm:^.*html/([^" ]+) : && print $1' < o | sort

# (find-node "(sed)Addresses")

# (find-fline "/usr/doc/swig/html/")


# (find-fline "/usr/doc/swig/")
# (find-fline "/usr/doc/swig/examples/")
# (find-fline "/usr/doc/swig/examples/README.gz")





edrxnetscape /usr/doc/swig/html/Contents.html

# LIBS       = -L$(MESA)/lib -lMesaaux -lMesatk -lMesaGLU -lMesaGL -lXext
# XLIBS      = -L/usr/X11R6/lib -lX11
# INCLUDE    = -I$(MESA)/include -I/usr/X11R6/include
# (find-fline "/usr/doc/swig/examples/OpenGL/")
# (find-fline "/usr/doc/swig/examples/OpenGL/Makefile")
# (find-fline "/usr/doc/swig/Makefile.template")

cd /usr/doc/swig/examples/OpenGL/
gzip -dv $(find *) ../../Makefile.template.gz

cd /usr/doc/swig/examples/OpenGL/
make LIBS='-lMesaaux -lMesatk -lMesaGLU -lMesaGL -lXext'	\
     INCLUDE='-I/usr/include/GL -I/usr/X11R6/include'		\
     SWIG=swig	\
     tcl

# Falta o glaux.h.





######
#
# moodss
#
######

# (find-fline "/usr/doc/moodss/")
# (find-vldifile "moodss.list")

# (find-fline "/usr/doc/moodss/INSTALL")

wish moodss ps cpustats memstats





######
#
# Alguns programinhas educativos
#
######

puts .[exec echo foo].
puts .[exec false 2> /dev/null].
puts .[system {echo foo; echo bar}].
puts .[catch [exec true]].

proc L {a} {puts -nonewline "$a; "; return [list $a]}
puts [L [L [L a]]]
puts [L [L [L ""]]]
puts [L [L [L \\]]]
puts [L [L [L \{]]]
puts [L [L [L \}]]]
puts [L [L [L {a b}]]]
puts [L [L [L {a\{ b}]]]
puts [L [L [L \n]]]
puts "{"

proc id {arg} {return $arg}
proc E {script} {
  global errorInfo
  if [set err [catch "id $script" output]] {
    regexp "^\[^\n\]*" $errorInfo firstline
    puts $firstline
  } else {
    puts $output
  }
}
E $()
E $
E {$foo}

expect -c 'foreach s [info globals] {puts $s}'  | sort
expect -c 'foreach s [info commands] {puts $s}' | sort

echo 'foreach s [info globals] {puts $s}' | tclsh -f - | sort
echo 'foreach s [info commands] {puts $s}' | tclsh -f - | sort
echo 'foreach s [info commands ::*] {puts $s}' | tclsh -f - | sort

# (find-fline "/usr/lib/tcl8.0/init.tcl")





(global-set-key [f7] 'tcl-send-region)

# (find-enode "Keyboard Macros")
# (find-elnode "Keyboard Macros")
last-kbd-macro
(setq last-kbd-macro "\C-a\C-[xtosp\C-m\C-[[D\C-[w\C-a<li>{\C-e}\C-a\C-[[B-- \C-y \C-a\C-[[B")

(insert-kbd-macro 'mf)

C-c ESC r	-- tcl-send-region





######
#
# Parsers for Tcl (recycling)
#
######

# (find-tcl7file "")
# (find-tcl7file "generic/tclParse.c")
# (find-tcl7file "generic/tclInt.h" "ParseValue")
# (find-tcl7file "tests/parse.test")

agrep Tcl /usr/src/tcl7.6-7.6p2/generic/tclParse.c

(fooi
"TCL_BACKSLASH,   " "/"
"TCL_CLOSE_BRACE, " "}"
"TCL_COMMAND_END, " "0"
"TCL_DOLLAR,      " "$"
"TCL_NORMAL,      " "a"
"TCL_OPEN_BRACE,  " "{"
"TCL_OPEN_BRACKET," "["
"TCL_QUOTE,       " "\""
"TCL_SPACE,       " " "
)

0aaaaaaaa 0   aa
aaaaaaaaaaaaaaaa
 a"a$aaaaaaaaaaa
aaaaaaaaaaa0aaaa
aaaaaaaaaaaaaaaa
aaaaaaaaaaa[/0aa
aaaaaaaaaaaaaaaa
aaaaaaaaaaa{a}aa

# (find-elfile "tcl-mode.el")
# (find-fline "/usr/src/tuba-2.5.b1/")
# (find-fline "/usr/src/tuba-2.5.b1/src/")
# (find-fline "/usr/src/tuba-2.5.b1/src/README" "VERY QUICK")
# (find-fline "/usr/src/tuba-2.5.b1/src/Tclparser.tcl")

# Three parsers, each to be run with M-x eet:

source /usr/src/tuba-2.5.b1/src/Tclparser.tcl
proc tset {vname val} {puts "$vname:=$val"; upvar $vname v; set v $val}
tset code {if [$a=="!"] {puts bang} else {puts $a}; [put${s} foo] bar}
tset tp [new_Tclparser $code 1]
while 1 {
  tset tok [$tp gettok]
  if {$tok==[geteof]} break
}
delete_Tclparser $tp




source /usr/src/tuba-2.5.b1/src/Tclparser.tcl
proc tset {vname val} {puts "$vname:=$val"; upvar $vname v; set v $val}
proc parse_recursively {code {pre {}}} {
  set tp [new_Tclparser $code 1]
  while 1 {
    puts -nonewline $pre
    tset tok [$tp gettok]
    if {$tok==[geteof]} break
    if [regexp "^\[\[\{\"\]" $tok] {
      parse_recursively $tok "  $pre"
    }
  }
  delete_Tclparser $tp
}
tset code {if {$a=="!"} {puts bang} else {puts $a}; [put${s} foo] bar}
parse_recursively $code




source /usr/src/tuba-2.5.b1/src/Tclparser.tcl
proc tset {vname val} {puts "$vname := $val"; upvar $vname v; set v $val}
proc parse_recursively {code {pre {}}} {
  set tp [new_Tclparser $code 1]
  while 1 {
    switch [set tok [$tp gettok]]	\
	[geteof] break			\
	[geteos] {puts "$pre<<EOS>>"}	\
	default {
      puts "$pre$tok"
      if [regexp "^\[\[\{\"\]" $tok] {
	parse_recursively $tok "  $pre"
      }
    }
  }
  delete_Tclparser $tp
}
tset code {if {$a=="!"} {puts bang} else {puts $a}; [put${s} foo] bar}
parse_recursively $code


# (find-node "(flex)Top")





#####
#
# splitter
#
#####

proc splitter0 {str p1p2} {
  foreach {p1 p2} $p1p2 {}
  return [list [string range $str 0 [expr $p1-1]] \
      [string range $str $p1 $p2] \
      [string range $str [expr $p2+1] end]]
}
 regexp -indices "2.*4" 0123456789 r
 foreach {beg line rest} [splitter0 0123456789 $r] {}
 puts [splitter0 0123456789 $r]
 # -> 01 234 56789

proc splitter {pat str} {
  set rest $str
  while {[regexp -indices $pat $rest {} range]} {
    foreach {prematch match rest} [splitter0 $rest $range] {}
    lappend pieces $prematch $match
  }
  lappend pieces $rest
  return $pieces
}
 puts [splitter "(<\[^>\]*>)" "012<34>5<67>88"]
 # -> 012 <34> 5 <67> 88

 set str [exec cat /home/root/ZHTML/escripts/kernel.e]
 set pat1 "\n((#+|;+|\\\\|\\\\;)  «\[!-~\]+»\n)"
 set spl [splitter $pat1 $str]
 foreach {nonmatch match} $spl {
   puts -nonewline "([string length $nonmatch]), $match"
 }


# Constant/linear/linear*log time?
# (find-fline "/usr/src/tcl7.4/tclVar.c" "Tcl_AppendCmd(")
# (find-fline "/usr/src/tcl7.4/tclVar.c" "Tcl_LappendCmd(")




#####
#
# encode_entities
#
#####

isoto850 < /usr/lib/perl5/HTML/Entities.pm
isoto850 < /usr/lib/perl5/HTML/Entities.pm | grep "[Ç-ÿ]" | tee ~/o
# (find-fline "~/o")
# (find-fline "/usr/lib/perl5/HTML/Entities.pm")

for {set x 128} {$x<256} {incr x} {
  set Entname([format "%c" $x]) [format "%c" $x]
}
# puts $Entname(À) -> À
foreach {char entname} {
  Æ AElig  Á Aacute  Acirc  À Agrave Å Aring  à Atilde Ä Auml
  Ç Ccedil É Eacute Ê Ecirc  È Egrave Ë Euml   Í Iacute Ï Iuml
  Ó Oacute Ô Ocirc  Ò Ograve Õ Otilde Ö Ouml   Ú Uacute Û Ucirc
  Ù Ugrave Ü Uuml   á aacute â acirc  æ aelig  à agrave å aring
  ã atilde ä auml   ç ccedil é eacute ê ecirc  è egrave ë euml
  í iacute î icirc  ì igrave ï iuml   ó oacute ô ocirc  ò ograve
  õ otilde ö ouml   ß szlig  ú uacute û ucirc  ù ugrave ü uuml
  ¦ ordf    « laquo  ø deg    § ordm   » raquo
  & amp  > gt  < lt  " quot } {
    set Entname($char) "&$entname;"
  }





#####
#
# expand (Bill Duquette's html generator)
#
#####

cd $S/http/www.cogent.net/~duquette/expand/
psne http://www.cogent.net/~duquette/expand/expand1.2.tar.gz

rm -Rv /usr/src/expand1.2/
mkdir  /usr/src/expand1.2/
cd     /usr/src/expand1.2/
unzip -a $S/http/www.cogent.net/~duquette/expand/expand12.zip

# (find-fline "/usr/src/expand1.2/")


# (find-fline "~/TCL/html.004")




#####
#
# Some notes on an old version of my html generator
#
#####

# (find-enode "Fill Commands")
# (find-enode "Fill Commands" "adaptive-fill-mode")
# (find-enode "Text Mode" "indented-text-mode")

# (find-fline "~/.zshrc" "date")
date --utc '+%Y%b%d %k:%M' | tr A-Z a-z
date -u '+%Y%b%d %k:%M' | tr A-Z a-z
date -r ~/TCL/html.004 -u '+%Y%b%d %k:%M' | tr A-Z a-z

puts [exec date -u "+%Y%b%d %k:%M" | tr A-Z a-z]

# My timezone is wrong. Shit.

# (find-vldifile "libc6.list")
# (find-vldifile "timezones.list")
# (find-fline "/usr/sbin/tzconfig")
# (find-fline "/usr/bin/tzselect")




######
#
# finer control on evaluation
#
######

proc id {arg} {return $arg}
proc E {script} {
  global errorInfo
  if [set err [catch "id $script" output]] {
    regexp "^\[^\n\]*" $errorInfo firstline
    puts $firstline
  } else {
    puts $output
  }
}



set a1 {[set $a2]}
set a2 a3
set a3 {[set $a4]}
set s4 a5

proc jaa {args} { return [uplevel #0 eval list [list $args]] }
puts {jaa $a1 $a1}
puts [jaa {$a1 $a1}]
puts [jaa "$a1 $a1"]
puts [jaa {$a1} {$a1}]
puts [jaa $a1 $a1]




set a1 {$a2}
set a2 foo
proc id {x} { return $x }
proc e {s} { uplevel #0 id [list $s] }
puts [e {$a1}]

proc map {F list1} {
  set list2 {}
  foreach item $list1 {
    lappend list2 [eval $F [list $item]]
  }
  return $list2
}
proc le {ss} { map e $ss }
puts [le {$a1 $a1}]
proc es {args} { le $args }
puts [es {$a1} {$a1}]
puts [es {$a1 $a1}]


puts aa
puts [list aa]
puts [list [list aa]]
puts ""
puts {$aa}
puts [list {$aa}]
puts [list [list {$aa}]]
puts ""
puts [lindex {$aa $aa} 0]
puts [lindex {{$aa} {$aa}} 0]
puts [lindex {{{$aa}} {{$aa}}} 0]
puts ""
puts [list {$a1} {$a1}]
puts [list {{$a1}} {{$a1}}]
puts ""
puts [list aa {aa} {$aa}]
puts [list \\ \{ \$a \$\{\\a ]
puts \$\{\\a

Acho que o "list" sempre põe chaves -- exceto pelos elementos que não
têm nenhum caracter especial.

# (find-tcl7file "")
# (find-tcl7file "tclBasic.c" "\"append\"")

Tcl_ListCmd

Como é que eu faço um "eval" em que cada argumento passe protegido?
Quero isso aqui, ó:

proc map {F list1} {
  set list2 {}
  foreach item $list1 { lappend list2 [eval $F [list $item]] }
  return $list2
}
proc foo {args} {
  eval map puts [list $args]
  eval map puts [list [map list $args]]
}
foo \{a \\a \$a


Um grande mistério: o que é

eval puts \{a b\}

?

Ah, o concat faz algo bem bobo com os strings que ele concatena... ou
não?

Qual é a diferença entre concat e join? Como o concat age sobre
não-listas?

O concat só sanduícha espaços, i.e., ele é quase a mesma coisa que
"join $list", só que o concat recebe seus argumentos separados.

A transformação que leva um string em "list $string" é horrivelmente
complicada e eu deveria pôr um nível de abstração em torno dela pra
usá-la mais claramente; aí o tcl passaria a ter tipos (mesmo que só na
cabeça do programador). Se eu esqueço os tipos com profundidades
mistas os tipos básicos passam a ser string, lista de strings, lista
de lista de strings... e uma lista de lista de strings, se tiver sido
criada do jeito certo, não sintetizada às pressas com "$a $b"s (mas
acho que "[list $a] [list $b]" dá o mesmo que [list $a $b], pela
definição do concat) deve ser invariante por map {map list} $list,
acho.





#####
#
# plugin
#
######

/snarf/ftp/ftp.scriptics.com/pub/tcl/plugin/tclplug20-x86-linux2.tar.gz
/snarf/http/sunscript.sun.com/dist/plugin
/snarf/http/sunscript.sun.com/dist/plugin/index.html
/snarf/http/sunscript.sun.com/dist/plugin/old
/snarf/http/sunscript.sun.com/dist/plugin/old/index.html
/snarf/http/sunscript.sun.com/dist/plugin/tclplug20-src.tar.gz

tar -tvzf /snarf/ftp/ftp.scriptics.com/pub/tcl/plugin/tclplug20-x86-linux2.tar.gz

# (find-fline "/snarf/ftp/ftp.scriptics.com/pub/tcl/plugin/tclplug20-x86-linux2.tar.gz")

rm -Rv /usr/src/tclplug20-x86-linux2/
cd /usr/src/
tar -xvzf $S/ftp/ftp.scriptics.com/pub/tcl/plugin/tclplug20-x86-linux2.tar.gz
cd /usr/src/tclplug20-x86-linux2/

su -s install.sh edrx

# (find-fline "~/.netscape/")
# (find-fline "~edrx/.netscape/")
# (find-fline "~edrx/.netscape/plugin-list")

/home/edrx/.netscape/plugins/libtclp2.0.so 885356030 application/x-tcl: .tcl:Tcl Web Applets;
pluginName=Tcl Plugin 2.0
pluginDescription=Tcl Plugin 2.0 (2.0.200). Executes tclets found in Web pages.	     See the <a href=http://sunscript.sun.com/plugin/>Tcl	     Plugin</a> home page for more details.




rm -Rv /usr/src/tclplugin2.0/
cd /usr/src/
tar -xvzf $S/http/sunscript.sun.com/dist/plugin/tclplug20-src.tar.gz
cd /usr/src/tclplugin2.0/

# (find-fline "/usr/src/tclplugin2.0/")
# (find-fline "/usr/src/tclplugin2.0/README" "--with")

cd /usr/src/tclplugin2.0/tcl8.0/unix/
./configure --enable-shared	|& tee oc
make	|& tee om

# (find-fline "/usr/src/tclplugin2.0/tcl8.0/unix/om" "duplicate case value")
# (find-fline "/usr/src/tclplugin2.0/tcl8.0/generic/tclPosixStr.c" 328)

cd /usr/src/tclplugin2.0/tk8.0/unix/
./configure	|& tee oc
make	|& tee om

cd /usr/src/tclplugin2.0/plugin2.0/unix/
configure \
  --with-tcl=/usr/src/tclplugin2.0/tcl8.0/unix	\
  --with-tk=/usr/src/tclplugin2.0/tk8.0/unix		\
  --with-mozilla=/home/root/.netscape	|& tee oc




######
#
# itcl
#
######

apti itcl3.0 itcl3.0-dev

# (find-vldifile "itcl3.0.list")
# (find-vldifile "itcl3.0-dev.list")
# (find-fline "/usr/doc/itcl3.0/")
# (find-fline "/usr/doc/itcl3.0/iwidgets3.0.0/examples/catalog")
# (find-fline "/usr/lib/iwidgets3.0.0/scripts/")

apti itcl3.0 itcl3.0-dev
cd /usr/doc/itcl3.0/iwidgets3.0.0/examples/
/usr/doc/itcl3.0/iwidgets3.0.0/examples/catalog

pdsc /big/slinks2/dists/slink/main/source/libs/itcl3.0_3.0-1.dsc
cd /usr/src/itcl3.0-3.0/


psner -A htm,html,gif,jpg -X TclTkMan -l 200 http://www.tcltk.com/ |& tee ~/o

cd $S/http/www.tcltk.com/
setopt extendedglob
# rm -Rv *~TclTkMan
unsetopt extendedglob

cd $S/http/
wget -A htm,html,gif,jpg -X TclTkMan -l 200 -r -k -nc http://www.tcltk.com/


rm -Rv /usr/src/itcl-intro/
cd /usr/src/
tar -xvzf $S/http/www.tcltk.com/itcl/doc/itcl-intro.tar.gz
cd /usr/src/itcl-intro/

# On autoloading and auto_mkindex:
gv -page 63 -scale 2 itclitk-a4.ps





######
#
# xf4.3
#
######

rm /usr/src/xf/
cd /usr/src/
tar -xvzf $S/http/home.nycap.rr.com/drlabelle/download/xf43.tar.gz
cd /usr/src/xf/

# (find-fline "/usr/src/xf/")
# (find-fline "/usr/src/xf/Install.txt")

edrxnetscape Help/index.html





#####
#
# tclhttpd
#
#####

rm /usr/src/tclhttpd2.2.1/
cd /usr/src/
tar -xvzf $S/http/www.scriptics.com/ftp/httpd/tclhttpd2.2.1.tar.gz
cd /usr/src/tclhttpd2.2.1/

# (find-fline "/usr/src/tclhttpd2.2.1/")
# (find-fline "/usr/src/tclhttpd2.2.1/README")

cd /usr/src/tclhttpd2.2.1/
tclsh bin/httpd.tcl -debug true

lynx http://127.0.0.1:8015/




#####
#
# modemtcl
#
#####

cd /usr/src/
rm -Rv modemtcl-0.1/
mkdir modemtcl-0.1/
cd /usr/src/modemtcl-0.1/
tar -xvzf $S/http/www.fe.msk.ru/~vitus/works/modemtcl-0.1.tar.gz

cd /usr/src/modemtcl-0.1/
make modemtcl
man2t < modemtcl.1 | l

# (find-fline "/usr/src/modemtcl-0.1/")
# (find-fline "/usr/src/modemtcl-0.1/dumbterm.tcl" "/dev/ttyS")

cd /usr/src/modemtcl-0.1/
rm /var/lock/LCK..ttyS2
modemtcl dumbterm.tcl


# (find-fline "/usr/src/modemtcl-0.1/")

man 3tcl fileevent





######
#
# plplot (with Tcl)
#
######

apti plplot plplot-doc plplot-dev plplot-tcl

# (find-vldifile "plplot-tcl.list")
# (find-fline "/usr/doc/plplot-tcl/")

# (find-node "(plplot)Top")

# (find-vldifile "octave-plplot.list")
# (find-vldifile "plplot.list")
# (find-vldifile "plplot-dev.list")
# (find-vldifile "plplot-doc.list")
# (find-vldifile "plplot-tcl.list")

# (find-fline "/usr/lib/tcl8.0/plplot/")
# (find-fline "/usr/doc/plplot/examples/tcl/")
# (find-fline "/usr/doc/plplot/examples/tk/")

# (find-fline "/usr/doc/plplot/examples/tcl/tcldemos.tcl")
# (find-fline "/usr/doc/plplot/examples/tcl/")
# (find-node "(plplot)API")

# Working:
cd /usr/doc/plplot/examples/tcl/
pltcl -e 'plsdev xwin; plinit; source tcldemos.tcl
  proc run {args} { foreach n $args {
    puts "$n:"; $n; puts "$n ok"
  }}
  run 1 2 3 4 5 6   8 9 10   12 13 14 15 16 17 18
  exit'


# (find-plpfile "bindings/tk/tkMain.c" "pltkMain(int")
# (find-plpfile "bindings/tk/tkMain.c" "argTable")

# (find-node "(plplot)Initializing")


# Not working (but almost :-))
#
rm -Rv /usr/src/plplote/
mkdir  /usr/src/plplote/
cd     /usr/src/plplote/
cp -iv /usr/doc/plplot/examples/c/* .
gzip -dv *

cd     /usr/src/plplote/
gcc tutor.c

cd     /usr/src/plplote/
gcc -E tutor.c  > tutor.E
gcc -ltk8.0 -ltcl8.0 -L/usr/X11R6/lib -lX11 -ldl -lm \
  -lplplotdtk -lMatrix tutor.c |& tee o

# (find-fline "/usr/src/plplote/")
# (find-fline "/usr/src/plplote/tutor.c")
# (find-fline "/usr/src/plplote/plcdemos.h")
# (find-fline "/usr/src/plplote/Makefile")

# (find-plpfile "")
# (find-plpfile "bindings/tcl/")
# (find-plpfile "bindings/tk/")
# (find-plpfile "bindings/tk/tkMain.c")

pltcl -e 'puts foo'



/usr/lib/libPLcxx.so
/usr/lib/libplplotdtk.a
/usr/lib/libplplotdX.a
/usr/lib/libPLcxx.a
/usr/lib/libMatrix.a
/usr/lib/libplplotdX.so
/usr/lib/libplplotdtk.so
/usr/lib/libMatrix.so

# (find-fline "/usr/doc/plplot-dev/")
# (find-fline "/usr/doc/plplot-doc/")
# (find-fline "/usr/doc/plplot-tcl/")
# (find-fline "/usr/doc/plplot/")
# (find-vldifile "plplot-dev.list")
# (find-vldifile "plplot-doc.list")
# (find-vldifile "plplot-tcl.list")
# (find-vldifile "plplot.list")




# (find-vldifile "plotmtv.list")
# (find-vldifile "quickplot.list")
# (find-vldifile "sciplot.list")





#####
#
# sciplot
#
#####

Pgrep m/sciplot/
apti sciplot lesstifg lesstifg-dev
# (find-vldifile "sciplot.list")
# (find-fline "/usr/doc/sciplot/")
cd /usr/doc/sciplot/
edrxnetscape SciPlot.html

# (find-fline "/usr/doc/sciplot/examples/")

apti lesstifg-dev

cd /tmp
gcc -o ./xyplot -I/usr/X11R6/include /usr/doc/sciplot/examples/xyplot.c -lsciplot
xyplot /usr/doc/sciplot/examples/data.txt

cd /tmp
gcc -o ./realtime /usr/doc/sciplot/examples/realtime.c -lsciplot
realtime



# (find-fline "/usr/doc/octave-plplot/")
# (find-vldifile "octave-plplot.list")




#####
#
# quickplot
#
#####

Pgrep m/quickplot/
apti quickplot
# (find-vldifile "quickplot.list")
# (find-fline "/usr/doc/quickplot/")

test_data | quickplot -Pv &
man quickplot





#####
#
# plotmtv
#
#####

apti plotmtv
# (find-vldifile "plotmtv.list")
# (find-fline "/usr/doc/plotmtv/")
# (find-fline "/usr/doc/plotmtv/examples/")
cd /usr/doc/plotmtv/examples/
./run.csh



pdsc /big/slinks2/dists/slink/main/source/math/plplot_4.99j-8.dsc
debian/rules binary	|& tee odrb




#####
#
# tkirc
#
#####

# (find-vldifile "tkirc.list")
# (find-fline "/usr/bin/tkirc")
# (find-fline "/usr/doc/tkirc/")
# (find-fline "~/.tkircrc")



#####
#
# Debugging ".so"s
#
#####

# (find-fline "$S/http/www.cica.indiana.edu/cica/faq/tcl/book.examples" "31")
# (find-fline "~/TCL/simple2.c")
# (find-fline "~/TCL/simple2.tcl")

# (find-tclfile "odrb" " -shared")

cd ~/TCL/
gcc -shared -o simple2.so simple2.c





#####
#
# visual-tcl
#
#####

apti visual-tcl

# (find-vldifile "visual-tcl.list")
# (find-fline "/usr/doc/visual-tcl/")
# (find-fline "/usr/doc/examples/visual-tcl/")

# (find-fline "/usr/bin/vtcl")
# (find-fline "/usr/lib/visual-tcl/vt.tcl")
# (find-fline "/usr/lib/visual-tcl/vt.tcl" "proc vTcl:main")

cd /usr/doc/examples/visual-tcl/
vtcl

cd /usr/doc/examples/visual-tcl/
tubak /usr/lib/visual-tcl/vt.tcl




#####
#
# very small httpd, from comp.lang.tcl/dejanews
#
#####

>> Forum: comp.lang.tcl 
   >> Thread: simple httpd written in tk/tcl 
     >> Message 1 of 1

Subject: Re: simple httpd written in tk/tcl
Date: 1999/04/07
Author: Samy Zafrany <samy@mail.netanya.ac.il>
        Posting History 
 
David S Cargo wrote:
 
> I am trying to find the simple httpd written in tk/tcl that has been
> mentioned in the FAQ.  The location given in the FAQ,
> http://arsenio.mit.edu:8001 no longer responds to http requests.  The
> contact, jrq@mtl.mit.edu (John R. Gilbert) is no longer a valid user on
> that system.
>
> I just want a supersimple httpd to run on a single system to serve up
> static pages on a very small intranet.  I have downloaded tclhttpd 2.1.7
> from Scriptics, but is more complex than I personally need.
>
> I have used Alta Vista to search the web and Deju News to search news
> archives, but I didn't find an alternate source.
>
> --David S. Cargo
 
The simplest httpd that I ever seen is due to Harald Kaplan. I do not
recall were I got it,
but since it's so short, here it is (it may look too short to be useful,
but it is!), with the author's words in comment:
 
# <html><head><title>DustMote source.</title></head>
# <body bgcolor=white><plaintext>
 
# This web server program has a smaller source than any other that I have
# seen or heard of. Its name is DustMote, and I hereby place it in the
# public domain.
 
# I wrote it in the Tcl language because Tcl is free, easy, stable, and
# well documented. For more documentation than comes with the Tcl
# download, one may purchase Brent B. Welch's excellent book, "Practical
# Programming in Tcl and Tk," second edition, Prentice Hall PTR. It is
# well worth the money. It is true that Tcl is not remarkably speedy, but
# it is fast enough for my site, and, though not multi-threaded, it can
# handle many clients at the same time asynchronously, by the use of
# non-blocking channels.
 
# Of course, there are now many freeware server programs to be downloaded
# from the web, and most of them are sturdy professional jobs that go like
# lightning and swarm with useful features. The businessperson ought to
# use one of those. I am an amateur, so I had to write the program myself.
# There are nearly no features. All DustMote can do is serve files, both
# text and image. I offer it to fellow amateurs, so they can ignore other
# people's features and think up new features that have never been thought
# up before.
 
# If you do use my program, remember to change the definition of "root" to
# suit your computer. Be sure to use forward slashes, not backward, or
# else double them so Tcl will understand them rightly.
 
# Please E-mail complaints to hmk@nadn.navy.mil and do not try to spare my
# feelings. The date of this revision is May 26, 1998.
 
# Yours truly,
 
# Harold Kaplan.
 
set root "/var/www"
set default "index.html"
set port 80
 
proc bgerror {trouble} {puts stdout "bgerror: $trouble"} 
 
proc answer {socketChannel host2 port2} {
  fileevent $socketChannel readable [list readIt $socketChannel]
}
 
proc readIt {socketChannel} {
  global root default
  fconfigure $socketChannel -blocking 0
  set gotLine [gets $socketChannel]
  if { [fblocked $socketChannel] } then {return}
  fileevent $socketChannel readable ""
  set shortName "/"
  regexp {/[^ ]*} $gotLine shortName
  set many [string length $shortName]
  set last [string index $shortName [expr $many-1] ]
  if {$last=="/"} then {set shortName $shortName$default }
  set wholeName $root$shortName
 
  if [catch {set fileChannel [open $wholeName RDONLY] } ] {
    puts $socketChannel "HTTP/1.0 404 Not found"
    puts $socketChannel ""
    puts $socketChannel "<html><head><title><No such URL.></title></head>"
    puts $socketChannel "<body><center>"
    puts $socketChannel "The URL you requested does not exist on this site."
    puts $socketChannel "</center></body></html>"
  } else {
    fconfigure $fileChannel -translation binary
    fconfigure $socketChannel -translation binary -buffering full
    puts $socketChannel "HTTP/1.0 200 OK"
    puts $socketChannel ""
    set work [read $fileChannel]
    puts $socketChannel $work
    close $fileChannel
  }
    
  close $socketChannel
}

 
socket -server answer $port
vwait forEver




#####
#
# dustmote 1.04
# 99nov11
#
#####

# (find-fline "$S/ftp/ftp.unicamp.br/pub/simtelnet/win95/webbrows/dumo104.zip")





#####
#
# tcltutor - new version
#
#####

rm -Rv /usr/src/TclTutor/
cd /usr/src/
tar -xvzf $S/http/www.msen.com/~clif/tutor097.tar.gz
cd /usr/src/TclTutor/
# (find-tcltfile "")
# (find-tcltfile "conf.tk")
patch conf.tk <<'%%%'
1094,1095c1094,1097
< set install_dir "/usr/local/lib/tcltutor/lessons"
< set bin_dir "/usr/local/bin"
---
> # set install_dir "/usr/local/lib/tcltutor/lessons"
> # set bin_dir "/usr/local/bin"
> set install_dir "/usr/src/TclTutor/local/lib/tcltutor/lessons"
> set bin_dir "/usr/src/TclTutor/local/bin"
%%%

cd /usr/src/TclTutor/
# ./Configure

tubak conf.tk
# (find-tcltfile "conf.tk")

cd /usr/src/TclTutor/local/bin/
./TclTutor.tk





#####
#
# Crim - interface to the 2D diagram
#
#####

# (find-fline "~/TK/diaglib.013")
# (find-fline "/usr/doc/tk8.0/examples/items.tcl")

# Version 0:

canvas .c -width 500 -height 350 -relief sunken -borderwidth 2
pack   .c -expand yes -fill both

proc blop {x y args} {
  eval .c create rectangle \
    [expr $x*20+5] [expr $y*20+5] [expr $x*20+20] [expr $y*20+20] \
    -tags $x,$y
  .c bind $x,$y <Enter> ".c itemconf $x,$y -fill yellow"
  .c bind $x,$y <Leave> ".c itemconf $x,$y -fill {}"
}

blop 0 0
blop 1 0
blop 2 1



# Version 1:

canvas .c -width 500 -height 350 -relief sunken -borderwidth 2
pack   .c -expand yes -fill both

# Globals:	(behaves like:)
# xyrets()	xyrets(1,0) -> 0,0  (or {})
# xyfail()	xyfail(2,1) -> 3,0  (or {})
# xynow		xynow -> 2,1 (or {})
set xynow {}

proc blop {x y ret fail} {
  global xyrets xyfails
  eval .c create rectangle \
    [expr $x*20+5] [expr $y*20+5] [expr $x*20+20] [expr $y*20+20] \
    -tags $x,$y
  .c bind $x,$y <Enter> "enter-blop $x,$y"
  .c bind $x,$y <Leave> "leave-blop $x,$y"
  set xyrets($x,$y) $ret
  set xyfails($x,$y) $fail
}

proc color-blop {xy this_ret_fail_retfail} {
  global xyrets xyfails
  if {$xy==""} {return}
  set xyret $xyrets($xy)
  set xyfail $xyfails($xy)
  set xyretfail {}
  if {$xyret==$xyfail} {set xyretfail $xyret; set xyret {}; set xyfail {}}
  foreach axy [list $xy $xyret $xyfail $xyretfail] \
      color $this_ret_fail_retfail {
    if {$axy!=""} {.c itemconf $axy -fill $color}
  }
}
proc enter-blop {xy} {
  global xynow; if {$xynow!=$xy} {leave-blop $xynow}
  color-blop $xy {mintcream yellow red orange}
  set $xynow $xy
}
proc leave-blop {xy} {
  global xynow
  if {$xy!={}} {color-blop $xy {{} {} {} {}}}
  set $xynow {}
}

blop 0 0 {} {}
blop 1 0 0,0 {}
blop 2 1 1,0 1,0
blop 2 2 1,0 2,1



Próximos passos: 1) passo a ter um array indexado por x,y que diz quem
é o ret e quem é o fail de um cara; cada um deles pode ser {}. Na hora
de colorir o fail fica em vermelho, o ret em amarelo, e se os dois
forem o mesmo a gente colore de laranja. O próprio carinha sob o
cursor ganha um verde bonito. 2) Passo a ter um outro array que diz o
texto pra mostrar embaixo quando 





######
#
# tkinspect
#
######

psne $ALCATCL/alcatel/code/tkinspect-5.1.6.tar.gz

rm -Rv /usr/src/tkinspect-5/
cd /usr/src/
tar -xvzf $SALCATCL/alcatel/code/tkinspect-5.1.6.tar.gz
cd /usr/src/tkinspect-5/

rm -Rv RCS
patch install.tcl <<'%%%'
84c84
< set prefix /usr/local
---
> set prefix /usr/src/tkinspect-5
153a154
>     set wish /usr/bin/wish
219a220,221
> 
> do_install
%%%
patch version.tcl <<'%%%'
12c12
<     if {$major != 4} {
---
>     if {$major != 4 && 0} {
%%%
mkdir -p bin lib/tkinspect

agrep send $(find *) |& tee o

cd /usr/src/tkinspect-5/
wish install.tcl
# tubak install.tcl

wish -f tkinspect.tcl

# (find-fline "/usr/src/tkinspect-5/README")
# (find-fline "/usr/src/tkinspect-5/install.tcl")
# (find-fline "/usr/src/tkinspect-5/install.tcl" "proc do_install")
# (find-fline "/usr/src/tkinspect-5/install.tcl" "proc install ")
#    set wish /usr/bin/wish
# (find-fline "/usr/src/tkinspect-5/install.tcl" 130)
# (find-fline "/usr/src/tkinspect-5/version.tcl")



# (code-c-d "tki" "/usr/src/tkinspect-5/")
# (find-tkifile "tkinspect.tcl")

cd /usr/src/tkinspect-5/
agrep -w proc *.tcl */*.tcl | tee ~/o
agrep -w target *.tcl */*.tcl | tee ~/o2

# (find-fline "~/o")
# (find-fline "~/o2")
# (find-tkifile "")
# (find-tkifile "stl-lite/")

# Not working AFAIK






#####
#
# send
# 99oct??
#
#####

#  «send»

startx

xauth nextract /tmp/0.0 :0.0
chmod 666 /tmp/0.0
#
su -s xauth edrx nmerge /tmp/0.0

# Tests with my diagram editor:
#

echo 'puts [send tmpdiag {winfo children .buttons}]; exit' | wish 

proc listwithchildren {app parent} {
  puts $parent
  foreach child [send $app "winfo children $parent"] {
    listwithchildren $app $child
  }
}
listwithchildren [lindex $argv 0] .
exit


# (find-fline "~/TCL/")
# (find-fline "~/TCL/winfo")
# (find-fline "~/TCL/tclsendmail")

# And for items in canvases?...

cat > /tmp/w <<'---'
proc ps {args} {puts [eval send tmpdiag $args]}
ps winfo children .
ps winfo children .c
ps .c configure
ps .c find all
ps .c itemconfigure 1
ps .c type 1
---
wish /tmp/w





#####
#
# mktclapp: C functions with binary arguments
#
#####

#  «mktclapp_objcom»

# (find-fline "/usr/doc/mktclapp/mktclapp.html" "<a name=\"toc11\">")
# (find-fline "~/MTA/")
# (find-fline "~/MTA/test.tcl")
# (find-fline "~/MTA/Makefile")
# (find-fline "~/MTA/objcom.c")

cd ~/MTA/
make clean
cd ~/MTA/
make

cd ~/MTA/
(cat ~/replace/ega1.8; gzip -cd /usr/share/consolefonts/iso01.f08.gz) \
  > /tmp/512
objcom test.tcl 8 /tmp/512

# (find-node "(gdb)File Options")
# (gdb "gdb -quiet -x ~/MTA/objcom.gdb objcom")
# (find-fline "~/MTA/objcom.gdb")

# (find-tcltag "Tcl_GetStringFromObj")
# (find-tcltag "Tcl_GetIntFromObj")
# (find-tcltag "Tcl_Obj")
# (find-fline "~/MTA/objcom.E")
# (find-fline "~/MTA/objcom_.E")







#######
#
# Enhancing mktclapp with a variadic argument parser
# (Completely incomplete!)
#
#######

/*
 * (find-node "(libc)Variable Arguments Output")
 * (find-node "(gcc.info)Macro Varargs")
 * (find-node "(libc)Variadic Functions")
 * (find-node "(libc)Variadic Example")
 * (find-node "(cpp)Stringification")
 */

int add_em_up (int count,...) {
  va_list ap;
  int i, sum;
  va_start (ap, count);         /* Initialize the argument list. */
  sum = 0;
  for (i = 0; i < count; i++)
    sum += va_arg (ap, int);    /* Get the next argument value. */
  va_end (ap);                  /* Clean up. */
  return sum;
}

int main (void) {
  /* This call prints 16. */
  printf ("%d\n", add_em_up (3, 5, 5, 6));
  /* This call prints 55. */
  printf ("%d\n", add_em_up (10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
  return 0;
}





#define assert_nargs(n, msg)						\
  if (argc!=(n)+1) {							\
    Et_ResultF(interp, "wrong # args: should be %s %s", argv[0], msg);	\
    return TCL_ERROR;							\
  }
#define get_intarg(n, name, iptr)					\
  {									\
  if (argc!=(n)+1) {							\
    Et_ResultF(interp, "wrong # args: should be %s %s", argv[0], msg);	\
    return TCL_ERROR;							\
  }

  /*

  char *tail;
  int n;
         errno = 0;
         next = strtol (string, &tail, 0);
         if (errno)
           printf ("Overflow\n");
         else
           sum += next;
         string = tail;
       }

int strtol (const char *STRING, char **TAILPTR, int
         BASE)

0004 int ET_COMMAND_add(ET_TCLARGS){
0005   if( argc!=3 ){
0006     Et_ResultF(interp, "wrong # args: should be \"%s NUM1 NUM2\"",argv[0]);
0007     return TCL_ERROR;
0008 }
0009   Et_ResultF(interp,"%d", atoi(argv[1]) + atoi(argv[2]));
0010   return TCL_OK;


	




# (find-tclfile "")
# (find-tclfile "changes" "Changes for Tcl 8.0 go below this line.")

# (find-vldifile "tcl8.0-dev.list")
# (find-fline "/usr/doc/tcl8.0-dev/")

grep -i obj $(eefile vldi tcl8.0-dev.list) | sort > ~/o

grep -i obj $(eefile vldi tcl8.0-dev.list) | sort \
  | perl -nle 'm:man3/(.*).3tcl.gz: && print $1' \
  | perl -nle 'print "  [man3tcl $_]"' \
  | tee ~/o




http://angg/cgi-bin/man2html/usr/man/man3/CrtObjCmd.3tcl.gz#index



# (find-fline "~/o")

/usr/man/man3/BoolObj.3tcl.gz

# (find-tcltag "Tcl_Obj")
# (find-fline "$PAGE2/mktclapp.th")

# (find-fline "~/MTA/objcom.c")




grep -i tcl ~/osnl | sort | grep -i htm > ~/o2
grep -v /man ~/o2 > ~/o3
grep    /man ~/o2 > ~/o4
# (find-fline "~/o3")
# (find-fline "~/o4")

grep -i tcl ~/osnl | sort | awk '{if ($0 ~ /htm/) print " "$0; else print $0}'



  14839 Fundamental	/var/lib/dpkg/info/tcl8.0-dev.list





######
#
# environment variables
#
######

#  «environment»
		   expect -c 'puts $env(DOREMOTE)'
export DOREMOTE=1; expect -c 'puts $env(DOREMOTE)'
export DOREMOTE=;  expect -c 'puts $env(DOREMOTE)'
unset  DOREMOTE;   expect -c 'puts [info exists env(DOREMOTE)]'
export DOREMOTE=1; expect -c 'puts [info exists env(DOREMOTE)]'
unset  DOREMOTE;

unset  DR;   expect -c 'puts [expr {[info exists env(DR)]&&$env(DR)}]'
export DR=1; expect -c 'puts [expr {[info exists env(DR)]&&$env(DR)}]'
export DR=0; expect -c 'puts [expr {[info exists env(DR)]&&$env(DR)}]'
unset  DR;



#####
#
# groupkit-5.1
# 99sep11
#
#####

#  «groupkit»

rm -Rv /usr/src/groupkit-5.1/
cd /usr/src/
tar -xvzf $S/ftp/ftp.cpsc.ucalgary.ca/pub/projects/grouplab/software/groupkit-5.1.tar.gz
cd /usr/src/groupkit-5.1/

cd /usr/src/groupkit-5.1/unix/
./configure --with-tcl=/usr/lib
make install prefix=/usr exec_prefix=/usr/local |& tee omi

registrar &
open.reg


# (find-fline "/usr/local/bin/")
# (find-fline "/usr/lib/gk5.1/")

rm -Rv /usr/lib/gk5.1/
rm -v /usr/local/bin/registrar
rm -v /usr/local/bin/open.reg




# (find-fline "/usr/src/groupkit-5.1/")
# (find-fline "/usr/src/groupkit-5.1/README")
# (find-fline "/usr/src/groupkit-5.1/unix/omi")
# (find-fline "/usr/src/groupkit-5.1/unix/Makefile")

# cd /usr/src/groupkit-5.1/unix/
# ./configure --with-tcl=/usr/src/tcl8.0-8.0.4/unix
# mkdir /tmp/p /tmp/ep
# make install prefix=/tmp/p exec_prefix=/tmp/ep |& tee omi
# find /tmp

cd /usr/src/groupkit-5.1/unix/
strace-to ~/s wish open.reg	|& tee ow





######
#
# Freehand drawing
# 99oct18
#
######

# (global-set-key [f3] 'eew-bounded)

%*
pack [canvas .c]
bind .c <ButtonPress-1> {
 set %W(line) [list %W coords [%W create line %x %y %x %y] %x %y]
}
bind .c <B1-Motion> {eval [lappend %W(line) %x %y]}
bind .c <ButtonRelease-1> {unset %W(line)}
%*


%*
# z = x+iy => z^2 = (x+iy)^2 = x^2-y^2+2ixy
#
# .d is the domain, .c is the image. z |-> z^2.
# Bug: y is flipped, but that's unnoticeable in this case.
#
proc bpress {W x y} {
  global $W-line
  set $W-line [list $W coords [$W create line $x $y $x $y] $x $y]
}
proc bmotion {W x y} {
  global $W-line
  eval [lappend $W-line $x $y]
}
#
pack [canvas .c -width 200 -height 200]
bind .c <ButtonPress-1> {bpress .c %x %y}
bind .c <B1-Motion> {bmotion .c %x %y}
#
proc tof {n} {expr ($n-100)/50.0}
proc toscr {x} {expr ($x*50)+100}
proc imx {x y} {toscr [expr {pow([tof $x],2) - pow([tof $y],2)}]}
proc imy {x y} {toscr [expr {2*[tof $x]*[tof $y]}]}
#
toplevel .d
pack [canvas .d.e -width 200 -height 200]
bind .d.e <ButtonPress-1> {
  bpress .d.e %x %y
  bpress .c [imx %x %y] [imy %x %y]
}
bind .d.e <B1-Motion> {
  puts "%x %y"
  bmotion .d.e %x %y
  bmotion .c [imx %x %y] [imy %x %y]
}
%*




######
#
# tkpaint
# 99oct18
#
######

apti tkpaint
# (find-vldifile "tkpaint.list")
# (find-fline "/usr/doc/tkpaint/")

# (find-fline "/usr/X11R6/bin/tkpaint")
# (find-fline "/usr/X11R6/lib/tkpaint/")
# (find-fline "/usr/doc/tkpaint/examples/")

cd /usr/doc/tkpaint/examples/
tkpaint demo2.pic
tkpaint demo3.pic





#####
#
# static tcl libs (for freewrap)
# 99nov11
#
#####

#  «static_libs»

pdsc /big/slinks2/dists/slink/main/source/libs/tcl8.0_8.0.4-2.dsc
cd /usr/src/tcl8.0-8.0.4/
# etags $(find generic unix -name '*.[ch]')

debian/rules binary |& tee odrb

# (find-tclfile "")
# (find-tclfile "debian/")
# (find-tclfile "odrb")
# (find-tclfile "unix/")





#####
#
# freewrap
# 99nov11
#
#####

#  «freewrap»

rm -Rv /usr/src/freewrap/
mkdir  /usr/src/freewrap/
cd     /usr/src/freewrap/
tar -xvzf $S/http/www.albany.net/~dlabelle/freewrap/download/freewrap33.tar.gz

# (find-fline "/usr/src/freewrap/freewrap.mta")

mv freewrap.mta freewrap.mta.old
cat > freewrap.mta <<'---'
# Configuration file generated by xmktclapp
# Hand editing is not recommended
#
# The "xmktclapp" program reads the lines that begin with "##".
# The "mktclapp" program reads lines that don't begin with "#".
# Lines beginning with a single "#" are comment.
#
## Autofork No
## CFile:tcl/encrypt.c 1
## CmdLine Console
## ConfigFile freewrap.mta
## MainScript tcl/freewrap.tcl
## Mode Tcl/Tk
## NoSource No
## OutputFile tcl/freewrap.c
## Shroud No
## Standalone Yes
## TclFile:tcl/freewrap.tcl 1
## TclLib /usr/lib/tcl8.0
## TkLib /usr/lib/tk8.0
#
-console
-main-script "freewrap.tcl"
-tcl-library "/usr/lib/tcl8.0"
-tk-library "/usr/lib/tk8.0"
-strip-tcl "/usr/lib/tcl8.0/history.tcl"
-strip-tcl "/usr/lib/tcl8.0/init.tcl"
-strip-tcl "/usr/lib/tcl8.0/ldAout.tcl"
-strip-tcl "/usr/lib/tcl8.0/parray.tcl"
-strip-tcl "/usr/lib/tcl8.0/pkgIndex.tcl"
-strip-tcl "/usr/lib/tcl8.0/safe.tcl"
-strip-tcl "/usr/lib/tcl8.0/tclIndex"
-strip-tcl "/usr/lib/tcl8.0/word.tcl"
-strip-tcl "/usr/lib/tk8.0/bgerror.tcl"
-strip-tcl "/usr/lib/tk8.0/button.tcl"
-strip-tcl "/usr/lib/tk8.0/clrpick.tcl"
-strip-tcl "/usr/lib/tk8.0/comdlg.tcl"
-strip-tcl "/usr/lib/tk8.0/console.tcl"
-strip-tcl "/usr/lib/tk8.0/dialog.tcl"
-strip-tcl "/usr/lib/tk8.0/entry.tcl"
-strip-tcl "/usr/lib/tk8.0/focus.tcl"
-strip-tcl "/usr/lib/tk8.0/listbox.tcl"
-strip-tcl "/usr/lib/tk8.0/menu.tcl"
-strip-tcl "/usr/lib/tk8.0/msgbox.tcl"
-strip-tcl "/usr/lib/tk8.0/obsolete.tcl"
-strip-tcl "/usr/lib/tk8.0/optMenu.tcl"
-strip-tcl "/usr/lib/tk8.0/palette.tcl"
-strip-tcl "/usr/lib/tk8.0/safetk.tcl"
-strip-tcl "/usr/lib/tk8.0/scale.tcl"
-strip-tcl "/usr/lib/tk8.0/scrlbar.tcl"
-strip-tcl "/usr/lib/tk8.0/tclIndex"
-strip-tcl "/usr/lib/tk8.0/tearoff.tcl"
-strip-tcl "/usr/lib/tk8.0/text.tcl"
-strip-tcl "/usr/lib/tk8.0/tk.tcl"
-strip-tcl "/usr/lib/tk8.0/tkfbox.tcl"
-strip-tcl "/usr/lib/tk8.0/xmfbox.tcl"
"encrypt.c"
-strip-tcl "freewrap.tcl"
---

rm freewrap
mktclapp -f freewrap.mta > freewrap.c
mktclapp -header > freewrap.h


make \
  LIBS="/usr/lib/libtcl8.0.a /usr/lib/libtk8.0.a -L/usr/X11R6/lib -lX11 -ldl -lieee -lm -lc" \
  CFLAGS="-pipe -fPIC -DSTATIC_BUILD -DTcl_GetByteArrayFromObj=Tcl_GetStringFromObj -DTcl_NewByteArrayObj=Tcl_NewStringObj" \
  -f makefile.linux	|& tee om

cd /usr/src/freewrap/
laf
file freewrap
ldd freewrap
laf /usr/lib/lib{tcl,tk}*

# (find-fline "/usr/src/freewrap/freewrap.mta")
# (find-fline "/usr/src/freewrap/makefile.linux")



# (find-vldifile "tcl8.0-dev.list")






#######
#
# postscript
#
#######

# (find-tkfile "tests/")

# (find-tkfile "tests/canvPs.test")
# (find-tkfile "tests/canvRect.test")
# (find-tkfile "tests/canvText.test")

# (find-tkfile "tests/canvPsArc.tcl")
# (find-tkfile "tests/canvPsBmap.tcl")
# (find-tkfile "tests/canvPsGrph.tcl")
# (find-tkfile "tests/canvPsText.tcl")

canvPs.test:     .c postscript -file bar.ps
canvRect.test:     set x [.c postscript]
canvText.test:     set x [.c postscript]
font.test:     set post [.b.c postscript]
font.test:     set x [.b.c postscript]
visual:     $c postscript -file tmp.ps





####
#
# Tk - more on PostScript
# 99nov06
#
####

#  «tk_ps»

# (find-tkfile "doc/CanvPsY.3")
# (find-tkfile "doc/CrtItemType.3")
# (find-tkfile "doc/canvas.n")

# (eeman "3tk CanvPsY")
# (eeman "3tk CrtItemType")
# (eeman "3tk canvas" "postscript")

# (find-fline "~/LATEX/")
# (find-fline "~/LATEX/diaglib.013" "postscript -file")




#####
#
# New version of the diagram libs
# 00jan??
#
#####

#  «newdiaglib»

# (find-fline "~/LATEX/basiclib.013")
# (find-fline "~/LATEX/diaglib.013")

# (find-fline "~/LATEX/diaglib.014")
# (find-fline "~/LATEX/desenhos.013")

# (find-fline "~/.emacs" "diaglib")
# (find-angg ".emacs" "diags")

(defun eediag-bounded () (interactive)
  (write-ee-bounded
   "----------\n" "\n#----------"
   "cd ~/LATEX; cat > tmpdiag <<'--%%--'\nsource diaglib.014\n"
   "\n--%%--\nwish tmpdiag &\n"))
(global-set-key [f3] 'eediag-bounded)






#####
#
# Calling Tcl from C
# 99dec14
#
#####

# (find-fline "$S/http/www.cica.indiana.edu/cica/faq/tcl/book.examples" "Tcl_Interp")
# (find-vldifile "tcl8.0-dev.list")
# (find-fline "/usr/doc/tcl8.0-dev/")
# (eeman "Tcl_Eval")
# (eeman "Tcl_EvalObj")
# (eeman "Tcl_GetStringResult")

cd /tmp/
cat > calltcl0.c <<'---'
#include <stdio.h>
#include <tcl.h>
main(int argc, char *argv[]) {
  Tcl_Interp *interp = Tcl_CreateInterp();
  Tcl_Eval(interp, "puts Hello");
  Tcl_Eval(interp, "expr 1+2");
  printf("..%s..\n", Tcl_GetStringResult(interp));
}
---
gcc -ltcl8.0 -o calltcl0 calltcl0.c
calltcl0