#	Copyright (c) 1991, 1992 UNIX System Laboratories, Inc.
#	All Rights Reserved

#	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF
#	UNIX System Laboratories, Inc.
#	The copyright notice above does not evidence any
#	actual or intended publication of such source code.

#ident	"@(#)wksh:olexamples/README	1.3"


This directory contains WKSH OPEN LOOK example scripts.  Here is a short
explanation of the programs.  None of the programs is really robust
enough to be a final product at this time, and some features of some
programs are not implemented.  These are provided simply to show some
typical WKSH programming techniques.  Also, some of these programs
have hard-coded colors and fonts, which is not recommended for robust
product quality programs (resource files should be used instead).

ammort
		Calculates fixed-interest loan ammortization schedules.
wcalc
		A 4-function calculator with memory, square, square-root and
		reciprocal.  Does the math by spawning calls to awk.
wcalen
		A simple calendar application.  Has "week at a glance", shows
		current day's events by default, can view months.  Has the
		ability to schedule recurring events ("Meeting every Tuesday").
		Spawns calls to "cal" to figure out dates.  Stores
		events in $HOME/calendar directory, one file per day.  Needs
		some method to delete old entries after a certain amount of
		time, and needs a search feature to be really usable.
helloworld
		The traditional UNIX System example program.
lander
		Play the game of "Luner Lander".  Land your luner module, and
		if your velocity is less than 10 m/s you don't explode and die
		a firey death.
wkcmd, *.opts
		The wkcmd script takes as one of its arguments one of the
		*.opts files and provides a simple interface to a UNIX
		command with options.  Other options files can be written
		to provide other simple interfaces.  Basically, it parses
		the options file to produce a property sheet, and when
		requested will execute a UNIX command with the appropriate
		options and show the results.  Because some UNIX System
		commands are not well behaived in their use of options, this
		does not always work out.  For example, on some systems
		"wc -lc" works but "wc -l -c" does not.  Also, the options
		files are for System V, ps(1) takes different options on
		other systems, etc.
procs
		An example of creating an interface to a UNIX System command
		(ps).
sampler
		Most widgets in haphazard fashion.
timer
		A simple stopwatch style program.

progguide*
		The examples from the WKSH for OPEN LOOK Programmer's Guide, 
		in the order that they are presented.  The number following
		the string progguide indicates the Chapter 3 figure number.
		So, progguide6 is Chapter 3 - Figure 6.

attach.c
		This is a trivial example of a user-attachable command.
		This will only work on systems with Dynamic Shared Objects,
		like SunOs 4.1 or SVR4, but not SVR3 or earlier versions.

		On a SVR4 system, you can compile this into a shared
		object by using the following command line:

			cc -G -K PIC -o libattach.so attach.c

		On SunOs 4.1 or later you make this a shared object
		by doing:

			cc -c -PIC attach.c
			ld -o libattach.so attach.o

		Then, from within WKSH, you can execute:

			libload ./libattach.so
			cmdload argprint

		And then you can just start using argprint as a ksh
		built-in command.

		Note that ./libattach.so is necessary because the dynamic
		library commands need a "full" path to find the library
		if it's not in /usr/lib or in your $LD_LIBRARY_PATH.
