
				  Pcomm
		      A Unix Telecommunication Program

Things to do first:

	1) Figure out what files you need.  There is a shell archive
	called "Unixpc.shar" that contains additional (and replacement)
	files for users of the AT&T Unix PC 7300/3b1.

	2) Create a default directory where the Pcomm support files will
	go.  A good location might be /usr/local/lib/pcomm.

	3) Edit the Makefile to reflect the location of the default
	directory (PCOMM_LIB), the location of the executable programs
	(BIN_DIR), and the location and file extension of the on-line
	manuals (MAN_DIR) and (MAN_EXT).

	4) Install the four sample support files Pcomm.dial_dir,
	Pcomm.extrnl, Pcomm.modem, and Pcomm.param to the default
	directory by typing "make install_support".  Please remember
	these are just sample files...

	5) Install the on-line manual pages Pcomm.1, Pcomm_cmd.1,
	Matches.1, and Waitfor.1 to the proper /usr/man directory by
	typing "make install_man".  For those without access to nroff,
	I've included the output files called Pcomm.out, Pcomm_cmd.out,
	Matches.out, and Waitfor.out in the last shell archive.

	6) Print the Pcomm Reference Manual.  The Doc.me file is the
	nroff input which should be run thru tbl and the "me" macro
	package, as in:

		tbl Doc.me | nroff -me -Twhatever | lp

	For those without access to nroff, I've included the output file
	called Doc.out in the last shell archive.

	The "me" macro package appears to be freely available and is
	included in the Berkeley 4.3 public distribution.

How to compile Pcomm:

	1) There is a shell script called "Configure.sh" that should
	provide some information about your system.  It does *not* edit
	the "Makefile" or" config.h" files...

	2) Edit the "config.h" file to suit your system's needs and your
	personal taste.  Sites running HoneyDanBer (HDB) UUCP should pay
	particular attention to the LOCK_DIR and ASCII_PID definitions.
	The definitions in config.h are:

	BSD		Define if you're using a Berkeley flavor of Unix.
			You will also have to edit the Makefile in
			several places.

	UNIXPC		If defined, use the dial(3) routines specific
			to the AT&T Unix PC 7300/3b1.  Useful only if
			the On Board Modem (OBM) is to be used.

	OLDCURSES	If defined, use the older version of curses(3).
			(uses termcap in lieu of terminfo).

	NOPROMOTE	If defined, do not promote missing video
			attributes to standout.  Normally, curses(3)
			attempts to compensate for missing attributes.

	LOG_CALLS	If defined, Pcomm will keep an administrative log
			of all calls.  The log contains the name of the
			person making the call, the phone number, and a
			date/time stamp.  Useful for verifying long
			distance phone bills.

	LOGFILE		The path to the log file (if LOG_CALLS is
			defined).  It should have write permission to
			all or be writeable under set-user/group-id
			conditions.

	LIMIT_LD	If defined, Pcomm will limit long distance
			(toll) calls to a privileged group.  The file
			"admin.c" may require tweaking to detect long
			distance numbers.

	GROUP_NAME	The name of the group that is allowed to make
			long distance calls (if LIMIT_LD is defined).

	LPR		The path to the line printer program (this is
			not the name of the device).

	LPRINT		The path to the "pretty" line printer program.
			If none exist, use "pr | lp".

	DEFAULT_DIR	The path to the directory that contains the
			default Pcomm support files.

	LOCK_DIR	The path to the directory where the UUCP lock
			files are found.  On HDB systems this would
			probably be /usr/spool/locks.

	ASCII_PID	If defined, the lock files will contain an ASCII
			encoded process id (PID).  On HDB systems this
			is the default.

	XENIX_LOCKS	If defined, the last letter of the device name
			is folded to lower case when creating the lock
			file.  Newer version of XENIX may require this.

	SVR4_LOCKS	If defined, the new UUCP lockfile format
			introduced in SVR4 will be used.

	XMC_BROKE	Does the status line scroll up when using "magic
			cookie" terminals?  Some Pyramid and AT&T
			systems may require this to be defined.  Find a
			magic cookie terminal (a Wyse 50 for example),
			and see what happens.

	WGETCH_BROKE	Does the alarm() system call work correctly with
			the wgetch() function?  Symptom:  the initial
			screen doesn't go away by itself after 5
			seconds.

	O_NDELAY_BROKE	Does the fnctl() to turn off the O_NDELAY mode
			sometimes fail to work?  Symptom: no response
			from the modem.

	CLIST_SIZ	The size of the serial port character buffer.
			The default is 64.

	INPUT_BUF	The size of the input buffer (should be about the
			same size as CLIST_SIZ).  The default is 64.

	OUTPUT_BUF	The size of the output buffer (should be about
			one half INPUT_BUF).  The default is 32.  Systems
			without dedicated I/O processors may require a
			small INPUT_BUF value to avoid the problem of a
			"choppy" display.

	MEMMOVE		The name of the memory copy routine. The default
			is memmove(), although memcpy() or bcopy() will
			work (if they correctly handle target and source
			overlap).

	SETUID_BROKE	Does your version of Unix allow you to flip-flop
			back and forth between the real and effective
			user (or group) ID?  Some Masscomp systems will
			require this to be set.

	HAVE_STRSTR	Does your system have the strstr() function?
			Most Berkeley systems will require this to be
			#undef.

	HAVE_USLEEP	Does your system have the usleep() function?
			Most non-Sun system will require this to be
			#undef.

	HAVE_TRUNCATE	Does your system have the truncate() system call?
			Most modern systems do.

	3) Edit the Makefile.  There are provisions in the Makefile to
	include getcwd(3) and getopt(3) routines if they are missing
	from your system.  You may want to customize the CFLAGS and
	LDFLAGS assignments to suit your needs.

	If compiling under Berkeley Unix, you will have to edit the
	Makefile on the following lines:

		#for old curses(3) or Berkeley systems
		CURSES = -lcurses -ltermcap
		#CURSES = -lcurses

		#for System V or Berkeley TTY interface
		TTY.C = tty_ucb.c
		TTY.O = tty_ucb.o
		#TTY.C = tty_att.c
		#TTY.O = tty_att.o

		#for System V poll() or Berkeley select()
		IPC.C = ipc_ucb.c
		IPC.O = ipc_ucb.o
		#IPC.C = ipc_att.c
		#IPC.O = ipc_att.o

	All the defaults in config.h assume a AT&T flavor of Unix, sorry
	about that...

	4) Compile pcomm.  Type "make".  The "make install" option will
	attempt to copy "pcomm" into the BIN_DIR directory given in the
	Makefile.  However, those sites running HDB UUCP software may
	require that you to change the mode of "pcomm" to be set-user-id
	to uucp.

	Three external programs (pcomm_cmd, waitfor, and matches) are
	included in the distribution to help in creating auto-login
	shell scripts.

How to configure Pcomm:

	Please remember that the Pcomm support files provided are just
	examples.  They must be modification by you.

        1) Determine the names of the devices that Pcomm will be using.
        Pcomm must use the same device names that UUCP uses.  For
        example, if your system has two names for the same device such
        as "ttya" and "cua0", then use the one that UUCP uses, not the
        one that getty uses.  Some systems use "tty01h" to designate a
        bi-directional tty line used by both getty and UUCP.

	2) Get out the books that came with your modems.  You're gonna
	have to know a lot about your modems in order to configure them
	correctly to suit both Pcomm's needs and the needs of your
	getty/UUCP settings.

	3) Here are the "real life" settings for my Telebit Worldblazer
	on a Dell SVR4 box running uugetty.

        My Telebit WorldBlazer modem for my dialin/dialout port is set
        with the following commands.

		&F 	Restores factory settings
		L1	Low speaker volume
		X2	Detailed result codes (connect speeds)
		Q2	Turns on result codes only when dialing out
		&C1	DCD follows the carrier
		&D3	Hard reset on loss of DTR
		S0=1	Answer on first ring
		S7=60	60 second wait for carrier
		S51=6	Interface speed set to 38400 bps
		S58=2	Full duplex RTS/CTS flow control
		S59=15	Result code extensions
		S61=0	Pass modem breaks to the other end
		&W	Save in NVM

	AT&V
	WorldBlazer - SA - Version LA5.00W- Active Configuration
	 B1  E1  L1  M1  P   Q2  V1  X2  Y0 
	&C1 &D3 &G0 &J0 &L0 &Q0 &R3 &S0 &T4 &X0 
	S000:1   S001=0   S002=43  S003=13  S004=10  S005=8   S006=2   S007:60 
	S008=2   S009=6   S010=14  S011=70  S012=50  S018=0   S025=5   S026=1  
	S038=0   S041=0   S045=0   S046=0   S047=4   S048=0   S050=0   S051:6  
	S056=17  S057=19  S058:2   S059:15  S060=0   S061:0   S062=15  S063=0  
	S064=0   S068=255 S069=0   S090=0   S092=0   S093=8   S094=1   S100=0  
	S104=0   S105=1   S111=255 S112=1   S151=4   S155=0   S180=2   S181=1  
	S183=25  S190=1   S191=7   S253=10  S254=255 S255=255 

	/usr/local/lib/pcomm/pcomm.modem:

	TTY_1=tty01h;TELEBIT;38400
	MODEM_1a=TELEBIT;ATZ!~~!;ATDT;!;~~+++~~ATH0!
	MODEM_1b=Y;CONNECT 300;CONNECT 1200;CONNECT 2400;CONNECT 4800;CONNECT 9600;CONNECT FAST;
	MODEM_1c=BUSY;NO CARRIER;NO DIALTONE;ERROR

	/etc/uucp/Dialers:

	wblazer   =W-,	"" \M\dATZ OK ATDT\T CONNECT \m\c

	/etc/uucp/Devices:

	ACU tty01h,M - 38400 wblazer

	/etc/uucp/Systems:

	system Any ACU 38400 5551212 "" \r ogin: mylogin assword: mypassword

	/etc/inittab:

	01h:23:respawn:/usr/lib/uucp/uugetty -t60 tty01h wblazer

	/etc/gettydefs:

	wblazer# B38400 SANE HUPCL # B38400 SANE IXANY TAB3 #login: #wblazer

	4) Update the sample modem/TTY database.  I know I'm asking the
	impossible, but...  Read section 3 and the Appendices of the Doc
	file first.  Then run Pcomm to update the modem/TTY database by
	using the TTY Setup and the Modem Setup menues.

	5) There is a Question and Answer file (called Q_and_A) that may
	help diagnose problems.

Portability considerations:

	1) Pcomm makes use of the bold, blinking and standout video
	attributes.  My concept of "standout" and "reverse" might be
	different than yours (I like "standout" to be a brighter version
	of "reverse").  Some very old versions of curses will ignore the
	standout mode if you're on a magic cookie terminal.

	2) The "port.c" file has a place where you can include your own
	routine to toggle the getty process on a port (if required).

	3) If you compile Pcomm with LOG_CALLS defined, you'll have to
	look at the code in "admin.c" to see if the long distance
	detection routine is correct for your site.

	4) There is a "typedef SIG_TYPE" in the config.h file to help
	silence the compiler's warning messages about the signal()
	return value.

Notes for Sun users...  There are several problems that apparently only
surface with SunOS 4.x.  Here are some notes to help out.

        1) Pcomm was really designed to work in an AT&T world.  If you
        compile the code with the /usr/5bin/cc compiler, you'll end up
        with a better product.  To do so, you'll need to use default
        AT&T parameters in config.h (undef OLDCURSES and undef BSD, etc)
        plus the default AT&T parameters in Makefile for (CURSES, TTY.C,
        and TTY.O).  You'll also have to change the CC and LD variables
        in the Makefile to reflect /usr/5bin/cc.

        However, SunOS 4.x doesn't like the AT&T versions of IPC.C and
        IPC.O, so use the Berkely ones.  This is contrary to what the
        Configure.sh script will tell you!  Perhaps SunOS 5.0 will fix
        all this...

        2) SunOS 4.x no longer supports the AT&T version of the times()
        system call, so usleep() should be used to generate the delay.
	Edit config.h to #define HAVE_USLEEP.

Notes for some 4.2BSD and Ultrix 1.2 systems:

	Apparently, there is a bug in the /usr/include/curses.h file on
	some systems that does not define the nl() and nonl() macros
	correctly.  If this is the case with your system, edit
	/usr/include/curses.h to include the following:

	#undef nl
	#undef nonl
	#define nl()	(_tty.sg_flags |= CRMOD,_pfast = _rawmode,stty(_tty_ch, &_tty))
	#define nonl()	(_tty.sg_flags &= ~CRMOD, _pfast = TRUE, stty(_tty_ch, &_tty))

Notes for some 386 versions of Unix:

        It seems that a lot of the early versions of Unix for "DOS
        boxes" have bugs in their terminfo database for AT386 (the
        default terminal type).  Here is one that works:

AT386|at386|386AT|386at|at/386 console,
	am, eo, xon,
	colors#8, cols#80, lines#25, ncv#3, pairs#64,
	acsc=``a1fxgqh0jYk?lZm@nEooppqDrrsstCu4vAwBx3yyzz{{||}}~~,
        bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, clear=\E[2J\E[H,
        cr=\r, cub=\E[%p1%dD, cub1=\E[D, cud=\E[%p1%dB, cud1=\E[B,
        cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%02d;%p2%02dH,
        cuu=\E[%p1%dA, cuu1=\E[A, dch=\E[%p1%dP, dch1=\E[P, dim=\E[8;1m,
        dl=\E[%p1%dM, dl1=\E[1M, ech=\E[%p1%dX, ed=\E[J, el=\E[K,
        el1=\E[1K\E[X, flash=^G, home=\E[H, hpa=\E[%i%p1%dG,
        ich=\E[%p1%d@, ich1=\E[1@, il=\E[%p1%dL, il1=\E[1L, ind=\E[S,
        indn=\E[%p1%dS, invis=\E[8m, is2=\E[0;10, kbs=\b, kcbt=^],
        kclr=\E[2J, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A,
        kdch1=^?, kend=\E[Y, kf1=\EOP, kf10=\EOY, kf11=\EOZ, kf12=\EOA,
        kf2=\EOQ, kf3=\EOR, kf4=\EOS, kf5=\EOT, kf6=\EOU, kf7=\EOV,
        kf8=\EOW, kf9=\EOX, khome=\E[H, kich1=\E[@, knp=\E[U, kpp=\E[V,
        krmir=\E0, op=\E[0m, pfx=\EQ%p1%{1}%-%d'%p2%s', rev=\E[7;1m,
        ri=\E[T, rin=\E[%p1%dT, rmacs=\E[10m, rmso=\E[m, rs1=\E[0;10m,
        setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
        setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
        setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
        sgr=\E[10m\E[0%?%p1%p3%|%t;7%;%?%p2%t;4%;%?%p4%t;5%;%?%p6%t;1%;%?%p9%t;12%;%?%p7%t;9%;m,
        sgr0=\E[0;10m, smacs=\E[12m, smso=\E[7m,

Emmet P. Gray				US Army, HQ III Corps & Fort Hood
...!uunet!uiucuxc!fthood!egray		Attn: AFZF-DE-ENV
fthood!egray@uxc.cso.uiuc.edu		Directorate of Engineering & Housing
					Environmental Management Office
					Fort Hood, TX 76544-5057
