[comp.unix.questions] Clock.shar update number 1

sandy@turnkey.TCC.COM (Sanford 'Sandy' Zelkovitz) (08/02/88)

Below is an update file that was posted on my BBS by Warren Tucker as an update
to his already fantastic clock updating program via the NBS. The original file
was posted through the net as a "message" last week.
 
Sanford (Sandy) Zelkovitz
XBBS  714-898-8634

--------------------- CUT, SNIP, AXE HERE -------------------------------

#!/bin/sh
# to extract, remove the header and type "sh filename"
if `test ! -s ./Makefile`
then
echo "writing ./Makefile"
cat > ./Makefile << '\Rogue\Monster\'
#  CHK=0x6E4A
# Makefile for cmos time routines

.SUFFIXES: .o .c .h  

C_EXTRA = -i -s -M2
CFLAGS  = -c -O -K $(C_EXTRA)
LD_EXTRA = -lx
#.c.o:;	fcrc -u $*.c ; cc $(CFLAGS) $*.c 
#.c.o:;	cc $(CFLAGS) $*.c 

NBSSETCLK_OFILES = \
	NBSsetclk.o\
	dev_cmos.o

CMOSSTIME_OFILES = \
	CMOSstime.o\
	dev_cmos.o

CMOS_DISP_OFILES = \
	cmos_disp.o\
	dev_cmos.o

TAR_FILES = \
	README\
	*.c\
	*.h\
	NBSsetclk\
	CMOSstime\
	cmos_disp\
	tags\
	Makefile

all: NBSsetclk CMOSstime cmos_disp

NBSsetclk: $(NBSSETCLK_OFILES)
	cc $(C_EXTRA) $(NBSSETCLK_OFILES) $(LD_EXTRA) -o NBSsetclk

CMOSstime: $(CMOSSTIME_OFILES)
	cc $(C_EXTRA) $(CMOSSTIME_OFILES) $(LD_EXTRA) -o CMOSstime

cmos_disp: $(CMOS_DISP_OFILES)
	cc $(C_EXTRA) $(CMOS_DISP_OFILES) $(LD_EXTRA) -o cmos_disp

tar: cmostime.tar.Z

cmostime.tar: $(TAR_FILES)
	tar cf - $(TAR_FILES) > cmostime.tar
	tar tf - < cmostime.tar

cmostime.tar.Z: cmostime.tar
	compress16 -b 12 cmostime.tar
	
NBS_setclk.o: at_cmos.h dev_cmos.h

CMOSstime.o: dev_cmos.h

cmos_disp.o: at_cmos.h dev_cmos.h
\Rogue\Monster\
else
  echo "will not over write ./Makefile"
fi
if `test ! -s ./NBSsetclk.diff`
then
echo "writing ./NBSsetclk.diff"
cat > ./NBSsetclk.diff << '\Rogue\Monster\'
1c1
< /* CHK=0x0BFA */
---
> /* CHK=0x90AC */
35a36
>   4-space tabs
54a56,57
> /*:08-01-1988-19:03-wht-bug in hayes_send_cmd wakeup retry caused no retry */
> /*:08-01-1988-19:03-wht-Microcom barfed on 0x07 test in hayes_send_cmd */
172c175
< 	ff(se,"Usage: nbs_time [-][-e][-o][-n][-b#][-t#]\n");
---
> 	ff(se,"Usage: NBSsetclk [-][-e][-o][-n][-b#][-t#]\n");
801c804
< 		lputc(0x07);	/* something random */
---
> 		lputc('A');		/* most Hayes clones will set baud rate with 'A' */
804,805d806
< 			if(retry)
< 				return(-1);
809a811,812
> 			if(retry)
> 				return(-1);
\Rogue\Monster\
else
  echo "will not over write ./NBSsetclk.diff"
fi
if `test ! -s ./README.upd`
then
echo "writing ./README.upd"
cat > ./README.upd << '\Rogue\Monster\'
A couple of bugs in NBSsetclk (+ the Makefile that was omitted :< from
the last shipment):
1.  I meant to try twice to "wake up" a Hayes modem that had result
codes turned off; the code only tried once.
2.  Microcom modems do not echo characters other than 'A' or 'a' when
in baud rate detection state;  I was using 0x07 (BEL), which worked with
my Prometheus, Courier 2400 and Hayes 2400, but NOT with my Microcom
AX/9624c (more of an 'oops' than a 'bug' :);-).

One of these days, I'll learn to get it right before shipping work all
over the country -- WHT
-------------------------------------------------------------------------
Albert Einstein, when asked to describe radio, replied: "You see,
wire telegraph is a kind of a very, very long cat.  You pull his tail
in New York and his head is meowing in Los Angeles.  Do you understand
this?  And radio operates exactly the same way: you send signals here,
they receive them there.  The only difference is that there is no cat".
\Rogue\Monster\
else
  echo "will not over write ./README.upd"
fi
echo "Finished archive 1 of 1"
exit