Article View: comp.lang.postscript
Article #153Re: Pcal: postscript/c calendar printer (Casio BOSS Conversion)
From: Johnathan Vail
Date: Fri, 08 Jun 1990 15:43
Date: Fri, 08 Jun 1990 15:43
95 lines
2209 bytes
2209 bytes
Here is a small hack I made for use with the pcal program recently
posted. It will filter a file from the Casio BOSS (the little
calculator sized memory/phone-list/schedule gizmos) and produce lines
for schedule items for the pcal program.
Shar and Enjoy, jv
"Frisbeetarianism is the belief that when you die, your soul goes up on
the roof and gets stuck." -- button
_____
| | Johnathan Vail | n1dxg@tegra.com
|Tegra| (508) 663-7435 | N1DXG@448.625-(WorldNet)
----- jv@n1dxg.ampr.org {...sun!sunne ..uunet}!tegra!vail
--------------------------->8 cut here 8<----------------------------
/*
** boss2cal - Convert Casio BOSS file dates to calender files.
**
** Written 6 Jun 1990, Johnathan Vail, N1DXG vail@tegra.com
**
** This program will filter a file from a Casio BOSS into a file
** suitable for use with the pcal program to generate postscript
** calenders.
**
*/
#include <stdio.h>
void boss_convert_date(char *in_line, char *out_line)
{
char *start_time, *end_time, *date, *year;
char *lp, *event;
char time_buf[50];
for(lp=in_line; *lp; lp++)
if (*lp=='\t' || *lp=='\r')
*lp='\0';
if (strncmp(in_line,":0300",5)==0) {
in_line[9]='\0';
year=in_line+5;
date=in_line+10;
start_time=end_time=in_line+16;
while(*end_time++);
event=end_time;
while (*event++);
while (*event++); /* skip over alarm time */
for(lp=event; *lp; lp++)
if (*lp=='\\' && *(lp+1)=='0') {
*lp=' ';
*++lp=' ';
*++lp=' ';
}
sprintf(time_buf,"%s%s%s",
start_time,
(*end_time?" to ":""),
end_time);
sprintf(out_line,"%s-%s %s %s",
date,
year,
time_buf,
event);
}
else {
*out_line='\0';
}
}
main()
{
char in_line[380], out_line[380];
while(gets(in_line)) {
if (!*in_line) break;
boss_convert_date(in_line, out_line);
if (*out_line)
printf("%s\n",out_line);
}
exit(0);
}
Technical Details
Message-ID:
<1012@atlas.tegra.COM>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
From: vail@tegra.COM (Johnathan Vail) Newsgroups: comp.lang.postscript,alt.sources Subject: Re: Pcal: postscript/c calendar printer (Casio BOSS Conversion) Message-ID: <1012@atlas.tegra.COM> Date: 8 Jun 90 15:43:50 GMT