[alt.sources.amiga] Tcla - Tool Command Language Amiga, shar 1 of 3

karl@sugar.hackercorp.com (Karl Lehenbauer) (03/19/90)

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then feed it
# into a shell via "sh file" or similar.  To overwrite existing files,
# type "sh file -c".
# The tool that generated this appeared in the comp.sources.unix newsgroup;
# send mail to comp-sources-unix@uunet.uu.net if you want that tool.
# If this archive is complete, you will see the following message at the end:
#		"End of shell archive."
# Contents:  ./MANIFEST ./docs/TCLREADME ./docs/Releases ./docs/Bugs
#   ./docs/tcla/resources.doc ./docs/tcla/menu.doc
#   ./docs/tcla/window.doc ./docs/tcla/gadgets.doc
#   ./docs/tcla/ickalloc.doc ./docs/tcla/loop.doc
#   ./docs/tcla/tclsend.doc ./docs/tcla/display.doc
#   ./docs/tcla/panic.doc ./docs/tcla/amigados.doc
#   ./docs/tcla/stdfile.doc ./docs/tcla/windowevent.do
#   ./docs/tcla/trace.doc ./docs/tcla/misc.doc
#   ./docs/tcla/displayrequest ./docs/tcla/ports.doc
#   ./docs/tcla/random.doc ./tclprocs/hello.tcl ./tclprocs/decomp.tcl
#   ./tclprocs/startup.tcl ./tclprocs/help.tcl ./tclprocs/demo.tcl
#   ./tcl.uu
# Wrapped by karl@sugar on Sun Mar 18 22:49:36 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f './MANIFEST' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./MANIFEST'\"
else
echo shar: Extracting \"'./MANIFEST'\" \(2020 characters\)
sed "s/^X//" >'./MANIFEST' <<'END_OF_FILE'
XMANIFEST
X--------
X
XThere are seven postings total to alt.sources.amiga for the Alpha-2
Xrelease of Tcla.
X
XThey are:
X	tcl.man 1 of 2		an ASCII copy of the Tcl manual
X	tcl.man 2 of 2
X
X	tcla.shar.1 of 3	Tcla documentation, sample Tcl procs,
X	tcla.shar.2 of 3	interface demo C source, help system,
X	tcla.shar.3 of 3	includes and Tcl binary
X
X	tcla.library.1 of 2	tcla.library shared library, compressed
X	tcla.library.2 of 2	and uuencoded
X
X
XList of files:
X
X./docs/Releases
X./docs/TCLREADME
X./docs/Bugs
X./docs/tcla/resources.doc
X./docs/tcla/menu.doc
X./docs/tcla/window.doc
X./docs/tcla/gadgets.doc
X./docs/tcla/ickalloc.doc
X./docs/tcla/loop.doc
X./docs/tcla/tclsend.doc
X./docs/tcla/display.doc
X./docs/tcla/panic.doc
X./docs/tcla/amigados.doc
X./docs/tcla/stdfile.doc
X./docs/tcla/windowevent.do
X./docs/tcla/trace.doc
X./docs/tcla/misc.doc
X./docs/tcla/displayrequest
X./docs/tcla/ports.doc
X./docs/tcla/random.doc
X./tclprocs/hello.tcl
X./tclprocs/decomp.tcl
X./tclprocs/startup.tcl
X./tclprocs/help.tcl
X./tclprocs/demo.tcl
X./src/tcl/tcl.c
X./src/tcl/makefile
X./help/run
X./help/string
X./help/format
X./help/uplevel
X./help/random
X./help/index
X./help/continue
X./help/exec
X./help/for
X./help/variables
X./help/send
X./help/break
X./help/trace
X./help/results
X./help/error
X./help/length
X./help/gadgets
X./help/global
X./help/programs
X./help/info
X./help/resources
X./help/range
X./help/tcl
X./help/expr
X./help/glob
X./help/display
X./help/expressions
X./help/rename
X./help/catch
X./help/menu
X./help/window
X./help/set
X./help/time
X./help/endeventloop
X./help/case
X./help/source
X./help/lists
X./help/eventloop
X./help/commands
X./help/procedures
X./help/post
X./help/tcla
X./help/displayrequest
X./help/list
X./help/proc
X./help/scan
X./help/builtin.vars
X./help/file
X./help/if
X./help/stdfile
X./help/foreach
X./help/windowevent
X./help/eval
X./help/concat
X./help/print
X./help/return
X./includes/tcl.h
X./includes/tcla.h
X./includes/tcla/window.h
X./includes/tcla/header.h
X./includes/tcla/events.h
X./includes/tcla/fonts.h
X./includes/tcla/menu.h
X./tcl.uu
Xtcl.man
Xtcla.library
X./MANIFEST
END_OF_FILE
if test 2020 -ne `wc -c <'./MANIFEST'`; then
    echo shar: \"'./MANIFEST'\" unpacked with wrong size!
fi
# end of './MANIFEST'
fi
if test -f './docs/TCLREADME' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./docs/TCLREADME'\"
else
echo shar: Extracting \"'./docs/TCLREADME'\" \(8619 characters\)
sed "s/^X//" >'./docs/TCLREADME' <<'END_OF_FILE'
XHackercorp - Hackercorp - Hackercorp - Hackercorp - Hackercorp - Hackercorp
X
X
XTCLREADME	3/15/90
X---------	-------
X
X	This document is Copyright 1990 by Hackercorp.  Permission to use,
X	copy,  modify, and distribute this documentation for any purpose 
X	and  without fee is hereby granted, provided that the above copyright
X	notice appear in all copies.  Hackercorp makes no representations 
X	about the suitability of this software for any purpose.  It is 
X	provided "as is" without express or implied warranty.
X
X
XThis is the alpha-2 distribution of Tcl and Tcla.  Tcl stands for Tool
XCommand Language, and was created by Dr. John Ousterhout of the
XUniversity of California at Berkeley as a library package to be
Xembedded in various tools (editors, debuggers, terminal emulators, etc)
Xas the tool's command interpreter.  Tcl provides a simple programming
Xlanguage, a set of built-in commands, and has a C interface that 
Xtools can use to add application-specific commands to the base set
Xprovided by Tcl.
X
XTcla stands for Tool Command Language - Amiga, and it provides several 
Xcommands (via the C interface) that have been added to Tcl to support 
XAmigas, including support for CLI commands, windows, menus, resources,
Xfile requesters, alerts and message passing between Tcla programs.  
XTcla was created by Karl Lehenbauer of Hackercorp.
X
XThis package contains both Tcl and Tcla, packaged as an Amiga shared
Xlibrary, tcla.library.  Tcl in tcla.library is essentially original Tcl,
Xwith a small number of changes described below.  Tcl is copyrighted by
Xthe University of California, but their copyright allows for reuse for any
Xpurpose, including commercial sale, subject to the restriction that the 
Xcopyright and disclaimer messages must be included unmodified where present 
X(i.e.  in the source code).  Likewise, Tcla is copyrighted by Hackercorp, 
Xbut we also allow redistribution for any purpose subject to the same
Xrequirements regarding copyright and disclaimer messages.
X
XTcl and Tcla have been compiled into an Amiga shared library, named
Xtcla.library.  The 'tcl' program, included with this Tcla release, can 
Xopen tcla.library and make use of it to create Tcl interpreters and get 
Xthem to evaluate Tcl commands, and to use the Tcla functions to interface 
Xwith the supported Amiga interface routines, other Tcla programs, and C 
Xsubroutines  that you may decide to write and make callable from Tcl.
X
Xtcla.library, in addition to providing the basic capabilities of Tcl, has
Xadditional support for many Amiga-specific functions, such as executing
XCLI commands and getting the result back as a string,  opening and 
Xmanipulating windows and processing window events, file requesters, alerts,
Xsupport for menus (where menu entries you define from Tcl cause Tcl code
Xto be executed when selected), define and interact with gadgets, and provides
Xsharable Tcl-based handles to various application-specific data entities
X(resource banks).  Further, all Tcla programs have the ability to send and 
Xreceive  Tcl commands to and from other Tcla programs.
X
XThe tcl demo program, the one that calls tcla.library, should compile 
Xwithout trouble on Manx Aztec C 5.0a or later.  A port of the demo program
Xto Lattice should be dead easy -- the program is only a couple dozen lines 
Xlong.
X
XThe tcla.library was generated with Aztec C 5.0a, but should be callable
Xby any programming language that can make use of .fd files.  For programmers
Xusing Aztec C, include files with ANSI function prototypes and pragmas
Xare included.  They may need some massaging for use under Lattice.
X
XChanges in Tcl from Tcl as provided by John Ousterhout/Berkeley:
X
X	o In original Tcl assigning an empty string to a variable caused
X	  that variable to cease to exist, resulting in an error when you
X	  tried to reference it.  This broke all sorts of little Tcl 
X	  programs that should have worked.
X
X	  Peter da Silva came up with changes to fix this, and Amiga Tcl 
X	  incorporates this change.  The changes been forwarded to John 
X	  Ousterhout (they were minor) and he has agreed to adopt them.
X
X	o As a positive side effect of the above change, Tcl procedures that
X	  can accept a variable number of arguments can now be called with
X	  no arguments.  Previously if you defined a Tcl procedure as taking
X	  a variable number of arguments, it required that at least one 
X	  argument be passed.  This restriction was not true for C extensions, 
X	  so now neither C extensions nor high-level Tcl procedures require an 
X	  argument when the procedure expects a variable number of arguments.
X
X	o ANSI function prototypes have been generated and are used to
X	  enable type-checking when compiling Tcl and Tcla.  The tcl.h
X	  and tcla.h include files declare function prototypes for all
X	  C-callable Tcl and Tcla support routines to help insure
X	  their correct usage.
X
X	o Original Tcl did not concern itself with running out of memory.
X	  This is understandable as it was developed and used on a virtual
X	  memory machine (VAX) running Unix.  On the Amiga we have to be
X	  more careful, because running out of memory is not such an uncommon
X	  occurrence.  A mechanism is provided for Tcl to call a programmer-
X	  specified routine if it is unable to allocate memory, so memory can
X	  be freed if possible.
X
X	o The panic routine that comes with Berkeley Tcl is not included
X	  in the Tcl library.  It has been replaced by an Amiga-specific
X	  routine that pops up a requester describing the problem, then
X	  does other Amiga-specific things.  Programmers using the C 
X	  interface can provide  their  own panic routine (both Tcl and 
X	  Tcla library routines call panic when they encounter various 
X	  unrecoverable conditions) or  use the one that is included in 
X	  the Tcla library (the default).
X
XThe Tcl documentation consists of the Tcl manual and the Tcl C-interface
Xroutine docs.  These files are available in the Unix nroff format, but
Xfor this release they have already been nroffed and run through col and
Xstrike to produce a straight ASCII-printable document.  This file is
Xtcl.man in the release.
X
XTcla documentation is provided in the form of several .doc files.  These
Xare straight ASCII files at this time, although they will eventually
Xprobably be put into the nroff "man" format.
X
XRunning The Demos
X-----------------
X
XTo run the demos, you need to put the tcl procedures (.tcl files) in
Xa directory that has had an "assign tclprocs:" done on it.  Then,
Xcd to that directory, and do a "tcl -f hello.tcl" or a "tcl" followed
Xby "source hello.tcl", "source demo.tcl", etc.  To execute from the
XTcl command prompt, enter a control-\, which is the Amiga end-of-file.
X
XThe demos assume that you have a program, more, which takes a filename
Xand displays the contents of the file, and a command, lc, which lists
Xthe files in a directory.  I hope to acquire PD versions of these
Xprograms and include them in future releases.  Also, demo.tcl requires
Xruby.font in the 15 pixel height.
X
XIndidentally, hello.tcl can use an alternate font that's specified on
Xthe command line.  For example,
X	tcl -f hello.tcl ruby.font 15
Xwill cause hello world to be displayed using the 15-pixel-high ruby font.
XIf you resize the window, "Hello, World." will be redisplayed within the
Xwindow drawing area.
X
X
XKnown Bugs In Alpha-2 Release
X-----------------------------
X
XThere is a file, bugs, within the release that details known bugs.
X
X
XMiscellaneous Ruminations
X-------------------------
X
XThe library will probably grow on the whole, rather than shrink, as new
Xcapabilities are added.  However, with the planned support for  attaching
Xadditional specially-prepared shared libraries from within tcl to install 
Xa set of commands into your Tcl interpreter, the tcl library will probably
Xshrink and a second library will be created to support all of the Intuition
Xfunctions.
X
XManx 5.0a optimizer really shrinks the code.  The library size shrinks
Xby 16K bytes when compiled with optimization.
X
XA bunch of the file requester code will eventually go away.
X
X
XReporting Bug Fixes And Distributing Changes
X--------------------------------------------
X
XPLEASE DO NOT GENERALLY DISTRIBUTE CODE OR PACKAGES BASED ON ANY ALPHA 
XOR BETA RELEASE OF TCLA.  WE DO NOT WANT TO HAVE TO MAINTAIN BACKWARD 
XCOMPATIBILITY TO THE MANY BRAIN-DAMAGED ASPECTS OF ALPHA AND/OR BETA 
XRELEASES.
X
XPlease report bug fixes back to Hackercorp so that we may include them in
Xfuture releases.
X
X
XRegards,
X
XKarl Lehenbauer @ The Hacker's Haven -- Hackercorp  "We Are Enthusiasts."
X3918 Panorama
XMissouri City, TX  77459
X
XInternet/BITNET: karl@sugar.hackercorp.com
XUsenet: uunet!sugar!karl
X
X
END_OF_FILE
if test 8619 -ne `wc -c <'./docs/TCLREADME'`; then
    echo shar: \"'./docs/TCLREADME'\" unpacked with wrong size!
fi
# end of './docs/TCLREADME'
fi
if test -f './docs/Releases' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./docs/Releases'\"
else
echo shar: Extracting \"'./docs/Releases'\" \(5714 characters\)
sed "s/^X//" >'./docs/Releases' <<'END_OF_FILE'
XHackercorp - Hackercorp - Hackercorp - Hackercorp - Hackercorp - Hackercorp
X
XRelease Alpha 2
X	- Tcla init commands now require an argument, that being a pointer
X	  to the interpreter into which the init command is to install
X	  their application-specific Tcl commands.  (The Alpha release docs
X	  warned that this was forthcoming)
X
X	- display command now has a "draw" command for line drawing
X
X	- display command now has a "textlength" command to determine the
X	   length in pixels of the specified text if it were to be displayed
X
X	- tcla documentation improved
X
X	- window command now lets you name the window within the
X	  Tcl environment, rather than returning a "magic" window 
X	  name that you had to provide to subsequent window calls
X
X	- windows are now maintained on a per-interpreter basis.
X	  (The window and menu data, etc, is contained within
X	   the current interpreter via the clientdata capabiklity)
X
X	- when an interpreter exits, all windows still open within that
X	  interpreter are closed
X
X	- an arbitrary number of windows are now supported per interpreter.
X	  previously only 32 windows could be opened, total
X
X	- each window can now have its own menustrip attached, fixing a really
X	  gross restriction in the alpha release
X
X	- menu.c Tcla library routines were folded into window.c and menu.c
X	  was removed.  This was essentially dictated by the desire to use
X	  the clientdata field as a pointer to data structures for windows
X	  and menus, we have it at window command addition time because we
X	  allocate it then, but we won't have it handy for menu command
X	  addition time unless we add the menu right then.
X
X	- added "window width name" to determine current width of a window
X	- added "window height name" to determine current height of a window
X		(these do not include borders, only the drawing area)
X
X	- added "display textwidth text" to determine width in pixels of text
X	- added "display fontheight" to determine height of font in pixels
X
X	- made "display move" make 0,0 the edge of the drawing area, not
X	  the border
X
X	- all global data has been removed from tcla library and globals are
X	  now accessed indirectly through clientdata references (this will
X	  greatly ease making tcla into a shared library, plus allow multiple
X	  interpreters in a task to use the various tcla capabilities, plus is
X	  more consistent with tcl)
X
X	- Tcla_AddEventLoop command lets C interfaces register a routine
X	  name and pointer to a longword wait event mask.  When the eventloop
X	  command is running, all event-handling C routines that that have 
X	  been registered via Tcla_AddEventLoop have their masks checked against
X	  the wait flags returned by Wait and, if any bits are set in both,
X	  the event-handling routine is called.)
X
X	- all event loop event-handling routines with Tcla for windows, menus
X	  and interprocessor communications, etc, have been modified to use
X	  Tcla_AddEventLoop and have had all of their routine-specific code
X	  removed from loop.c.
X
X	- Tcl and Tcla are now a shared library
X
X	- print, echo, source, exec and run commands now use AmigaDOS directly
X	  (Open, Seek, Read, Write, Close, etc.) rather than going through the 
X	  Manx  unix-compatibility routines (open, read, write, etc).  This
X	  allowed them to be put into the shared library
X
X	- Added a command, 'programs', which returns the names of all other 
X	  programs that have Tcl messages ports to the shared library
X
X	- added a command, 'commandloop' which gives you a Tcl command loop
X	  to the shared library
X
X	- added a command, 'random' to get random numbers.
X
X	- went back to having 'window open' return a handle that is required
X	  for the other window routines, rather than having a global namespace
X	  (it just didn't work out)
X
X	- window messages are replied to before message action is taken, that
X	  way if a window close occurs, etc, we won't reply to a nonexistent
X	  port, causing guru
X
X	- erroneous reporting of double panics when multiple tcla library
X	  programs panic fixed -- static data was present in the panic
X	  routine, it has been moved to the per-task TclaHeader structure.
X
X	- panic now works
X
X	- panic is now callable as a Tcl command for testing.  I don't see
X	  a real application for it for which 'error' wouldn't be better,
X	  but who knows?
X
X	- programs using tcla.library can now supply a panic routine to be 
X	  called in place of the panic routine Tcla calls by default if Tcla 
X	  encounters an unrecoverable condition.  A panic routine can be
X	  supplied to Tcl via the Tcla_PanicRoutine call.  If no routine is
X	  specified a default routine puts up a requester, then after the
X	  user responds follows cleanup logic described below
X
X	- programs using tcla.library can now supply a cleanup routine to be
X	  called in place of the Tcla cleanup routine.  This is called after
X	  a panic.
X
X	- programs using tcla.library can now supply a low-memory routine.
X	  This is done through the Tcla_LowMemRoutine call.
X
X	- random now keeps the seed on a per-task basis, so programs can
X	  get deterministic behavior out of random (by seeding with a
X	  constant) for testing purposes
X
X	- added a little tcl help application
X
X	- added font command, with options to open and close fonts, and to
X	  get a list of fonts available on the system
X
X	- added an option to display to select a current font for the window
X
X	- made fontheight option of the display command use the current font
X	  rather than the default
X
X	- added fonstyle option to display command so Tcl programs can get
X	  a font soft-styled to the various options
X
X	- added code to support hit, toggle, string and integer gadgets
X
X	- added "default" option to "display font"
X
X
XRelease Alpha		2/26/90
X	- The Epoch
X
END_OF_FILE
if test 5714 -ne `wc -c <'./docs/Releases'`; then
    echo shar: \"'./docs/Releases'\" unpacked with wrong size!
fi
# end of './docs/Releases'
fi
if test -f './docs/Bugs' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./docs/Bugs'\"
else
echo shar: Extracting \"'./docs/Bugs'\" \(2708 characters\)
sed "s/^X//" >'./docs/Bugs' <<'END_OF_FILE'
XKNOWN BUGS IN THE ALPHA-2 RELEASE
X---------------------------------
X
Xtime command isn't implemented
X
Xfile command isn't implemented
X
Xnot checking only windows that need to be checked from the sigmask
X
Xnot generating the sigmask to check windows only when a window signal
Xis received
X
Xinterpreters and tcla need to be separated more such that multiple
Xinterpreters can exist and share the tcla amiga environment for things
Xlike window and event handling -- right now only one interpreter, the
Xone for which Tcla_Init was called, can make use of the Tcla functions.
X
Xshould make tabs tab over rather than inverse-I in the command loop
X
Xnot all memory is being accounted for
X
Xnot everything that's in tcla.library should be.  There should be
Xsubordinate libraries, like tcla.graphics.library, which, when
Xopenlibrary is called on them from tcl, would cause tcla to do an
XOpenLibrary on the routine and execute a standard install routine
Xthat would cause all the tcl commands supported by that library
Xto be installed in the user's interpreter
X
Xneed to provide support for the creation of screens
X
Xneed to install a clipping region to prevent overwriting the window
Xboundaries
X
Xdisplayrequest screws up if text is too long; it should support
Xmultiple lines, etc.
X
XI use atoi all over the place where I should be checking to make sure
Xthere aren't any non-numeric aspects to the arguments and I'm not
X
Xonly launching TCL via the CLI is currently supported
X
Xsome of the gadget stuff is not being cleaned up
X
Xsome of the font stuff is not being cleaned up
X
Xno documentation for Tcl_Concat (essentially a Berkeley problem)
X
XTcl_Concat is not callable from outside the shared library
X
Xthe file requester should keep the list of files once it has it plus
Xit should scroll on-the-fly as the mouse pulls the proportional gadget
X
Xproportional gadgets in tcl aren't implemented yet
X
Xcommands like display should probably return the values of the things
Xthey set when an arg isn't present to cause them to be set, like "set"
X
Xneed to be able to fetch the width and height of a gadget
X
XThe intertask communications code works but doesn't always return all memory
Xused.
X
XTcla documentation is sparse.
X
XSeveral hundred to several thousand bytes of unneeded stuff is still 
Xgetting linked into the shared library.  I haven't had time to dig it
Xall out.
X
XThe library is linked large code, large data.  I have been unable to
Xget a small code, small data version to work.  There may be a problem
Xwith the library startup code in Manx 5.0a.  (As the example they provide
Xis trivial, it's kind of hard to tell.)  Anyway, if this can be made to
Xrun small code, small data it will save a couple thousand bytes in the
Xshared library.
X
END_OF_FILE
if test 2708 -ne `wc -c <'./docs/Bugs'`; then
    echo shar: \"'./docs/Bugs'\" unpacked with wrong size!
fi
# end of './docs/Bugs'
fi
if test -f './docs/tcla/resources.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./docs/tcla/resources.doc'\"
else
echo shar: Extracting \"'./docs/tcla/resources.doc'\" \(2928 characters\)
sed "s/^X//" >'./docs/tcla/resources.doc' <<'END_OF_FILE'
X
X
XResource Banks
X--------------
X
XYou must call TclaInitResources() to access the resource bank and use
Xthe resource bank management routines.
X
XThe model of easily intercommunicating programs provided by Tcl made
Xclear that it was necessary to provide a way for tasks to formally
Xshare named data entities.  For example, a SMUS loader might handle
Xthe loading and unloading of SMUS files, but a SMUS player would need
Xto be able to locate them in order to play them.
X
XResource banks were created by Hackercorp to address needs such as this,
Xand the resulting code is placed into the public domain.
X
XResource banks work like the Amiga resources accessed by AddResource,
XOpenResource, etc, but they maintain a number of named lists to which
Xthe actual data is a subordinate named entry to.
X
XFor example,
X
XResourceBankList -->  SMUS  -->  8SVX  -->  ILBM  -->  null
X                       |          |          |
X					introsong   strat1      pic1
X					   |          |          |
X					highscore   organ       null
X					   |          |
X					  null      ahhvoice
X					              |
X								null
X
X
X
XThe resource bank master list entry is located by doing an Amiga
XOpenResource looking for resourcebank.resource.  The first program
Xto look for the resource and not find it creates it.  The
Xresourcebank.resource entry and the top level entries in the list
Xare not expected to be removed for an entire run (i.e. til the
Xnext reboot)  This should only amount to a few dozen bytes.
X
XTo the resource handler, a resource is just a blob pointed to by
Xa 32-bit pointer that's specified when you connect something to
Xan entry in the resource bank.  That is to say that the resource
Xbank handling routines don't know anything about and don't care
Xabout anything at the other end of that pointer.
X
X
XThe user-callable routines are:
X
Xvoid *LocateResource(char *groupname, char *itemname)
X
X	given group name and entry name, locate a resource entry within 
X	the resource bank and return it's data pointer.  Returns NULL
X	if it can't find the specified resource entry.
X
X
Xint ConnectResource(char *groupname, char *resourcename, void *data)
X
X	given the name of an entry and the name of a group for it to go in,
X	locate the group, creating it if it doesn't exist, and find or
X	create the named entry, then set the data pointer to the passed
X	data pointer.
X
X
Xvoid *DisconnectResource(char *groupname, char *resourcename)
X
X	given a the name of a group and a resource entry, locat the
X	entry, remove it from the list and return the pointer to
X	the data attached to that resource.  Returns NULL if it couldn't
X	find it.
X
X
X
X
X
XTcl-callable resource routines
X------------------------------
X
XThere is a routine callable from Tcl that does a couple things with resource
Xbanks.
X
Xresource list banks
X
Xwill return a list containing the names of all the banks, and
X
Xresource list entries foo
X
Xwill return a list containing the names of all the entries in bank foo.
END_OF_FILE
if test 2928 -ne `wc -c <'./docs/tcla/resources.doc'`; then
    echo shar: \"'./docs/tcla/resources.doc'\" unpacked with wrong size!
fi
# end of './docs/tcla/resources.doc'
fi
if test -f './docs/tcla/menu.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./docs/tcla/menu.doc'\"
else
echo shar: Extracting \"'./docs/tcla/menu.doc'\" \(580 characters\)
sed "s/^X//" >'./docs/tcla/menu.doc' <<'END_OF_FILE'
X
X
X
XOnce you have called TclaInit, you may execute the following menuing 
Xcommands:
X
X
X	menu add windowname menuname itemname subitemname proc
X
XThe "menu add" command takes a window name, menu name, item name and 
Xoptional subitem name (send an empty string if your item doesn't have 
Xsubitems), creates a corresponding menu entry for the named window, 
Xand tags the item with the procedure (proc) or code to execute.  When 
Xthe menu entry is selected, the attached Tcl code will be selected.
X
XThe menu is changed for the current window.  Use the window command to
Xchange windows.
X
END_OF_FILE
if test 580 -ne `wc -c <'./docs/tcla/menu.doc'`; then
    echo shar: \"'./docs/tcla/menu.doc'\" unpacked with wrong size!
fi
# end of './docs/tcla/menu.doc'
fi
if test -f './docs/tcla/window.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./docs/tcla/window.doc'\"
else
echo shar: Extracting \"'./docs/tcla/window.doc'\" \(1355 characters\)
sed "s/^X//" >'./docs/tcla/window.doc' <<'END_OF_FILE'
X
X
XWindow commands are:
X
X	window open left top width height title
X		create the specified window, set up a null menu strip, add
X		the window to the interpreter's window list (handled through
X		the clientdata structure -- no changes were made to the
X		interpreter to support this), make it the current window,
X		and return a window handle
X
X	window close windowhandle
X		close the specified window, remove it from the window list,
X		discard its menu list, etc, etc
X
X	window limits windowhandle minwidth minheight maxwidth maxheight
X		set new max and min size limits for the specified window
X
X	window title windowhandle  newtitle
X		set the titles for the window (buggy)
X
X	window front windowhandle 
X		move the specified window to the front
X
X	window back windowhandle 
X		move the specified window to the back
X
X	window move windowhandle  deltax deltay
X		move the specified window by delta
X
X	window size windowhandle  deltax deltay
X		resize the specified window
X
X	window current windowhandle 
X		make the specified window the current window (for the display
X		command)
X
X	window blank windowhandle 
X		blanks the specified window draw area, more or less
X
X	window width windowhandle
X		returns the width of the specified window
X
X	window height windowhandle
X		returns the height of the specified window
X
X
XBUGS
X
Xarea is not figured out properly
X
Xtitles don't work right
X
END_OF_FILE
if test 1355 -ne `wc -c <'./docs/tcla/window.doc'`; then
    echo shar: \"'./docs/tcla/window.doc'\" unpacked with wrong size!
fi
# end of './docs/tcla/window.doc'
fi
if test -f './docs/tcla/gadgets.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./docs/tcla/gadgets.doc'\"
else
echo shar: Extracting \"'./docs/tcla/gadgets.doc'\" \(2405 characters\)
sed "s/^X//" >'./docs/tcla/gadgets.doc' <<'END_OF_FILE'
X
X
X	gadget add hit left top width height [relbottom] [relright] 
X		[relwidth] [relheight] [disabled]
X		[up tclcode] [down tclcode]
X
X			add a hitbox gadget.  Your up routine is executed if specified
X			when the mouse button goes up and your down routine is 
X			executed if specified when the button goes down.
X
X	gadget add toggle left top width height [relbottom] [relright] 
X		[relwidth] [relheight] [selected] [disabled]
X		[up tclcode] [down tclcode]
X
X			add a toggle gadget.  Up and down routines are executed as
X			above.  If selected is set, it will appear selected when
X			created.
X
X	gadget add string left top width height initial [relbottom] [relright] 
X		[relwidth] [relheight] [selected] [disabled]
X		[up tclcode] [down tclcode]
X		[stringcenter] [stringright]
X
X			add a string gadget.  Strings can be 100 chars long max.
X			The down routine, if specified, is executed when the user
X			clicks in the gadget area, the up routine, if specified,
X			is executed when the user hits enter.
X
X	gadget add integer left top width height initial [relbottom] [relright] 
X		[relwidth] [relheight] [selected] [disabled]
X		[up tclcode] [down tclcode]
X
X			A variation of string gadget, this guy allows one to enter
X			integers.
X
X	gadget add proportional left top width height [relbottom] [relright]
X		[relwidth] [relheight] [selected] [disabled]
X		[up tclcode] [down tclcode]
X		[horizontal index pixels_per_unit total]
X		[vertical index pixels_per_unit total]
X			index is the current index, pixels_per_unit is the pixels
X			per unit of things we're dealing with, usually font height
X			and width, total is the total number of units.
X
X	gadget remove gadgethandle
X			get rid of gadget
X
X	gadget on gadgethandle
X			unghost it
X
X	gadget off gadgethandle
X			ghost it
X
X	gadget value gadgethandle
X	gadget value gadgethandle [vertical,horizontal,vertunits,horizunits]
X		Fetch the value, boolean gadgets come out 0/1.
X		prop gadgets return the current position relative to the number
X		  passed for a total when created or last setvalue
X		horizunits and vertunits are the number of units (calculated from
X		the current gadget size and pixels_per_unit given at gadget
X		definition time) displayable on the screen in the relevant direction
X
X	gadget setvalue gadgethandle string or 0/1 for toggle
X	gadget setvalue gadgethandle [vertical,horizontal] currentindex total
X		for prop gadgets
X
X	gadget refresh
X			refresh the gadgets
X
END_OF_FILE
if test 2405 -ne `wc -c <'./docs/tcla/gadgets.doc'`; then
    echo shar: \"'./docs/tcla/gadgets.doc'\" unpacked with wrong size!
fi
# end of './docs/tcla/gadgets.doc'
fi
if test -f './docs/tcla/ickalloc.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./docs/tcla/ickalloc.doc'\"
else
echo shar: Extracting \"'./docs/tcla/ickalloc.doc'\" \(1098 characters\)
sed "s/^X//" >'./docs/tcla/ickalloc.doc' <<'END_OF_FILE'
X
X
Xickalloc - Intertask Failure-Checking Malloc
X
X
XWe are fairly clever about memory allocation for intertask messages.
X
XWe hardly have to do anything tricky to do this, but we have the one
Xtricky thing that text replies in reply messages are allocated by
Xthe guy doing the reply but deleted by the guy receiving it.
X
XThus, this needs to not use the normal ckalloc and ckfree, because
Xwhen a task exits, all the memory it allocated with ckalloc is freed,
Xand that can include memory owned by the other task.
X
XAnyway, if you look in ports.c you will see where intertask_ckalloc
Xand intertask_ckfree are called.
X
XNote: Manx alloc and free are brain-damaged and need to be replaced.
XThey can incur a lot of overhead.  Also, versions probably need to
Xbe created that bitch when you free something you didn't allocate.
XAs it is now, the Manx lib routines just blow off the request.
X
X
X#define MEMORY_MAGIC 0xcadbabe
X
X#include <functions.h>
X#include <exec/memory.h>
X
Xstruct mementry {
X	long length;
X	long memory_magic;
X};
X
Xvoid *intertask_ckalloc(size_t length)
X{
X}
X
Xvoid intertask_ckfree(void *where)
X{
X}
X
END_OF_FILE
if test 1098 -ne `wc -c <'./docs/tcla/ickalloc.doc'`; then
    echo shar: \"'./docs/tcla/ickalloc.doc'\" unpacked with wrong size!
fi
# end of './docs/tcla/ickalloc.doc'
fi
if test -f './docs/tcla/loop.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./docs/tcla/loop.doc'\"
else
echo shar: Extracting \"'./docs/tcla/loop.doc'\" \(894 characters\)
sed "s/^X//" >'./docs/tcla/loop.doc' <<'END_OF_FILE'
X
X'eventloop' and 'endeventloop' 
X
XWhen your Tcl program executes "eventloop", it will then enter the
Xeventloop.  This loop receives Intuition messages and commands from
Xother Tcl programs and processes them.
X
XIf you have routines you want to install into the event loop, you may
Xdo so by calling Tcla_AddEventLoop with the routine and the mask of
Xsignal bits that you want to be called for.
X
XOnly when a program is executing 'eventloop' can it receive, process
Xand reply to commands sent from other Tcl programs.  If you send a
Xmessage to a Tcl program that isn't executing 'eventloop', you will
Xhang until it does and receives and processes your message.  Asynchronous
Xmessages sent by the "post" command will not cause the sender to hang.
X
XThe command 'endeventloop' ends the event loop.  If program foo is
Xexecuting eventloop, doing a 'send foo endeventloop' will cause it
Xto exit the loop.
END_OF_FILE
if test 894 -ne `wc -c <'./docs/tcla/loop.doc'`; then
    echo shar: \"'./docs/tcla/loop.doc'\" unpacked with wrong size!
fi
# end of './docs/tcla/loop.doc'
fi
if test -f './docs/tcla/tclsend.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./docs/tcla/tclsend.doc'\"
else
echo shar: Extracting \"'./docs/tcla/tclsend.doc'\" \(184 characters\)
sed "s/^X//" >'./docs/tcla/tclsend.doc' <<'END_OF_FILE'
X
X
X
Xtclsend is a CLI program that can send a command to a Tcl program and
Xget a result.  tclsend doesn't have a Tcl interpreter, so it's relatively
Xsmall.
X
Xusage:
X
X	send foo command...
END_OF_FILE
if test 184 -ne `wc -c <'./docs/tcla/tclsend.doc'`; then
    echo shar: \"'./docs/tcla/tclsend.doc'\" unpacked with wrong size!
fi
# end of './docs/tcla/tclsend.doc'
fi
if test -f './docs/tcla/display.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./docs/tcla/display.doc'\"
else
echo shar: Extracting \"'./docs/tcla/display.doc'\" \(1525 characters\)
sed "s/^X//" >'./docs/tcla/display.doc' <<'END_OF_FILE'
X
X
XThe display command provides a rudimentary interface to display handling
Xon the Amiga.  It should be fairly apparent how to go about extending it.
X
XOnce you have called Tcla_Init, you may execute the following commands:
X
XThe display command draws into the current window as set by the window
Xcommand.
X
X	display draw x y
X
X	display move x y
X		move the current drawing position to window-relative (x,y)
X
X	display text message
X		write text message at the current drawing position
X
X	display apen value
X		set the color of the A-pen to value
X
X	display bpen value
X		set the color of the B-pen to value
X
X	display mode [jam1] [jam2] [complement] [inversvid]
X		set the draw mode to the logical OR of all the specifiers
X		following "mode"
X
X	display pixel x y
X		draw a pixel at window-relative location (x,y)
X
X	display textwidth text
X		determine the width "text" would occupy if output
X		to the current window with the current attributes
X
X	display fontheight
X		return the height of the current font in pixels
X
X	display font fonthandle
X		select for the current window the font identified by fonthandle,
X		where fonthandle was returned by a "font open" command
X
X	display fontstyle [normal] [underlined] [bold] [italic] [extended]
X		do a SetSoftStyle on the font for the current window to be
X		the logical "or" of underlined, bold, italic and extended.
X
X
XBUGS
X
XThese routines use atoi and they shouldn't, they should do whatever
XTcl does to handle strings that aren't numeric when they're expected.
XThis occurs in lots of places in Tcla.
X
END_OF_FILE
if test 1525 -ne `wc -c <'./docs/tcla/display.doc'`; then
    echo shar: \"'./docs/tcla/display.doc'\" unpacked with wrong size!
fi
# end of './docs/tcla/display.doc'
fi
if test -f './docs/tcla/panic.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./docs/tcla/panic.doc'\"
else
echo shar: Extracting \"'./docs/tcla/panic.doc'\" \(2473 characters\)
sed "s/^X//" >'./docs/tcla/panic.doc' <<'END_OF_FILE'
X
X
XTcla can panic.
X
XThis means that Tcla can encounter a situation that it can't recover from.
XFor example, it might detect corruption of one of its linked lists, be
Xunable to create a port, or detect some other error condition or get to
Xsomewhere where it was expedient for Tcl to "throw up its hands."
X
XIf Tcla panics, by default it will display a requester that makes some
Xexplanation of what the problem was, where the "continue" and "cancel"
Xoptions instead both say "panic."  
X
XAfter the user clicks on one of the panic gadgets, panic continues by 
Xcalling a user-specified cleanup routine, if one has been specified.
XThe user-specified routine can perform cleanup operations, including
Xcalling Tcl_DeleteInterpreter, which will cause Tcla to perform all
Xof its cleanup.  The user cleanup routine should then call exit, _exit,
XExit or whatever.  (So far, we have found that it is safe to go ahead
Xand call Tcl_DeleteInterp after a panic)
X
XThere are Tcla calls that allow the user to specify three special "upcall" 
Xroutines for use by Tcla.  These are routines that you specify that Tcl
Xcan call when it gets into trouble.  One, Tcla_CleanupRoutine, allows the 
Xuser to specify a cleanup routine that panic will call.  The second, 
XTcla_PanicRoutine, allows the user to replace the default panic behavior 
Xwith one of their own choosing.  When your panic routine is called, it 
Xreceives an argument of "char *" containing the panic text.  This routine 
Xmust take a standard Aztec C call (Lattice may work); that is, it must not 
Xhave a #pragma defined that causes it to expect or return arguments in 
Xregisters.
X
X	void 
X	Tcla_CleanupRoutine(struct TclaHeader *TclaHead, 
X		void (*cleanup_routine)(void));
X
X	void 
X	Tcla_PanicRoutine(struct TclaHeader *TclaHead, 
X		void (*panic_routine)(char *));
X
X	void Tcla_LowMemRoutine(struct TclaHeader *TclaHead, 
X		int (*lowmem_routine)(long));
X
XThe user-routine specified by Tcla_LowMemRoutine is called by Tcla if it
Xis unable to allocate some memory it has requested.  An argument to the
Xroutine is the long int number of bytes requested.  The routine is to
Xreturn a zero if Tcla is to go ahead and retry the memory allocation
X(presumably the user routine has freed some memory), or a nonzero to
Xindicate that Tcla is to go ahead and panic.  (A zero value was used to
Xmean that the allocation is to be retried to prevent a garbaged 
Xargument from causing an infinitie loop while trying to allocate and
Xcontinuously failing.)
X
END_OF_FILE
if test 2473 -ne `wc -c <'./docs/tcla/panic.doc'`; then
    echo shar: \"'./docs/tcla/panic.doc'\" unpacked with wrong size!
fi
# end of './docs/tcla/panic.doc'
fi
if test -f './docs/tcla/amigados.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./docs/tcla/amigados.doc'\"
else
echo shar: Extracting \"'./docs/tcla/amigados.doc'\" \(755 characters\)
sed "s/^X//" >'./docs/tcla/amigados.doc' <<'END_OF_FILE'
X
X
XTcla AmigaDOS Functions
X-----------------------
X
X"exec" takes a command and optional arguments and executes them 
Xthrough a CLI.  It grabs the standard output and error of the 
Xcommand and returns it as a string result to the caller.
X
XThus,
X
X	set a [dir df0:]
X
XWould set the variable a to the data output by "dir df0:"
X
X
XThe second command is "run."  run works just like "exec", except
Xthat the CLI command run by run has it's output go to the standard 
Xoutput of the tcl interpreter that executes it, which at this time
Xwould be a CLI window.
X
XThese routines uses temporary files it creates and deletes in the T:
Xdirectory.  It uses the prefixes of "TCLI" and "TCLO" and constructs
Xthe filenames including the program name to try to make them unique.
X
END_OF_FILE
if test 755 -ne `wc -c <'./docs/tcla/amigados.doc'`; then
    echo shar: \"'./docs/tcla/amigados.doc'\" unpacked with wrong size!
fi
# end of './docs/tcla/amigados.doc'
fi
if test -f './docs/tcla/stdfile.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./docs/tcla/stdfile.doc'\"
else
echo shar: Extracting \"'./docs/tcla/stdfile.doc'\" \(621 characters\)
sed "s/^X//" >'./docs/tcla/stdfile.doc' <<'END_OF_FILE'
X
X
Xstdfile - standard file requester
X
XCall TclaInitStdfile(interp) to install the stdfile file requester 
Xcommand into  your Tcl interpreter.
X
XOnce installed, you can call up a file requester as follows:
X
X	stdfile title default_file default_pattern
X
X
XThis uses the file requester written by Peter da Silva.  It has been
Xfairly widely distributed.  It is not the greatest file requester in
Xthe world, but it shouldn't take too much effort to greatly improve
Xit, or maybe somebody will hack a better one in there, and redistribute
Xit.
X
Xstdfile returns a string containing the name of the file requested, or
Xan empty string.
END_OF_FILE
if test 621 -ne `wc -c <'./docs/tcla/stdfile.doc'`; then
    echo shar: \"'./docs/tcla/stdfile.doc'\" unpacked with wrong size!
fi
# end of './docs/tcla/stdfile.doc'
fi
if test -f './docs/tcla/windowevent.do' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./docs/tcla/windowevent.do'\"
else
echo shar: Extracting \"'./docs/tcla/windowevent.do'\" \(577 characters\)
sed "s/^X//" >'./docs/tcla/windowevent.do' <<'END_OF_FILE'
X
X
X
X
XYou do a
X
X	windowevent attach eventtype routine
X
XTo attach a Tcl routine to a window message event type.  The events
Xsupported are:
X
X	newsize
X	refreshwindow
X	mousebuttons
X	menupick
X	closewindow
X	vanillakeys
X	rawkeys
X	intuiticks
X	activewindow
X	inactivewindow
X	newprefs
X	diskinserted
X	diskremoved
X
X
Xif routine is an empty string, detaches current event
Xif you attach a routine to an event that already has
Xa routine attached, the old one goes away
Xget returns the current routine or empty string if there
Xisn't one attached
X
X
X	windowevent get eventtype
X
Xreturns the command
X
END_OF_FILE
if test 577 -ne `wc -c <'./docs/tcla/windowevent.do'`; then
    echo shar: \"'./docs/tcla/windowevent.do'\" unpacked with wrong size!
fi
# end of './docs/tcla/windowevent.do'
fi
if test -f './docs/tcla/trace.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./docs/tcla/trace.doc'\"
else
echo shar: Extracting \"'./docs/tcla/trace.doc'\" \(599 characters\)
sed "s/^X//" >'./docs/tcla/trace.doc' <<'END_OF_FILE'
X
X
XTrace routines
X--------------
X
X
XYou need to call TclaInitTrace(interp) to install the trace routines 
Xinto your Tcl interpreter if you want them.
X
XOnce you have called TclaInitTrace, you may execute 'trace level' to
Xstart tracing, where level is the call depth you want to start tracing
Xat.  (For more info, check out the trace(3) stuff in the Tcl manual.)
X
XIt appears to be totally reasonable that, using the trace facility,
Xa trace capability can be set up by which the user gets specified
XTcl procedures to be called as a result of the trace routine being
Xcalled, but I have yet to go so far.
X
END_OF_FILE
if test 599 -ne `wc -c <'./docs/tcla/trace.doc'`; then
    echo shar: \"'./docs/tcla/trace.doc'\" unpacked with wrong size!
fi
# end of './docs/tcla/trace.doc'
fi
if test -f './docs/tcla/misc.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./docs/tcla/misc.doc'\"
else
echo shar: Extracting \"'./docs/tcla/misc.doc'\" \(350 characters\)
sed "s/^X//" >'./docs/tcla/misc.doc' <<'END_OF_FILE'
X
XMiscellaneous Tcl functions
X
XThe echo command is the same echo command included in the tclTest program
Xfrom Dr. Ousterhout.
X
XThe panic command takes an argument and executes the program's panic 
Xroutine.  It should probably take a variable number of args and work
Xlike "format", because that' how the hacklib panic works, but it doesn't
Xas of yet.
X
END_OF_FILE
if test 350 -ne `wc -c <'./docs/tcla/misc.doc'`; then
    echo shar: \"'./docs/tcla/misc.doc'\" unpacked with wrong size!
fi
# end of './docs/tcla/misc.doc'
fi
if test -f './docs/tcla/displayrequest' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./docs/tcla/displayrequest'\"
else
echo shar: Extracting \"'./docs/tcla/displayrequest'\" \(620 characters\)
sed "s/^X//" >'./docs/tcla/displayrequest' <<'END_OF_FILE'
X
X
Xdisplayrequest - display a requester from Tcl
X
X
XTo make displayrequest available to your Tcl interpreter, you must first
Xcall the initialization routine TclaInitRequester().
X
XOnce you have done so, you may do a:
X
X	displayrequest message yestext notext
X
XWhen executed, you will get a requester with the message text on the
Xscreen, and yestext and notext as the names of what are usually "Continue"
Xand "Cancel" gadgets.
X
Xdisplayrequest returns the string "1" to report selection of the "yes"
Xoption, and "0" to report selection of the "no" option.
X
Xset result [displayrequest "Exit without saving changes?" "YES" "NO"]
END_OF_FILE
if test 620 -ne `wc -c <'./docs/tcla/displayrequest'`; then
    echo shar: \"'./docs/tcla/displayrequest'\" unpacked with wrong size!
fi
# end of './docs/tcla/displayrequest'
fi
if test -f './docs/tcla/ports.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./docs/tcla/ports.doc'\"
else
echo shar: Extracting \"'./docs/tcla/ports.doc'\" \(1674 characters\)
sed "s/^X//" >'./docs/tcla/ports.doc' <<'END_OF_FILE'
X
XThe 'send', 'post' and 'programs' commands are available in your TCL 
Xinterpreter after calling InitTcla.
X
XThe send command allows you to send a command to another Tcl program.
X
XUsage is 'send programname message...'
X
XIf programname is the name of a program (the filename of the program when 
Xit's started) that has called TclaInitPort, your message will be queued
Xto a message port belonging to the other program, and your program will
Xwait for that program to reply with a reply message for your program.
X
XNote that this command fully preserves Tcl semantics, that is, if the
Xremote program returns an error, you get an error back (which kills
Xyour command unless you trap it), etc, etc, which is to say that a
X'send bar format "x%sz" "y"' should work exactly the same to your
Xprogram (assuming bar exists and is running, etc.) as if you had
Xexecuted 'format "x%sz" "y"'.
X
XThe post command functions like the send command, except that it
Xdoes a quick return with optional callback.  For example,
X
X	send smusloader song load foo
X
XWould send a command to program "smusloader" to load song "foo" and
Xwait for smusloader to reply.
X
X	post smusloader loaddone song load foo
X
X...would send a command to smusloader to load foo and return immediately.
XLater, when foo finishes the request, it will send a command, in this
Xcase "loaddone" to your program, with arguments being the result string
Xand TCL_OK/TCL_ERROR return value passed as arguments to your routine.
X
XThe "programs" command takes no arguments and returns a list containing
Xthe program names (port names) of all other programs that have Tcl ports,
Xwhich is all currently running programs that have called TclaInit.
X
END_OF_FILE
if test 1674 -ne `wc -c <'./docs/tcla/ports.doc'`; then
    echo shar: \"'./docs/tcla/ports.doc'\" unpacked with wrong size!
fi
# end of './docs/tcla/ports.doc'
fi
if test -f './docs/tcla/random.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./docs/tcla/random.doc'\"
else
echo shar: Extracting \"'./docs/tcla/random.doc'\" \(416 characters\)
sed "s/^X//" >'./docs/tcla/random.doc' <<'END_OF_FILE'
X
X
XThe random command returns a random number or seeds the random number
Xgenerator.
X
XUsge:
X
X	random x
X
Xreturns a random integer between 0 and x-1
X
X
X	random x seed
X
Xseeds the random number generator with x
X
X
XBUGS
X
Xuses the library routine, consequently a seed and the random number are
Xfor everyone using the shared library.  This will be changed to where
Xeach program using the library has a private seed and number.
END_OF_FILE
if test 416 -ne `wc -c <'./docs/tcla/random.doc'`; then
    echo shar: \"'./docs/tcla/random.doc'\" unpacked with wrong size!
fi
# end of './docs/tcla/random.doc'
fi
if test -f './tclprocs/hello.tcl' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./tclprocs/hello.tcl'\"
else
echo shar: Extracting \"'./tclprocs/hello.tcl'\" \(780 characters\)
sed "s/^X//" >'./tclprocs/hello.tcl' <<'END_OF_FILE'
X# this only works if run as a top-level procedure
X
Xglobal hellowin message width height
Xset hellowin [window open 300 50 300 50 Hello]
X
Xif {[string compare $argv ""] != 0} {
X	set userfont [font open $argv]
X	display font $userfont
X}
X
Xset message "Hello, world."
Xset width [display textwidth $message]
Xset height [display fontheight]
X
Xproc repaint_window {} {
X	global hellowin width height message
X	window current $hellowin
X	window blank $hellowin
X	display move [expr {([window width $hellowin] - $width) / 2}] [expr {([window height $hellowin] + $height/2) / 2}]
X	display text $message
X}
X
Xproc close_window {} {
X	global hellowin
X	window close $hellowin
X	endeventloop
X}
X
Xrepaint_window
Xwindowevent attach newsize repaint_window
Xwindowevent attach closewindow close_window
Xeventloop
END_OF_FILE
if test 780 -ne `wc -c <'./tclprocs/hello.tcl'`; then
    echo shar: \"'./tclprocs/hello.tcl'\" unpacked with wrong size!
fi
# end of './tclprocs/hello.tcl'
fi
if test -f './tclprocs/decomp.tcl' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./tclprocs/decomp.tcl'\"
else
echo shar: Extracting \"'./tclprocs/decomp.tcl'\" \(332 characters\)
sed "s/^X//" >'./tclprocs/decomp.tcl' <<'END_OF_FILE'
X
X
Xproc dump func {
X format "proc %s \{%s\} \{%s\}\n" $func [eval info args $func] [eval info body $func]
X}
X
Xproc dumpall {} {
X set result ""
X foreach i [eval info procs] {set result [concat $result \n [eval dump $i]]}
X return $result
X}
X
Xproc edit func {
X	print [dump $func] T:$func
X	run vi T:$func
X	source T:$func
X	run rm T:$func
X}
END_OF_FILE
if test 332 -ne `wc -c <'./tclprocs/decomp.tcl'`; then
    echo shar: \"'./tclprocs/decomp.tcl'\" unpacked with wrong size!
fi
# end of './tclprocs/decomp.tcl'
fi
if test -f './tclprocs/startup.tcl' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./tclprocs/startup.tcl'\"
else
echo shar: Extracting \"'./tclprocs/startup.tcl'\" \(484 characters\)
sed "s/^X//" >'./tclprocs/startup.tcl' <<'END_OF_FILE'
X
Xprint "welcome to tcl"
X
X#rename source oldsource
X
Xset path {{} tcl:tclprocs/}
X
Xproc newsource {file} {
X	global path errorInfo
X
X	foreach i $path {
X		echo trying $i
X		set result [catch {oldsource $i$file} result_text]
X		if {$result == 0} return
X		echo $result_text
X		if {[string compare [set result_text] "couldn't read"] != 0} {
X			error $result_text
X		}
X		echo yo
X	}
X	#error $result_text
X	error $errorInfo
X}
X
Xsource tclprocs:decomp.tcl
X
Xsource tclprocs:help.tcl
X
Xecho
X
X# commandloop
END_OF_FILE
if test 484 -ne `wc -c <'./tclprocs/startup.tcl'`; then
    echo shar: \"'./tclprocs/startup.tcl'\" unpacked with wrong size!
fi
# end of './tclprocs/startup.tcl'
fi
if test -f './tclprocs/help.tcl' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./tclprocs/help.tcl'\"
else
echo shar: Extracting \"'./tclprocs/help.tcl'\" \(224 characters\)
sed "s/^X//" >'./tclprocs/help.tcl' <<'END_OF_FILE'
X
Xglobal helppath
Xset helppath "tcl:help"
X
Xproc help {args} {
X	global helppath
X	if {[string compare $args ""] == 0} {
X		echo "Help is available for the following:"
X		run lc $helppath
X	} else {
X		run more $helppath/$args
X	}
X}
END_OF_FILE
if test 224 -ne `wc -c <'./tclprocs/help.tcl'`; then
    echo shar: \"'./tclprocs/help.tcl'\" unpacked with wrong size!
fi
# end of './tclprocs/help.tcl'
fi
if test -f './tclprocs/demo.tcl' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./tclprocs/demo.tcl'\"
else
echo shar: Extracting \"'./tclprocs/demo.tcl'\" \(3638 characters\)
sed "s/^X//" >'./tclprocs/demo.tcl' <<'END_OF_FILE'
X# this only works if run as a top-level procedure
X
Xproc twiddle {} {
X	for {set i 0} {$i < 80} {set i [expr {$i+4}]} {
X		display move [expr {80 - $i}] [expr {10 + $i}]
X		display draw [expr {80 + $i}] [expr {90 - $i}]
X	}
X}
X
Xproc clickme {whichway} {
X	display move 140 84
X	if {$whichway != 0} {
X		display apen 3
X	} else {
X		display apen 0
X	}
X	display text "- click me -"
X}
X
Xproc tick {} {
X	global currenttick
X	global nextcolor
X	set currenttick [expr {$currenttick + 1}]
X	if {($currenttick % 5) == 0} {
X		set nextcolor [expr {$nextcolor + 1}]
X		if {$nextcolor > 3} {set nextcolor 1}
X		display apen $nextcolor
X		twiddle
X	}
X	if {($currenttick % 7) == 0} {
X		clickme [expr {$currenttick & 1}]
X	}
X}
X
Xproc hit_gadget {} {
X	global demowin
X	window close $demowin
X	endeventloop
X}
X
Xglobal demowin
Xset demowin [window open 100 50 300 100 {Tcla Demo}]
Xwindow limits $demowin 300 100 300 100
X
Xset myfont [font open {ruby.font 15}]
X
Xdisplay font $myfont
Xdisplay fontstyle italic
Xdisplay move 160 30
Xdisplay text "Welcome"
Xdisplay move 170 45
Xdisplay text "to"
Xdisplay move 180 60
Xdisplay text "Tcla"
X
Xtwiddle
X
X#echo current window is $demowin
X
Xglobal currenttick
Xset currenttick 0
X
Xglobal nextcolor
Xset nextcolor 0
X
Xgadget add hit 150 84 [display textwidth "- click me -"] [display fontheight] up hit_gadget
X
Xwindowevent attach intuiticks tick
X
Xwindowevent attach closewindow hit_gadget
X
Xwindow activate $demowin
X
Xeventloop
X
Xrename twiddle ""
Xrename hit_gadget ""
Xrename click_me "" 
Xrename tick ""
X
X
X
Xglobal infowin
Xset infowin [window open 90 40 210 100 {Tcla Information}]
Xwindow limits $infowin 300 100 210 100
X
Xdisplay font $myfont
Xdisplay move 10 20
Xdisplay text "Tcl Information:"
Xdisplay move 30 40
Xdisplay bpen 1
Xdisplay text "  "
Xdisplay bpen 0
Xdisplay text " About Tcl"
Xdisplay move 30 60
Xdisplay bpen 1
Xdisplay text "  "
Xdisplay bpen 0
Xdisplay text " About Tcla"
X
Xdisplay font default
Xdisplay move 16 82
Xdisplay text "(check out the menus)"
X
X#echo current window is $infowin
X
Xdisplay font $myfont
Xgadget add hit 30 40 27 15 up tcl_hit_gadget
Xgadget add hit 30 60 27 15 up tcla_hit_gadget
X
Xproc close_routine {} {
X	global infowin
X	set a [displayrequest "Really leave the demo?" "LEAVE" "STAY"]
X	if {$a != 0} {
X		window close $infowin
X		endeventloop
X	}
X}
X
Xproc tcl_hit_gadget {} {
X	run more tcl:help/tcl
X}
X
Xproc tcla_hit_gadget {} {
X	run more tcl:help/tcla
X}
X
Xproc do_command_loop {} {
X	echo "entering a command loop..."
X	echo "you may enter Tcl commands directly to the command interpreter."
X	echo
X	echo "Hold down Ctrl and hit backslash ('\\') (which sends end-of-file"
X	echo "on the amiga) to return to the demo."
X	commandloop
X	echo "You have returned to the demo."
X}
X
Xwindowevent attach closewindow close_routine
X
Xmenu add project about {} tcla_hit_gadget
Xmenu add project commandloop {} do_command_loop
Xmenu add project quit {} close_routine
X
Xglobal gadwin
Xset gadwin [window open 390 40 110 100 {Gadget Demo}]
Xwindow limits $gadwin 110 20 110 400
Xglobal propgad
Xset propgad [gadget add proportional -15 9 16 -18 relheight relright vertical 0 [display fontheight] 100 up prop_moved]
Xwindowevent attach closewindow close_routine
Xwindowevent attach newsize prop_moved
X
Xproc prop_moved {} {
X	global propgad
X	set low [gadget value $propgad vertical]
X	set todo [gadget value $propgad vertunits]
X	set fontheight [display fontheight]
X	gadget setvalue $propgad vertical [gadget value $propgad vertical] 100
X	#echo low is $low and todo is $todo
X	for {set i 0} {$i < $todo} {set i [expr {$i + 1}]} {
X		display move 5 [expr {10 + $i * $fontheight}]
X		display text [format "%3d" [expr {$low + $i}]]
X	}
X}
X
Xprop_moved
Xwindow activate $infowin
X
Xeventloop
END_OF_FILE
if test 3638 -ne `wc -c <'./tclprocs/demo.tcl'`; then
    echo shar: \"'./tclprocs/demo.tcl'\" unpacked with wrong size!
fi
# end of './tclprocs/demo.tcl'
fi
if test -f './tcl.uu' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'./tcl.uu'\"
else
echo shar: Extracting \"'./tcl.uu'\" \(4584 characters\)
sed "s/^X//" >'./tcl.uu' <<'END_OF_FILE'
Xbegin 644 tcl
XM   #\P         #          (   ,B    &@    $   /I   #(D[Z!+1*
XMK( "9Q O#B)L@ (L;( 23J[^8BQ?2.<P G810?H#SB0(+P,O BQL@!9.KO_$
XM(@ D'R8?+&R %DZN_]!,WT ,2'@  4ZZ"@A83TYU2.<P("8O ! D;P 4+PXL
XM;( 63J[_Q"Q?) !*@V9 2A)G.$CG, (O"DZZ";A83R8 ) HB%RQL@!9.KO_0
XM3-] #$CG, )V 4'Z V<D""(7+&R %DZN_]!,WT ,8   E@R#     68<2.<P
XM G8%0?H#0R0((A<L;( 63J[_T$S?0 Q@&DCG, )V%D'Z RTD""(7+&R %DZN
XM_]!,WT ,2A)G.$CG, )V D'Z R8D""(7+&R %DZN_]!,WT ,2.<P B\*3KH)
XM(%A/)@ D"B(7+&R %DZN_]!,WT ,2.<P G8!0?H"SR0((A<L;( 63J[_T$S?
XM0 Q,WP0,3G5(>@+72'@  4ZZ_OY.NOZN4$].=4Y5_Z1(YS\R)&T #)W.>@!\
XM "M.__AP $/Z MLL;( 23J[]V"QM__@I0( "9CA([4 ,__!V'$'Z LHD""\#
XM+P(L;( 63J[_Q"( )!\F'RQL@!9.KO_03.U #/_P2'@  4ZZ")183RM.__@L
XM;( "3J[_OBQM__@F0$CM1 #_]' !1?H"(D/Z I@@2RQL@ ).KO]\3.U$ /_T
XM)"T "%."=@%*@F\  ,I(>@)[( /E@"\R" !.N@:^2H!03V8<#((    "; 1.
XMNO\F( /E@"QR" 14@U6"8   E$AZ DP@ ^6 +S(( $ZZ!HQ*@%!/9AH,@@  
XM  )L!$ZZ_O0@ ^6 +#((!%2#58)@8B .9@P@ U*#Y8 J,@@ 4X)*@F].*T[_
XM^" #Y8#0BB! ( (L;( "3J[_CBQM__@H $CM1 #_]' !)$1#^@':($LL;( "
XM3J[_?$SM1 #_]"M.__@@1"QL@ ).KO_<+&W_^'0 8 #_-$CM1 #_]"1&(&W_
XM]")0($LL;( "3J[_4DSM1 #_]"M __PK3O_X0?K]$B)((&W__"QL@ ).KO] 
XM+&W_^" .9T9(>@%Y2&W_K$ZZ!S O#DAM_ZQ.N@;02.U$ /^DE<IP $'M_ZPB
XM2"!++&R  DZN_Z!,[40 _Z0N "\3+P=.NOT(3^\ &&!J2H5G*DCM1 #_])7*
XM<  B12!++&R  DZN_Z!,[40 __0N "\3+P=.NOS84$]@/$CM1 #_])7*< !#
XM^@$#($LL;( "3J[_H$SM1 #_]$CM1 #_])7*< !#^@$!($LL;( "3J[_H$SM
XM1 #_]"M.__@@2RQL@ ).KO^L+&W_^"M.__@B;( "+&R $DZN_F(L;?_X0J=.
XMN@9N6$],WTS\3EU.=7!R;V=R86T@86)O<G1E9 H 17)R;W( 17)R;W(@*&%N
XM9"!B860@<F5T=7)N*0 Z( !U<V%G93H@=&-L(%LM9B!F:6QE;F%M95T@6RUP
XM('!O<G1N86UE72!;87)G<RXN70!T8VQA+FQI8G)A<GD =6YA8FQE('1O(&]P
XM96X@=&-L82YL:6)R87)Y &%R9W8 +68 +7  <V]U<F-E( !S;W5R8V4@=&-L
XM<')O8W,Z<W1A<G1U<"YT8VP 8V]M;6%N9&QO;W   "I/87)#[( 21>R $K7)
XM9@XR/  5:PAT "+"4<G__"E/@!HL>  $*4Z $DCG@( (+@ $ 2EG$$OZ  A.
XMKO_B8 9"I_-?3G-#^@ B3J[^:"E @!9F#"X\  . !TZN_Y1@!BI/3KH &E!/
XM3G5D;W,N;&EB<F%R>0!)^0  ?_Y.=4CG "!(YP "(CP  0  ,"R !L'\  8L
XM;( 23J[_.DS?0  I0( >9AY(YP$&F\TN/  !   L;( 23J[_E$S?8( N;( :
XM3G4@;( >0F@ !"!L@!XQ?  ! ! @;( >,7P  0 *(&R &B L@!J0J  $4( I
XM0( B(&R (B"\34%.6$CG  *3R2QL@!).KO[:3-]  "1 2JH K&<\+R\ #"\O
XM  PO"DZZ 0PI?     & )B!L@!Y8B# 0 $"  #" (&R 'M'\    "C 0 $" 
XM #" 3^\ #&!J2.<  B!*T?P   !<+&R $DZN_H!,WT  2.<  B!*T?P   !<
XM+&R $DZN_HQ,WT  *4" *B!L@"I*J  D9R9(YP "(&R *B!H "0B$"QL@!9.
XMKO^"3-]  "\L@"HO"DZZ HI03REL@"J +DCG  (L;( 63J[_RDS?0  @;( >
XM((!(YP "+&R %DZN_\1,WT  (&R 'B%   9G)$CG( (D/    ^U!^@ T(@@L
XM;( 63J[_XDS?0 0@;( >(4  #"\L@"XO+( R3KKZC%!/+P!.N@-Z6$],WP0 
XM3G4J $CG.#(F+P <*"\ ("9O "0@0TJH *QG%"!#("@ K.6 +$ @+@ 0Y8 D
XM0& $)&R "! 22(!(P-"$5( I0( V2.<  G( ("R -BQL@!).KO\Z3-]  "E 
XM@#IF!DS?3!Q.=1 22(!(P"0 +P(@2E*(+P@O+( Z3KH"J$AZ 4H@0M'L@#HO
XM"$ZZ MHO!"\++RR .DZZ 30@;( Z0C H "E\     8 R)$+5[( Z4HHF2D_O
XM " 0$DB 2, D  R     (&<@#((    )9Q@,@@    QG$ R"    #6<(#(( 
XM   *9@12BF#,#!( (&UV#!( (F8J4HH0&DB 2, D &<<%L(,@@   ")F$ P2
XM ")F!%**8 9"*___8 )@VF X$!I(@$C ) !G+ R"    (&<D#((    )9QP,
XM@@    QG% R"    #6<,#((    *9P06PF#*0AM*@F8"4XI2K( R8 #_4D(3
XM2.<  G( ("R ,N6 6( L;( 23J[_.DS?0  I0( N9@A"K( R8 #^T'0 )&R 
XM.F :( +E@"!L@"XAB@@ +PI.N@&JU<!2BEA/4H*TK( R;> @ N6 (&R +D*P
XM" !@ /Z8( !,[P,   0@""(O  Q*&&;\4X@0V5?)__P$@0 !  !J\D(@3G5,
XM[P,   2SR&<,<  0&+ 95LC_^F8$< !.=6,$< %.=7#_3G5(YS R+&\ &$CG
XM  )P $/Z -8L;( 23J[]V$S?0  I0( ^9@9,WTP,3G5(YP "(&\ ("!H "0@
XM:  $+&R /DZN_[),WT  )$!*@&=^2.<  D/Z *$@:@ V+&R /DZN_Z!,WT  
XM) !G4$CG( (D/    ^TB%RQL@!9.KO_B3-] !"9 2H!G,B +Y8 F "!#+6@ 
XM" "D+4L G$CG( (D/    ^U!^@!6(@@L;( 63J[_XDS?0 0M0 "@2.<  B!*
XM+&R /DZN_Z9,WT  2.<  B)L@#XL;( 23J[^8DS?0 !"K( ^8 #_0&EC;VXN
XM;&EB<F%R>0!724Y$3U< *@!,[P,   0@"$H89OQ32!#99OQ.=4SO P  !" (
XM(B\ #& "$-E7R?_\9PP$@0 !  !J\$YU0AA1R?_\!($  0  :O).=2!O  0@
XM"$H89OQ32)' ( A.=4SO P  !" ($-EF_$YU2JR 0F<4(&R 0B!H  1.D"!L
XM@$(I4(!"8.9*K(!&9P8@;(!&3I O+P $3KH !EA/3G5(YS  )B\ #$JL@!YG
XM,G0 8 HO DZZ 7!83U*",&R !K'";NY(YP ","R !L'\  8B;( >+&R $DZN
XM_RY,WT  2JR 2F<&(&R 2DZ02JR #&<42.<  B(L@ PL;( 63J[_IDS?0 !*
XMK(!.9P@@;(!.(*R 4DJL@%9G%$CG  (B;(!6+&R $DZN_F),WT  2JR 6F<4
XM2.<  B)L@%HL;( 23J[^8DS?0 !*K(!>9Q1(YP "(FR 7BQL@!).KOYB3-] 
XM $JL@&)G%$CG  (B;(!B+&R $DZN_F),WT  2.< !BQX  0(+@ $ 2EG$$OZ
XM  A.KO_B8 9"I_-?3G,J7TJL@"IF/$JL@#IG-$CG  (@+( V(FR .BQL@!).
XMKO\N3-]  $CG  (@+( RY8!8@")L@"XL;( 23J[_+DS?0 !@)$CG  (L;( 2
XM3J[_?$S?0 !(YP "(FR *BQL@!).KOZ&3-]  $CG  (B;( 6+&R $DZN_F),
XMWT  ( ,N;( :3G5,WP ,3G5(YR @)"\ #'(&( ).N@!*)$#5[( >2H)M##!L
XM@ :QPF\$2I)F$"E\     X!F</],WP0$3G4P*@ $ D"  &822.<  B(2+&R 
XM%DZN_]Q,WT  0I)P &#82.=P #0!Q, F 4A#QL!(0T)#U(-(0,#!2$!"0-""
XM3-\ #DYU      /L     0    $   4N         _(   /J    !       
X;%                 /R   #ZP    $   /R
X 
Xend
END_OF_FILE
if test 4584 -ne `wc -c <'./tcl.uu'`; then
    echo shar: \"'./tcl.uu'\" unpacked with wrong size!
fi
# end of './tcl.uu'
fi
echo shar: End of shell archive.
exit 0
-- 
-- uunet!sugar!karl	"As long as there is a legion of superheros, all else
--			 can surely be made right." -- Sensor Girl
-- Usenet access: (713) 438-5018