This directory contains some example Tcl extensions that make use of the
NIX utility functions.  These were originally written awhile ago, at odd
moments now and then, using Angel Li's original port of Tcl to VMS.  So,
don't judge me too harshly! :)

These examples are from NICL, my contribution to the list of cutesy, Tcl
shell names.  I also have a PICL language (project-specific extensions
to NICL), WIMP (Tcl with Motif extensions), and TWERP (project-specific
extensions to WIMP)!  Anyway, NICL adds network I/O and timer capabilities
to Tcl.  The following source files are included here:

    nicl.c        - is the main routine for NICL.  It initializes the
                    Tcl interpreter, executes the startup script file,
                    and invokes the NIX event processing loop.

    ncl_net.c     - interprets the "ncl_net" Tcl extensions.  New network
                    connections are registered with the NIX I/O event
                    handler and callback functions (contained herein)
                    are invoked in response to I/O events.

    ncl_timer.c   - interprets the "ncl_timer" Tcl extension.  This Tcl
                    command registers one-shot or periodic timers with
                    the NIX I/O event handler.

These examples are not compilable (you don't have all the header files)
and are not linkable (you don't have our local libraries or all the
NICL source code).  They're just intended to show you how I used the
NIX utilities in a Tcl program.

When I originally wrote these, the various Tcl packages for network
communications were not yet available, so have patience with the code.
Network messages are sent between clients and servers as XDR network
records (i.e., using the XDRREC_xxx functions), each of which contains
a single ASCII string.  Once a server answers a connection request, the
listening socket is closed and must be reopened by another Tcl command.
There is no provision for explicitly closing a connection.  The timer
command is fairly straightforward.

The conditionally-compiled VMS code uses the VMS event flag capability
of the NIX utilities.  This is NOT absolutely necessary under VMS - the
SELECT(2)-based NIX event processing loop works equally well, as long
as you're just monitoring socket connections.  I only used event flags
because the NCL_NET.C routines are just a cut-and-paste from my Motif-based
WIMP program, which HAS to use event flags because that's what DECWindows
uses.

I apologize for the "..." description in NICL.C's prolog and for some of
the boiler-plate comments in the other files!

                                        Alex Measday
                                        alexm@vlsi.gsfc.nasa.gov
