From: scowles@ckm.ucsf.edu
Newsgroups: comp.windows.open-look
Subject: cm2cal: reformat Calendar Manager events for pcal or calendar
Date: 10 Nov 92 04:09:19 GMT
Distribution: world


I built a utility that converts OW3 calendar manager entries to a
format that is appropriate for calendar(1) and pcal(1L) usage.  I've
called it cm2cal and included it in a shar file following this
description.

While the OpenLook 3.0 Calendar Manager is very nice for merging time
schedules among individuals, it can be difficult to work with when an
OpenLook or X window session is not available (i.e. a character based
tty).  This utility converts the information entered via Calendar
Manager to a form directly usable by calendar(1) or pcal(1L).

Repeating entries are a special case in calendar manager.  To handle
these, cm2cal utilizes the getdate(1L) package submitted to
alt.sources by Rich Salz in 1990.  I have modified getdate to accept
command line parameters so it can be used by cm2cal.  In addition, no
prompts are issued for input.  I will mail a shar file of the modified
version of getdate to interested parties.

If getdate(1L) is not found, repeating events will not appear in the
output generated by cm2cal.  It is still useful for translating the
single event entries from calendar manager, though.

CREDITS for getdate(1L):

Originally written by Steven M. Bellovin <smb@research.att.com> while
at the University of North Carolina at Chapel Hill.  Later tweaked by
a couple of people on Usenet.  Completely overhauled by Rich $alz
<rsalz@bbn.com> and Jim Berets <jberets@bbn.com> in August, 1990; send
any email to Rich.  Posted to alt.sources in 1990 by Rich Salz.
Modified by S. Cowles (scowles@ckm.ucsf.edu) for use with cm2cal.

CREDITS for pcal(1L):

The original calendar PostScript was Copyright (c) 1987 by Patrick
Wood and Pipeline Associates, Inc. with permission to modify and
redistribute.  Many others have worked on it since; see the
Orig.ReadMe file and topline comments in pcal.c.

The following people contributed to Pcal v4.2 and v4.3:

        Overall coordinator:                            Joe Brownlee
        "nearest" keyword:                              Andy Fyfe
        "note/n" suggestion:                            Geoff Kuenning
        VMS support, moon phase algorithm:              Richard Dyson
        "-c" suggestion, new SYNOPSIS for man page:     Bruce Mohler
        Other C and PostScript code:                    Andrew Rogers

EXAMPLE USAGES:

With calendar(1):
$ cat /usr/spool/calendar/callog.scowles | cm2cal > cm.cal
$ cp cm.cal $HOME/calendar
$ calendar

With pcal(1L):
$ cat /usr/spool/calendar/callog.scowles | cm2cal > cm.cal
$ MN=1 YR=1993
$ pcal -j -M -F sunday -c -f cm.cal $MN $YR > $HOME/calendar

To just check the output:
$ cm2cal -t

--------------------------------------------------------------------
sid cowles               voice: +1-415-476-1582
internet:                uucp:
scowles@ckm.ucsf.edu
scowles@llnl.gov         {backbone}!lll-winken!humpty!scowles

#!/bin/sh
# This is a shell archive (produced by shar 3.49)
# To extract the files from this archive, save it to a file, remove
# everything above the "!/bin/sh" line above, and type "sh file_name".
#
# made 11/10/1992 03:24 UTC by scowles@scheffer.lib.ucsf.edu
# Source directory /sea1/scowles/tmp
#
# existing files will NOT be overwritten unless -c is specified
#
#
#
#
# This shar contains:
# length  mode       name
# ------ ---------- ------------------------------------------
#   7708 -r-xr-xr-x cm2cal
#
if test -r _shar_seq_.tmp; then
	echo 'Must unpack archives in sequence!'
	echo Please unpack part `cat _shar_seq_.tmp` next
	exit 1
fi
# ============= cm2cal ==============
if test -f 'cm2cal' -a X"$1" != X"-c"; then
	echo 'x - skipping cm2cal (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting cm2cal (Compressed)'
sed 's/^X//' << 'SHAR_EOF' > _shar_tmp_.tmp &&
begin 600 _shar_cmp_.tmp
M'YV,(T*\$)/&S8LY:!2,`#&FC8PQ8=CH`,'PC1L[9>30`?'DR@R&$<NX(1-&
M#H@V8=R$.9,1A$@Z<M*4F0."SAL09M[(0;DQ#!PX<MX`31.&3AF%.'6"9".2
MI!P4,5*`2$D&!!R(;*`RD5IGSLHR+A0B%1)DR)(C4IY4<4)$!](K:-(PK8FF
M#$<X(IF\>;,&Q`P7,$`,"3FR)(@F*;^:3$,3HYP\(-RD&6,WI\DV&<\4/(.4
M3AK,(.:,J4NF#E.:8=I8/`/B3-`Z<.:P`)%F(T0W(,38)9/&C)G)IC?:!'%'
M9]\[M1,NO%,7=\J[>??V58J%>$$R;^Z$GCDGC47:--V\Z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D`,7S1\6=:L5T-Z'=I\7BY@9=+`9?7*PT
M/,9/S+PC1A!G7,5;!QKHV'USX,9<[,6[MF]AO*@UO+RN:Z[:N4E\?,7HJ)V"
M#,>$C$QT+,;6J,BQ:Z[NZ<AIW,=B.6+N.<EQ/,=,.L.4&Z>@/*%:/*S\*WEI
MD%=`:UE#^S6&^LHBP!Q?`P*?1@*IV`)L4,!5T04/'!GHZIU!6Q,)1K1,BLO8
M,<M"N\RVW,S42`?]ZP;BQ6=0YLL>C&4,#`;%/,ABD,RU7$;4W'K]&P;BI<#L
M#,#N#`(*C),D@!O_"\[#P\*W><-E,!L;W,$3+,(7O,(C#,)TU\$N+,*@3,[2
M;,ZWB<OY87)A`,W*;([3W-#5W+\MQP5_)CA6F0#<1L#PK#+=@L`4H<`T60,.
M+`+%#,/\%L("#;M=P,\:BLRTO-#&9M'H#,O9W&>D!*_VS'DU3=$,;:T7+7G8
M@2L27<XWS:TR.Z\*\(N=,2"A04(`PQ*X,H4]A9!#',Q%++Q96;STJ<3K-"55
6<B4]I<]0,AS8$1IO$!8(04HL-FO.!1*X
`
end
SHAR_EOF
echo 'uudecoding file cm2cal' &&
uudecode < _shar_tmp_.tmp && rm -f _shar_tmp_.tmp &&
echo 'uncompressing file cm2cal' &&
compress -d < _shar_cmp_.tmp > 'cm2cal' && rm -f _shar_cmp_.tmp &&
chmod 0555 cm2cal ||
echo 'restore of cm2cal failed'
Wc_c="`wc -c < 'cm2cal'`"
test 7708 -eq "$Wc_c" ||
	echo 'cm2cal: original size 7708, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
exit 0