ftp.nice.ch/pub/next/graphics/vector/PencilTCLClient.NI.bs.tar.gz#/PencilTCLClient

README
 
customAppInit.c
[View customAppInit.c] 
graph.tcl
[View graph.tcl] 
pencilTCL_startup.tcl
[View pencilTCL_startup.tcl] 
ptcl
 

README

README --- ptcl (1995 by Florian Marquardt)

You can send commands to my vector-drawing program Pencil.app via Distributed Objects. I have written a program named PencilTCLClient (ptcl) to simplify this task. (ptcl is based on tcl 7.3 and tclsh by John Ousterhout, University of California at Berkeley)

One can use ptcl to create/open/save/print documents, add graphic objects to the current document, edit the current selection and read out the graphic objects' attributes. This could be useful for writing scripts that create a graph in Pencil from some text data, so the user can edit it afterwards.

Start Pencil.app, select "Info > Register as TCL Server", start ptcl in a Terminal window. Enter 'help' at the prompt to get a list of available commands. ptcl is a modified version of the tclsh, based on tcl 7.3 by John Ousterhout, University of California at Berkeley. You can use all standard tcl commands in ptcl.

If you want to change and recompile ptcl, you need a compiled version of the tcl-library (source available via anonymous ftp from all major ftp sites, look for tcl7.3).  I have mine in /usr/local/lib/libtcl.a and tcl.h in /usr/local/include/tcl.h. Use

cc customAppInit.c -ObjC -ltcl -lNeXT_s -u _main -o ptcl

to build ptcl. If you prefer your own front-end, search for "/* BEGIN of PencilTCL specific functions */" in customAppInit.c and call Init_PencilTCL(interp) at the beginning of your code. You may have to remove "[Application new]" in case you already have an Application object.

I used
cc customAppInit.c -ObjC libtcl.a -lNeXT_s -u _main -o ptcl -arch m68k -arch i386
to compile ptcl fat. libtcl.a was a fat version of the tcl-library in the current directory (I added "-arch m68k -arch i386" to the compiler options in the tcl Makefile).

If you have got the tcl 7.3 distribution and don't know how to build it, here is what Michael B. Johnson (WavesWorld) has found out:
"
********
I added 

CPP='cc -E'

to line 25 of configure, so configure would work right on the NeXT.

********

On the NeXT, strtod doesn't work right, but is included in the
shared libraries.  So, you want to use the compat/strtod.c 
version, but you need to change the name so it doesn't conflict.
This entails two changes: change the name of strtod() to strtodTcl(),
and change anywhere in the tcl core code that calls it.  Luckily, this
is only three places:

tclExpr.c:384:	valuePtr->doubleValue = strtod(p, &term);
tclExpr.c:496:	    valuePtr->doubleValue = strtod(p, &term2);
tclGet.c:122:    d = strtod(string, &end);

I changed each of those.

I also had to add an extern declaration in each that used this
new routine so they'd know it returned a double (or all hell
would break loose...)

********
"

For the copyright notice concerning the TCL part of this software, look at the beginning of customAppInit.c. My part of the program is Copyright 1995 by Florian Marquardt.
You may freely distribute copies of this program.

Use it at your own risk:

BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

Florian Marquardt
a0047@freenet.uni-bayreuth.de

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.