mcgrew@dartagnan.rutgers.edu (Charles Mcgrew) (01/10/90)
Submitted-by: Bill Randle <billr@saab.cna.tek.com> Posting-number: Volume 2, Issue 5 Archive-name: calentool/patch5c #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of archive 3 (of 4)." # Contents: patches05c # Wrapped by billr@saab on Mon Dec 18 17:23:00 1989 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'patches05c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'patches05c'\" else echo shar: Extracting \"'patches05c'\" \(57477 characters\) sed "s/^X//" >'patches05c' <<'END_OF_FILE' X*** /tmp/,RCSt1a16911 Fri Dec 15 17:22:26 1989 X--- calentool.c Fri Dec 15 17:17:03 1989 X*************** X*** 1,5 X /* X! * $Header: calentool.c,v 2.2 89/07/19 20:25:41 billr Exp $ X */ X /* X * calentool.c X X--- 1,5 ----- X /* X! * $Header: calentool.c,v 2.3 89/12/15 17:16:58 billr Exp $ X */ X /* X * calentool.c X*************** X*** 33,39 X X extern Pixfont *font, *sfont; X extern char apts_pathname[], tmpapts_pathname[]; X! extern char todays_date[]; X extern char version[]; X extern Panel_item clock_pi; X extern Frame fframe; X X--- 33,39 ----- X X extern Pixfont *font, *sfont; X extern char apts_pathname[], tmpapts_pathname[]; X! extern char clockstr[]; X extern char version[]; X extern char *smonthnames[]; X extern Panel_item clock_pi; X*************** X*** 35,40 X extern char apts_pathname[], tmpapts_pathname[]; X extern char todays_date[]; X extern char version[]; X extern Panel_item clock_pi; X extern Frame fframe; X extern Panel panel; X X--- 35,41 ----- X extern char apts_pathname[], tmpapts_pathname[]; X extern char clockstr[]; X extern char version[]; X+ extern char *smonthnames[]; X extern Panel_item clock_pi; X extern Frame fframe; X extern Panel panel; X*************** X*** 38,43 X extern Panel_item clock_pi; X extern Frame fframe; X extern Panel panel; X #ifndef NO_SUN_MOON X extern Frame sframe; X #endif X X--- 39,45 ----- X extern Panel_item clock_pi; X extern Frame fframe; X extern Panel panel; X+ extern Rect *closed_rect; X #ifndef NO_SUN_MOON X extern Frame sframe; X #endif X*************** X*** 71,77 X int one_based = 0, new_entry = 0, version2 = 0; X int otherfile = 0; X char *othername; X! int beep = 0, show_time = 0; X int include_old = 0, save_old = 0; X #ifndef NO_HOLIDAYS X int holiday_a = 0, holiday_c = 0, holiday_i = 0; X X--- 73,79 ----- X int one_based = 0, new_entry = 0, version2 = 0; X int otherfile = 0; X char *othername; X! int beep = 0, show_time = 0, beep_open = 0; X int include_old = 0, save_old = 0; X #ifndef NO_HOLIDAYS X int holiday_a = 0, holiday_c = 0, holiday_i = 0; X*************** X*** 86,92 X Cursor wait_cursor; X char orig_apts_pathname[160]; X int orig_ro; X! char timestr[16], datestr_day[3], datestr_mon[4]; X struct pr_prpos where; X int working_msg; X X X--- 88,94 ----- X Cursor wait_cursor; X char orig_apts_pathname[160]; X int orig_ro; X! char timestr[16], datestr_day[3]; X struct pr_prpos where; X int working_msg; X int hour24, monday_first, day_first; X*************** X*** 89,94 X char timestr[16], datestr_day[3], datestr_mon[4]; X struct pr_prpos where; X int working_msg; X X static short icon_data[] = { X #include "std.icon" X X--- 91,98 ----- X char timestr[16], datestr_day[3]; X struct pr_prpos where; X int working_msg; X+ int hour24, monday_first, day_first; X+ int expire_days = 0; X X static short icon_data[] = { X #include "std.icon" X*************** X*** 146,152 X mpr_static(tri_right_pr, 16, 16, 1, tri_right_data); X X char *strcpy(), *strcat(), *rindex(); X! static Notify_value cleanup(), itimer_handler(); X Notify_value myframe_interposer(); X X main(argc,argv) X X--- 150,156 ----- X mpr_static(tri_right_pr, 16, 16, 1, tri_right_data); X X char *strcpy(), *strcat(), *rindex(); X! static Notify_value leave(), itimer_handler(); X Notify_value myframe_interposer(); X X main(argc,argv) X*************** X*** 164,169 X progname = *argv; X X nr_weekdays = NR_WEEKDAYS; X n_tslots = (N_TSLOTS > N_SLOTS ? N_SLOTS : N_TSLOTS); X X get_today(); /* initial day is today */ X X--- 168,175 ----- X progname = *argv; X X nr_weekdays = NR_WEEKDAYS; X+ monday_first = MON_FIRST; X+ hour24 = HOUR_24; X n_tslots = (N_TSLOTS > N_SLOTS ? N_SLOTS : N_TSLOTS); X X get_today(); /* initial day is today */ X*************** X*** 169,175 X get_today(); /* initial day is today */ X current = today; X read_only = 0; X! working_msg = 1; X X /* X * Check for -p, -P or -m option, which means we don't want X X--- 175,181 ----- X get_today(); /* initial day is today */ X current = today; X read_only = 0; X! working_msg = 0; X X /* X * Check for -p, -P, -m or -M option, which means we don't want X*************** X*** 172,178 X working_msg = 1; X X /* X! * Check for -p, -P or -m option, which means we don't want X * to create the tool. Also check for -Wp so we can supply X * a resonable default if the user doesn't supply one. X */ X X--- 178,184 ----- X working_msg = 0; X X /* X! * Check for -p, -P, -m or -M option, which means we don't want X * to create the tool. Also check for -Wp so we can supply X * a resonable default if the user doesn't supply one. X */ X*************** X*** 179,185 X i = argc; X while (--i > 0) { X if (!strncmp(argv[i], "-p", 2) || !strcmp(argv[i], "-m") X! || !strncmp(argv[i], "-P", 2)) { X /* standard getopt doesn't allow optional X * arguments, so we do a check here for X * obsolete usage of the -p option X X--- 185,191 ----- X i = argc; X while (--i > 0) { X if (!strncmp(argv[i], "-p", 2) || !strcmp(argv[i], "-m") X! || !strncmp(argv[i], "-P", 2) || !strcmp(argv[i], "-M")) { X /* standard getopt doesn't allow optional X * arguments, so we do a check here for X * obsolete usage of the -p option X*************** X*** 205,211 X 0); X } X X! while ((flag = getopt(argc, argv, "57bd:f:im:op:P:rtu:zH:h:w")) != EOF) X switch (flag) { X case 'f': /* use this file */ X otherfile = 1; X X--- 211,217 ----- X 0); X } X X! while ((flag = getopt(argc, argv, "1:2:567bBd:eEf:im:M:op:P:rtu:zH:h:wx:")) != EOF) X switch (flag) { X case 'f': /* use this file */ X otherfile = 1; X*************** X*** 220,225 X read_only = 1; X break; X X case 'p': /* print and exit */ X read_only = 1; X switch (*optarg) { X X--- 226,251 ----- X read_only = 1; X break; X X+ case '1': /* -12 -- 12 hour time */ X+ if (*optarg == '2') X+ hour24 = FALSE; X+ break; X+ X+ case '2': /* -24 -- 24 hour time */ X+ if (*optarg == '4') X+ hour24 = TRUE; X+ break; X+ X+ case 'e': /* European calendar Mon-Sun */ X+ monday_first = TRUE; X+ break; X+ X+ case 'E': /* European style */ X+ monday_first = TRUE; X+ hour24 = TRUE; X+ day_first = TRUE; X+ break; X+ X case 'p': /* print and exit */ X read_only = 1; X switch (*optarg) { X*************** X*** 268,273 X X case 'm': /* mail today's appts and exit */ X read_only = 1; X printit_dst = DST_MAIL; X mailto = optarg; X break; X X--- 294,301 ----- X X case 'm': /* mail today's appts and exit */ X read_only = 1; X+ if (!printit) X+ printit = PRI_DAY; X printit_dst = DST_MAIL; X mailto = optarg; X break; X*************** X*** 272,277 X mailto = optarg; X break; X X case 'b': /* beep to console for pending appt */ X beep = 1; X break; X X--- 300,314 ----- X mailto = optarg; X break; X X+ case 'M': /* mail today's appts and exit (ignore X+ some notes) */ X+ read_only = 1; X+ if (!printit) X+ printit = PRI_DAY_XNOTES; X+ printit_dst = DST_MAIL; X+ mailto = optarg; X+ break; X+ X case 'b': /* beep to console for pending appt */ X beep = 1; X break; X*************** X*** 276,281 X beep = 1; X break; X X case 'i': /* include old appt files */ X include_old = 1; X break; X X--- 313,322 ----- X beep = 1; X break; X X+ case 'B': /* beep then open wondow */ X+ beep_open = 1; X+ break; X+ X case 'i': /* include old appt files */ X include_old = 1; X break; X*************** X*** 280,286 X include_old = 1; X break; X X! case 'o': /* save outdate appts to another file */ X save_old = 1; X break; X X X--- 321,327 ----- X include_old = 1; X break; X X! case 'o': /* save outdated appts to another file */ X save_old = 1; X break; X X*************** X*** 292,298 X nr_weekdays = 5; X break; X X! case '7': /* Sun - Sat week display */ X nr_weekdays = 7; X break; X X X--- 333,343 ----- X nr_weekdays = 5; X break; X X! case '6': /* Mon - Sat week display */ X! nr_weekdays = 6; X! break; X! X! case '7': /* Sun - Sat (or Mon-Sun) week display */ X nr_weekdays = 7; X break; X X*************** X*** 300,307 X update_interval = atoi(optarg); X break; X X! case 'w': /* don't display Working! message */ X! working_msg = 0; X break; X X case 'z': /* zero offset -- new style appts file */ X X--- 345,352 ----- X update_interval = atoi(optarg); X break; X X! case 'w': /* display Working! message */ X! working_msg = 1; X break; X X case 'x': /* eXpire appts after so many days */ X*************** X*** 304,309 X working_msg = 0; X break; X X case 'z': /* zero offset -- new style appts file */ X one_based = 1; X break; X X--- 349,358 ----- X working_msg = 1; X break; X X+ case 'x': /* eXpire appts after so many days */ X+ expire_days = atoi(optarg); X+ break; X+ X case 'z': /* zero offset -- new style appts file */ X one_based = 1; X break; X*************** X*** 390,396 X fprintf(stderr, " -p <dwm> // print selected day [d], week [w] or month [m] appts and exit\n"); X fprintf(stderr, " -P <dwm> // like -p, only don't print marked notes\n"); X fprintf(stderr, " -m <user> // mail selected days appts to <user>\n"); X! fprintf(stderr, " [-5|-7] // 5-day or 7-day week display\n"); X fprintf(stderr, " -d <date> // display appts for <date>\n"); X fprintf(stderr, " -b // beep and display message when appt is pending\n"); X fprintf(stderr, " -i // auto-include outdated appts files\n"); X X--- 439,447 ----- X fprintf(stderr, " -p <dwm> // print selected day [d], week [w] or month [m] appts and exit\n"); X fprintf(stderr, " -P <dwm> // like -p, only don't print marked notes\n"); X fprintf(stderr, " -m <user> // mail selected days appts to <user>\n"); X! fprintf(stderr, " -M <user> // like -m, only don't mail marked notes\n"); X! fprintf(stderr, " [-5|-6|-7] // 5, 6 or 7-day week display\n"); X! fprintf(stderr, " [-12|-24] // 12 or 24 hour time format\n"); X fprintf(stderr, " -d <date> // display appts for <date>\n"); X fprintf(stderr, " -b // beep and display message when appt is pending\n"); X fprintf(stderr, " -B // beep and open window when appt is pending\n"); X*************** X*** 393,398 X fprintf(stderr, " [-5|-7] // 5-day or 7-day week display\n"); X fprintf(stderr, " -d <date> // display appts for <date>\n"); X fprintf(stderr, " -b // beep and display message when appt is pending\n"); X fprintf(stderr, " -i // auto-include outdated appts files\n"); X fprintf(stderr, " -o // create outdated include files\n"); X fprintf(stderr, " -t // display time below icon\n"); X X--- 444,450 ----- X fprintf(stderr, " [-12|-24] // 12 or 24 hour time format\n"); X fprintf(stderr, " -d <date> // display appts for <date>\n"); X fprintf(stderr, " -b // beep and display message when appt is pending\n"); X+ fprintf(stderr, " -B // beep and open window when appt is pending\n"); X fprintf(stderr, " -i // auto-include outdated appts files\n"); X fprintf(stderr, " -o // create outdated include files\n"); X fprintf(stderr, " -t // display time below icon\n"); X*************** X*** 397,403 X fprintf(stderr, " -o // create outdated include files\n"); X fprintf(stderr, " -t // display time below icon\n"); X fprintf(stderr, " -u <interval> // time update interval (seconds)\n"); X! fprintf(stderr, " -w // don't display 'Working!' message\n"); X #ifndef NO_HOLIDAYS X fprintf(stderr, " -h <Aacijs> // display selected computed holidays\n"); X fprintf(stderr, " // A=All, a=astronomical, c=Christian,\n"); X X--- 449,457 ----- X fprintf(stderr, " -o // create outdated include files\n"); X fprintf(stderr, " -t // display time below icon\n"); X fprintf(stderr, " -u <interval> // time update interval (seconds)\n"); X! fprintf(stderr, " -w // display 'Working!' message\n"); X! fprintf(stderr, " -e // Mon-Sun week display\n"); X! fprintf(stderr, " -E // European options (-e, -24)\n"); X #ifndef NO_HOLIDAYS X fprintf(stderr, " -h <Aacijs> // display selected computed holidays\n"); X fprintf(stderr, " // A=All, a=astronomical, c=Christian,\n"); X*************** X*** 404,409 X fprintf(stderr, " // i=Islamic, j=Jewish, s=secular\n"); X fprintf(stderr, " -H <Aacijs> // like -h, only flag them as marked\n"); X #endif X fprintf(stderr, " -z // conversion flag (see INSTALL)\n"); X fprintf(stderr, " <window_opts> // Suntools -W options\n"); X exit(1); X X--- 458,464 ----- X fprintf(stderr, " // i=Islamic, j=Jewish, s=secular\n"); X fprintf(stderr, " -H <Aacijs> // like -h, only flag them as marked\n"); X #endif X+ fprintf(stderr, " -x <days> // expire appts after <days> days\n"); X fprintf(stderr, " -z // conversion flag (see INSTALL)\n"); X fprintf(stderr, " <window_opts> // Suntools -W options\n"); X exit(1); X*************** X*** 410,416 X break; X } X X! X if (toolrunning) { X (void) notify_set_signal_func(frame, cleanup, SIGHUP, NOTIFY_ASYNC); X (void) notify_set_signal_func(frame, cleanup, SIGINT, NOTIFY_ASYNC); X X--- 465,474 ----- X break; X } X X! if (printit_dst == DST_MAIL && (printit == PRI_MONTH || printit == PRI_MONTH_XNOTES)) { X! fprintf(stderr, "calentool: can't mail month calendar\n"); X! exit(1); X! } X if (toolrunning) { X (void) notify_set_signal_func(frame, leave, SIGHUP, NOTIFY_ASYNC); X (void) notify_set_signal_func(frame, leave, SIGINT, NOTIFY_ASYNC); X*************** X*** 412,420 X X X if (toolrunning) { X! (void) notify_set_signal_func(frame, cleanup, SIGHUP, NOTIFY_ASYNC); X! (void) notify_set_signal_func(frame, cleanup, SIGINT, NOTIFY_ASYNC); X! (void) notify_set_signal_func(frame, cleanup, SIGTERM, NOTIFY_ASYNC); X } X X /* X X--- 470,478 ----- X exit(1); X } X if (toolrunning) { X! (void) notify_set_signal_func(frame, leave, SIGHUP, NOTIFY_ASYNC); X! (void) notify_set_signal_func(frame, leave, SIGINT, NOTIFY_ASYNC); X! (void) notify_set_signal_func(frame, leave, SIGTERM, NOTIFY_ASYNC); X } X X /* X*************** X*** 429,434 X X if (printit) { X print_apts(printit, printit_dst); X exit(0); X } X X X--- 487,494 ----- X X if (printit) { X print_apts(printit, printit_dst); X+ if (save_old || expire_days) X+ expire(expire_days); X exit(0); X } X X*************** X*** 478,487 X icon = icon_create(0); X rev_icon = icon_create(0); X na_icon = icon_create(0); X! strncpy(datestr_mon, todays_date+4, 3); X! datestr_mon[3] = '\0'; X! strncpy(datestr_day, todays_date+8, 2); X! datestr_day[2] = '\0'; X /* the basic standard icon */ X pr_rop(ic_pr, 0, 0, 64, 64, PIX_SRC, &ic_mpr, 0, 0); X if (show_time) { X X--- 538,544 ----- X icon = icon_create(0); X rev_icon = icon_create(0); X na_icon = icon_create(0); X! sprintf(datestr_day, "%2d", today.tm_mday); X /* the basic standard icon */ X pr_rop(ic_pr, 0, 0, 64, 64, PIX_SRC, &ic_mpr, 0, 0); X if (show_time) { X*************** X*** 486,495 X pr_rop(ic_pr, 0, 0, 64, 64, PIX_SRC, &ic_mpr, 0, 0); X if (show_time) { X /* time string displayed below icon */ X! strcpy(timestr, todays_date+10); X! if (update_interval == 60) { X! /* display hh:mm */ X! timestr[6] = '\0'; X ilabel_rect.r_left += 2*sfont->pf_defaultsize.x - 2; X ilabel_rect.r_width -= 2*sfont->pf_defaultsize.x; X } else X X--- 543,551 ----- X pr_rop(ic_pr, 0, 0, 64, 64, PIX_SRC, &ic_mpr, 0, 0); X if (show_time) { X /* time string displayed below icon */ X! format_icon_time(); X! if (update_interval >= 60) { X! /* no seconds displayed, adjust label position */ X ilabel_rect.r_left += 2*sfont->pf_defaultsize.x - 2; X ilabel_rect.r_width -= 2*sfont->pf_defaultsize.x; X } X*************** X*** 492,500 X timestr[6] = '\0'; X ilabel_rect.r_left += 2*sfont->pf_defaultsize.x - 2; X ilabel_rect.r_width -= 2*sfont->pf_defaultsize.x; X! } else X! /* display hh:mm:ss */ X! timestr[9] = '\0'; X /* draw a box around the time appendage */ X pr_vector(ic_pr, 0, 64, 63, 64, PIX_SET, 1); X pr_vector(ic_pr, 63, 64, 63, 76, PIX_SET, 1); X X--- 548,559 ----- X /* no seconds displayed, adjust label position */ X ilabel_rect.r_left += 2*sfont->pf_defaultsize.x - 2; X ilabel_rect.r_width -= 2*sfont->pf_defaultsize.x; X! } X! if (!hour24) { X! /* am/pm, increase size of label rect */ X! ilabel_rect.r_left -= sfont->pf_defaultsize.x; X! ilabel_rect.r_width += sfont->pf_defaultsize.x; X! } X /* draw a box around the time appendage */ X pr_vector(ic_pr, 0, 64, 63, 64, PIX_SET, 1); X pr_vector(ic_pr, 63, 64, 63, 76, PIX_SET, 1); X*************** X*** 520,526 X pf_ttext(where, PIX_SRC, sfont, datestr_day); X where.pos.x = 39; X where.pr = ic_pr; X! pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon); X where.pr = na_ic_pr; X pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon); X where.pr = rev_ic_pr; X X--- 579,585 ----- X pf_ttext(where, PIX_SRC, sfont, datestr_day); X where.pos.x = 39; X where.pr = ic_pr; X! pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]); X where.pr = na_ic_pr; X pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]); X where.pr = rev_ic_pr; X*************** X*** 522,528 X where.pr = ic_pr; X pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon); X where.pr = na_ic_pr; X! pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon); X where.pr = rev_ic_pr; X pf_ttext(where, PIX_SRC, sfont, datestr_mon); X (void)icon_init_from_pr(icon, ic_pr); X X--- 581,587 ----- X where.pr = ic_pr; X pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]); X where.pr = na_ic_pr; X! pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]); X where.pr = rev_ic_pr; X pf_ttext(where, PIX_SRC, sfont, smonthnames[today.tm_mon]); X (void)icon_init_from_pr(icon, ic_pr); X*************** X*** 524,530 X where.pr = na_ic_pr; X pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon); X where.pr = rev_ic_pr; X! pf_ttext(where, PIX_SRC, sfont, datestr_mon); X (void)icon_init_from_pr(icon, ic_pr); X (void)icon_init_from_pr(rev_icon, rev_ic_pr); X (void)icon_init_from_pr(na_icon, na_ic_pr); X X--- 583,589 ----- X where.pr = na_ic_pr; X pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]); X where.pr = rev_ic_pr; X! pf_ttext(where, PIX_SRC, sfont, smonthnames[today.tm_mon]); X (void)icon_init_from_pr(icon, ic_pr); X (void)icon_init_from_pr(rev_icon, rev_ic_pr); X (void)icon_init_from_pr(na_icon, na_ic_pr); X*************** X*** 569,574 X FRAME_ICON, icon, X 0); X X create_panel(); X create_main_window(); X create_attr_frame(); /* normally hidden */ X X--- 628,634 ----- X FRAME_ICON, icon, X 0); X X+ closed_rect = (Rect *)window_get(frame, FRAME_CLOSED_RECT); X create_panel(); X create_main_window(); X create_attr_frame(); /* normally hidden */ X*************** X*** 594,600 X X window_main_loop(frame); X X! cleanup(); X } X X X X--- 654,660 ----- X X window_main_loop(frame); X X! leave(); X } X X X*************** X*** 613,631 X (void) notify_set_itimer_func(frame, itimer_handler, ITIMER_REAL, &cal_timer, NULL); X get_today(); X /* update date/time displayed in the panel */ X! panel_set(clock_pi, PANEL_LABEL_STRING, todays_date, 0); X! if (show_time && (int)window_get(frame, FRAME_CLOSED)) { X! strcpy(timestr, todays_date+10); X! if (update_interval == 60) X! /* display hh:mm */ X! timestr[6] = '\0'; X! else X! /* display hh:mm:ss */ X! timestr[9] = '\0'; X! cur_icon = (Icon) window_get(frame, FRAME_ICON); X! icon_set(cur_icon, ICON_LABEL, timestr, 0); X! window_set(frame, FRAME_ICON, cur_icon, 0); X! } X #ifndef NO_SUN_MOON X /* update data in Sun Data frame (if it's open) */ X if (sframe) X X--- 673,681 ----- X (void) notify_set_itimer_func(frame, itimer_handler, ITIMER_REAL, &cal_timer, NULL); X get_today(); X /* update date/time displayed in the panel */ X! panel_set(clock_pi, PANEL_LABEL_STRING, clockstr, 0); X! if (show_time && (int)window_get(frame, FRAME_CLOSED)) X! update_icon_time(); X #ifndef NO_SUN_MOON X /* update data in Sun Data frame (if it's open) */ X if (sframe) X*************** X*** 739,745 X } X } else { X /* notify the user via the console (once) ... */ X! if (beep && sno != echoed_sno) { X echoed_sno = sno; X window_bell(frame); X if ((console = fopen("/dev/console", "w")) != NULL) { X X--- 789,795 ----- X } X } else { X /* notify the user via the console (once) ... */ X! if ((beep || beep_open) && sno != echoed_sno) { X echoed_sno = sno; X window_bell(frame); X if (beep_open) X*************** X*** 742,751 X if (beep && sno != echoed_sno) { X echoed_sno = sno; X window_bell(frame); X! if ((console = fopen("/dev/console", "w")) != NULL) { X! fprintf(console, "%s\n", slots[sno].cur_appt->str); X! fclose(console); X! } X /* X * also put a copy in ~/.msgfile, in case X * nlock(1) is running X X--- 792,804 ----- X if ((beep || beep_open) && sno != echoed_sno) { X echoed_sno = sno; X window_bell(frame); X! if (beep_open) X! window_set(frame, FRAME_CLOSED, FALSE, 0); X! if (beep) X! if ((console = fopen("/dev/console", "w")) != NULL) { X! fprintf(console, "<< %s >> %s\n", progname, slots[sno].cur_appt->str); X! fclose(console); X! } X /* X * also put a copy in ~/.msgfile, in case X * nlock(1) is running X*************** X*** 771,778 X /* so that it opens on today */ X olddate = current = today; X /* update date field of the icons */ X! strncpy(datestr_mon, todays_date+4, 3); X! strncpy(datestr_day, todays_date+8, 2); X /* replace the date */ X where.pr = ic_pr; X where.pos.x = 13; X X--- 824,830 ----- X /* so that it opens on today */ X olddate = current = today; X /* update date field of the icons */ X! sprintf(datestr_day, "%d", today.tm_mday); X /* replace the date */ X where.pr = ic_pr; X where.pos.x = 13; X*************** X*** 790,796 X pf_ttext(where, PIX_SRC, sfont, datestr_day); X where.pos.x = 39; X where.pr = ic_pr; X! pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon); X where.pr = na_ic_pr; X pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon); X where.pr = rev_ic_pr; X X--- 842,848 ----- X pf_ttext(where, PIX_SRC, sfont, datestr_day); X where.pos.x = 39; X where.pr = ic_pr; X! pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]); X where.pr = na_ic_pr; X pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]); X where.pr = rev_ic_pr; X*************** X*** 792,798 X where.pr = ic_pr; X pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon); X where.pr = na_ic_pr; X! pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon); X where.pr = rev_ic_pr; X pf_ttext(where, PIX_SRC, sfont, datestr_mon); X icon_set(icon, ICON_IMAGE, ic_pr, 0); X X--- 844,850 ----- X where.pr = ic_pr; X pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]); X where.pr = na_ic_pr; X! pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]); X where.pr = rev_ic_pr; X pf_ttext(where, PIX_SRC, sfont, smonthnames[today.tm_mon]); X icon_set(icon, ICON_IMAGE, ic_pr, 0); X*************** X*** 794,800 X where.pr = na_ic_pr; X pf_ttext(where, PIX_NOT(PIX_SRC), sfont, datestr_mon); X where.pr = rev_ic_pr; X! pf_ttext(where, PIX_SRC, sfont, datestr_mon); X icon_set(icon, ICON_IMAGE, ic_pr, 0); X icon_set(rev_icon, ICON_IMAGE, rev_ic_pr, 0); X icon_set(na_icon, ICON_IMAGE, na_ic_pr, 0); X X--- 846,852 ----- X where.pr = na_ic_pr; X pf_ttext(where, PIX_NOT(PIX_SRC), sfont, smonthnames[today.tm_mon]); X where.pr = rev_ic_pr; X! pf_ttext(where, PIX_SRC, sfont, smonthnames[today.tm_mon]); X icon_set(icon, ICON_IMAGE, ic_pr, 0); X icon_set(rev_icon, ICON_IMAGE, rev_ic_pr, 0); X icon_set(na_icon, ICON_IMAGE, na_ic_pr, 0); X*************** X*** 824,830 X } X X static Notify_value X! cleanup(me, signal, when) X Notify_client me; X int signal; X Notify_signal_mode when; X X--- 876,882 ----- X } X X static Notify_value X! leave(me, signal, when) X Notify_client me; X int signal; X Notify_signal_mode when; X*************** X*** 831,836 X { X if (day_is_open) X close_day(); X if (access(tmpapts_pathname, R_OK) == 0 && unlink(tmpapts_pathname) < 0) X perror(tmpapts_pathname); X exit(0); X X--- 883,894 ----- X { X if (day_is_open) X close_day(); X+ X+ /* create outdated include files (if necessary) */ X+ if (save_old || expire_days) X+ expire(expire_days); X+ X+ /* delete tmp file */ X if (access(tmpapts_pathname, R_OK) == 0 && unlink(tmpapts_pathname) < 0) X perror(tmpapts_pathname); X exit(0); X*** /tmp/,RCSt1a16942 Fri Dec 15 17:23:02 1989 X--- holidays.c Fri Dec 15 17:17:37 1989 X*************** X*** 1,5 X /* X! * $Header: holidays.c,v 2.1 89/05/09 14:19:10 billr Exp $ X */ X /* X * holidays.c X X--- 1,5 ----- X /* X! * $Header: holidays.c,v 2.2 89/12/15 17:17:34 billr Exp $ X */ X /* X * holidays.c X*************** X*** 81,86 X X extern struct tm current; /* current day displayed from calentool */ X int marked_note; X X int X a_dates(appt, flag) X X--- 81,87 ----- X X extern struct tm current; /* current day displayed from calentool */ X int marked_note; X+ int save_year = -1; X X int X a_dates(appt, flag) X*************** X*** 277,282 X double day, hday; X char *julian_time(); X X hday = (*func)(current.tm_year+1900); X gregorian_date(&day, &month, &year, hday); X if (current.tm_mon == --month && current.tm_mday == (int)day) { X X--- 278,287 ----- X double day, hday; X char *julian_time(); X X+ if (current.tm_year != save_year) { X+ datelib_init(current.tm_year+1900); X+ save_year = current.tm_year; X+ } X hday = (*func)(current.tm_year+1900); X gregorian_date(&day, &month, &year, hday); X if (current.tm_mon == --month && current.tm_mday == (int)day) { X*************** X*** 284,289 X aptr->month = current.tm_mon; X aptr->day = current.tm_mday; X aptr->arrows = aptr->repeat = aptr->lookahead = 0; X aptr->flags = (A_NOTE | READONLY); X if (marked_note) X aptr->flags |= MARKED; X X--- 289,295 ----- X aptr->month = current.tm_mon; X aptr->day = current.tm_mday; X aptr->arrows = aptr->repeat = aptr->lookahead = 0; X+ aptr->runlength = 0; X aptr->flags = (A_NOTE | READONLY); X if (marked_note) X aptr->flags |= MARKED; X*************** X*** 311,316 X int month, year; X int match = 0; X X (void)(*func)(current.tm_year+1900, &nr_dates, &date1, &date2, &year1, &year2); X gregorian_date(&day, &month, &year, date1); X if (current.tm_mon == --month && current.tm_mday == (int)day) X X--- 317,326 ----- X int month, year; X int match = 0; X X+ if (current.tm_year != save_year) { X+ datelib_init(current.tm_year+1900); X+ save_year = current.tm_year; X+ } X (void)(*func)(current.tm_year+1900, &nr_dates, &date1, &date2, &year1, &year2); X gregorian_date(&day, &month, &year, date1); X if (current.tm_mon == --month && current.tm_mday == (int)day) X*************** X*** 325,330 X aptr->month = current.tm_mon; X aptr->day = current.tm_mday; X aptr->arrows = aptr->repeat = aptr->lookahead = 0; X aptr->flags = (A_NOTE | READONLY); X if (marked_note) X aptr->flags |= MARKED; X X--- 335,341 ----- X aptr->month = current.tm_mon; X aptr->day = current.tm_mday; X aptr->arrows = aptr->repeat = aptr->lookahead = 0; X+ aptr->runlength = 0; X aptr->flags = (A_NOTE | READONLY); X if (marked_note) X aptr->flags |= MARKED; X*************** X*** 352,357 X double hday, day; X char buf[32]; X X hday = (*func)(current.tm_year+1900, &jyear); X gregorian_date(&day, &month, &year, hday); X if (current.tm_mon == --month && current.tm_mday == (int)day) { X X--- 363,372 ----- X double hday, day; X char buf[32]; X X+ if (current.tm_year != save_year) { X+ datelib_init(current.tm_year+1900); X+ save_year = current.tm_year; X+ } X hday = (*func)(current.tm_year+1900, &jyear); X gregorian_date(&day, &month, &year, hday); X if (current.tm_mon == --month && current.tm_mday == (int)day) { X*************** X*** 360,365 X aptr->month = current.tm_mon; X aptr->day = current.tm_mday; X aptr->arrows = aptr->repeat = aptr->lookahead = 0; X aptr->flags = (A_NOTE | READONLY); X if (marked_note) X aptr->flags |= MARKED; X X--- 375,381 ----- X aptr->month = current.tm_mon; X aptr->day = current.tm_mday; X aptr->arrows = aptr->repeat = aptr->lookahead = 0; X+ aptr->runlength = 0; X aptr->flags = (A_NOTE | READONLY); X if (marked_note) X aptr->flags |= MARKED; X*** /tmp/,RCSt1a16948 Fri Dec 15 17:23:08 1989 X--- init.c Fri Dec 15 17:17:43 1989 X*************** X*** 1,5 X /* X! * $Header: init.c,v 2.2 89/07/19 20:27:59 billr Exp $ X */ X /* X * init.c X X--- 1,5 ----- X /* X! * $Header: init.c,v 2.3 89/12/15 17:17:39 billr Exp $ X */ X /* X * init.c X*************** X*** 424,431 X return(1); X } X } X! if (access(apts_pathname, W_OK) == -1) X! read_only = 1; X /* X * set permissions on tmp file based on .appointments file X * with the expception that we need at least write permission X X--- 424,432 ----- X return(1); X } X } X! if (!read_only) X! if (access(apts_pathname, W_OK) == -1) X! read_only = 1; X /* X * set permissions on tmp file based on .appointments file X * with the expception that we need at least write permission X*** /tmp/,RCSt1a16953 Fri Dec 15 17:23:13 1989 X--- mpaint.c Fri Dec 15 17:17:47 1989 X*************** X*** 1,5 X /* X! * $Header: mpaint.c,v 2.2 89/07/19 20:29:01 billr Exp $ X */ X /* X * mpaint.c X X--- 1,5 ----- X /* X! * $Header: mpaint.c,v 2.3 89/12/15 17:17:44 billr Exp $ X */ X /* X * mpaint.c X*************** X*** 52,57 X int read_stat; X struct tm Save; X struct appt_entry appt; X X lock_cursors(); X /* destory future appts popup, if it exists */ X X--- 52,58 ----- X int read_stat; X struct tm Save; X struct appt_entry appt; X+ int runl; X X lock_cursors(); X /* destory future appts popup, if it exists */ X*************** X*** 91,97 X fix_current_day(); X Last = current; X working(FALSE); X! while ((read_stat = get_aentry(apts, &appt)) != EOF) { X if (read_stat) X continue; /* read error (ignore) */ X if (appt.flags & A_COMMENT) X X--- 92,98 ----- X fix_current_day(); X Last = current; X working(FALSE); X! while ((read_stat = get_aentry(apts, &appt, FALSE)) != EOF) { X if (read_stat) X continue; /* read error (ignore) */ X if (appt.flags & A_COMMENT) X*************** X*** 125,133 X } else if ((appt.flags & REPEAT) && !(appt.flags & ALL_DAYS)) { X if (appt.flags & EVERY_SOMEDAY) X continue; X! while (ymd_compare(current, First) < 0) { X! current.tm_mday += appt.repeat; X! fix_current_day(); X } X while (ymd_compare(current, Last) <= 0) { X busy_today[current.tm_mday-1]++; X X--- 126,142 ----- X } else if ((appt.flags & REPEAT) && !(appt.flags & ALL_DAYS)) { X if (appt.flags & EVERY_SOMEDAY) X continue; X! if (appt.flags & RUN) X! runl = appt.runlength; X! else X! runl = 1; X! while (ymd_compare(current, First) < 0 && runl) { X! if (appt.flags & RUN) X! --runl; X! if (runl) { X! current.tm_mday += appt.repeat; X! fix_current_day(); X! } X } X while (ymd_compare(current, Last) <= 0 && runl) { X if (runl) { X*************** X*** 129,138 X current.tm_mday += appt.repeat; X fix_current_day(); X } X! while (ymd_compare(current, Last) <= 0) { X! busy_today[current.tm_mday-1]++; X! current.tm_mday += appt.repeat; X! fix_current_day(); X } X } else if (current.tm_year == First.tm_year X && current.tm_mon == First.tm_mon) { X X--- 138,151 ----- X fix_current_day(); X } X } X! while (ymd_compare(current, Last) <= 0 && runl) { X! if (runl) { X! busy_today[current.tm_mday-1]++; X! current.tm_mday += appt.repeat; X! fix_current_day(); X! if (appt.flags & RUN) X! --runl; X! } X } X } else if (current.tm_year == First.tm_year X && current.tm_mon == First.tm_mon) { X*************** X*** 177,184 X #endif X X y = top_border; /* Draw all day boxes. */ X! x = 64*start_dow + left_border; X! days_in_week = start_dow; X c[0] = ' '; X c[1] = '1'; X c[2] = ' '; X X--- 190,207 ----- X #endif X X y = top_border; /* Draw all day boxes. */ X! if (monday_first) { X! if (start_dow == SUN) { X! x = 64*6 + left_border; X! days_in_week = 6; X! } else { X! x = 64*(start_dow - 1) + left_border; X! days_in_week = start_dow -1 ; X! } X! } else { X! x = 64*start_dow + left_border; X! days_in_week = start_dow; X! } X c[0] = ' '; X c[1] = '1'; X c[2] = ' '; X*************** X*** 218,226 X } X x = left_border + 27; X y = top_border - 16; X! for (i=0; i<7; i++) { /* Sun Mon ... Sat */ X! pw_char(main_pixwin,x,y,PIX_SRC,bigfont,daynames[i][0]); X! x += 64; X } X X bottom_border = boxlims[n_days-1].highy; X X--- 241,257 ----- X } X x = left_border + 27; X y = top_border - 16; X! if (monday_first) { X! for (i=1; i<7; i++) { /* Mon ... Sat Sun */ X! pw_char(main_pixwin,x,y,PIX_SRC,bigfont,daynames[i][0]); X! x += 64; X! } X! pw_char(main_pixwin,x,y,PIX_SRC,bigfont,daynames[0][0]); X! } else { X! for (i=0; i<7; i++) { /* Sun Mon ... Sat */ X! pw_char(main_pixwin,x,y,PIX_SRC,bigfont,daynames[i][0]); X! x += 64; X! } X } X X bottom_border = boxlims[n_days-1].highy; X*** /tmp/,RCSt1a16958 Fri Dec 15 17:23:18 1989 X--- notify.c Fri Dec 15 17:17:55 1989 X*************** X*** 1,5 X /* X! * $Header: notify.c,v 2.1 89/05/09 14:23:13 billr Exp $ X */ X /* X * notify.c X X--- 1,5 ----- X /* X! * $Header: notify.c,v 2.2 89/12/15 17:17:49 billr Exp $ X */ X /* X * notify.c X*************** X*** 53,58 X extern Panel_item repeat_pi, remind_pi, daysel_pi; X extern Panel_item everyx_pi, whichwk_pi, marked_pi; X extern Panel_item del_choice_pi, setdate_pi; X #ifndef NO_SUN_MOON X extern Frame mframe, sframe; X extern Panel_item moonbutton_pi, sunbutton_pi; X X--- 53,59 ----- X extern Panel_item repeat_pi, remind_pi, daysel_pi; X extern Panel_item everyx_pi, whichwk_pi, marked_pi; X extern Panel_item del_choice_pi, setdate_pi; X+ extern Panel_item runl_pi; X #ifndef NO_SUN_MOON X extern Frame mframe, sframe; X extern Panel_item moonbutton_pi, sunbutton_pi; X*************** X*** 77,83 X extern int show_future; X extern int show_time; X extern int update_interval; X- extern char todays_date[], timestr[]; X extern struct appt_entry shelf_appt; X X int i; X X--- 78,83 ----- X extern int show_future; X extern int show_time; X extern int update_interval; X extern struct appt_entry shelf_appt; X extern int day_first; X X*************** X*** 79,84 X extern int update_interval; X extern char todays_date[], timestr[]; X extern struct appt_entry shelf_appt; X X int i; X X X--- 79,85 ----- X extern int show_time; X extern int update_interval; X extern struct appt_entry shelf_appt; X+ extern int day_first; X X int i; X X*************** X*** 419,425 X break; X X case 5: /* change date */ X! sprintf(date, "%d/%d/%02d", Save.tm_mon+1, Save.tm_mday, Save.tm_year); X panel_set_value(setdate_pi, date); X do { X window_loop(date_frame); X X--- 420,429 ----- X break; X X case 5: /* change date */ X! if (day_first) X! sprintf(date, "%d/%d/%02d", Save.tm_mday, Save.tm_mon+1, Save.tm_year); X! else X! sprintf(date, "%d/%d/%02d", Save.tm_mon+1, Save.tm_mday, Save.tm_year); X panel_set_value(setdate_pi, date); X do { X window_loop(date_frame); X*************** X*** 1018,1023 X new_entry = 1; X flag |= LOOKAHEAD; X apt->lookahead = value; X } X } X X X--- 1022,1037 ----- X new_entry = 1; X flag |= LOOKAHEAD; X apt->lookahead = value; X+ } X+ } X+ X+ /* get runlength value */ X+ value = atoi((char *)panel_get_value(runl_pi)); X+ if (value > 0) { X+ if (apt->runlength != value) { X+ new_entry = 1; X+ flag |= RUN; X+ apt->runlength = value; X } X } X X*** /tmp/,RCSt1a16963 Fri Dec 15 17:23:25 1989 X--- paint.h Fri Dec 15 17:17:59 1989 X*************** X*** 1,5 X /* X! * $Header: paint.h,v 2.1 89/05/09 14:25:24 billr Exp $ X */ X /* X * paint.h X X--- 1,5 ----- X /* X! * $Header: paint.h,v 2.2 89/12/15 17:17:57 billr Exp $ X */ X /* X * paint.h X*************** X*** 22,27 X * notice remains intact. X */ X X #include <suntool/panel.h> X X extern Pixfont *font, *bigfont; X X--- 22,28 ----- X * notice remains intact. X */ X X+ #ifndef NOTOOL X #include <suntool/panel.h> X X extern Pixfont *font, *bigfont; X*************** X*** 27,34 X extern Pixfont *font, *bigfont; X extern Canvas canvas; X extern Pixwin *main_pixwin; X- extern struct tm current, today, First, Last; X- extern struct dayslot slots[]; X extern Pixrect *timeslot_pr, *daybox_pr, *weekarrow_pr, *weekslot_pr; X extern Pixrect *weekarrowshaft_pr, *weekarrowhead_pr; X extern Pixrect *triangle_pr; X X--- 28,33 ----- X extern Pixfont *font, *bigfont; X extern Canvas canvas; X extern Pixwin *main_pixwin; X extern Pixrect *timeslot_pr, *daybox_pr, *weekarrow_pr, *weekslot_pr; X extern Pixrect *weekarrowshaft_pr, *weekarrowhead_pr; X extern Pixrect *triangle_pr; X*************** X*** 38,44 X extern struct weekrect week_boxes[]; X extern int x_coord, y_coord, startx, starty; X extern int mainsw_state; X- extern int dayslot_width, nr_weekdays, max_strlen, n_tslots; X extern int dayslot_height, weekslot_height, weekslot_width; X extern int ybox_height, ybox_width; X extern struct rect_limits boxlims[]; X X--- 37,42 ----- X extern struct weekrect week_boxes[]; X extern int x_coord, y_coord, startx, starty; X extern int mainsw_state; X extern int dayslot_height, weekslot_height, weekslot_width; X extern int ybox_height, ybox_width; X extern struct rect_limits boxlims[]; X*************** X*** 44,49 X extern struct rect_limits boxlims[]; X extern struct rect_limits mboxlims[]; X extern struct week_arrow week_arrows[]; X extern char apts_pathname[], tmpapts_pathname[]; X extern int read_only, day_is_open, version2; X extern char *progname; X X--- 42,50 ----- X extern struct rect_limits boxlims[]; X extern struct rect_limits mboxlims[]; X extern struct week_arrow week_arrows[]; X+ extern Frame fframe; X+ extern int hour24, monday_first, day_first; X+ #endif /* NOTOOL */ X extern char apts_pathname[], tmpapts_pathname[]; X extern int read_only, day_is_open, version2; X extern char *progname; X*************** X*** 47,53 X extern char apts_pathname[], tmpapts_pathname[]; X extern int read_only, day_is_open, version2; X extern char *progname; X- extern Frame fframe; X extern char *daynames[], *monthnames[]; X #ifndef NO_HOLIDAYS X extern int holiday_a, holiday_c, holiday_i, holiday_j, holiday_s; X X--- 48,53 ----- X extern char apts_pathname[], tmpapts_pathname[]; X extern int read_only, day_is_open, version2; X extern char *progname; X extern char *daynames[], *monthnames[]; X extern int dayslot_width, nr_weekdays, max_strlen, n_tslots; X extern struct tm current, today, First, Last; X*************** X*** 49,54 X extern char *progname; X extern Frame fframe; X extern char *daynames[], *monthnames[]; X #ifndef NO_HOLIDAYS X extern int holiday_a, holiday_c, holiday_i, holiday_j, holiday_s; X X X--- 49,57 ----- X extern int read_only, day_is_open, version2; X extern char *progname; X extern char *daynames[], *monthnames[]; X+ extern int dayslot_width, nr_weekdays, max_strlen, n_tslots; X+ extern struct tm current, today, First, Last; X+ extern struct dayslot slots[]; X #ifndef NO_HOLIDAYS X extern int holiday_a, holiday_c, holiday_i, holiday_j, holiday_s; X X*** /tmp/,RCSt1a16968 Fri Dec 15 17:23:28 1989 X--- patchlevel.h Fri Dec 15 17:18:02 1989 X*************** X*** 1,5 X /* X! * $Header: patchlevel.h,v 2.5 89/09/19 06:19:56 billr Exp $ X */ X /* X * patchlevel.h - current patchlevel of calentool program X X--- 1,5 ----- X /* X! * $Header: patchlevel.h,v 2.6 89/12/15 17:18:00 billr Exp $ X */ X /* X * patchlevel.h - current patchlevel of calentool program X*************** X*** 5,8 X * patchlevel.h - current patchlevel of calentool program X */ X X! #define PATCHLEVEL 4 X X--- 5,8 ----- X * patchlevel.h - current patchlevel of calentool program X */ X X! #define PATCHLEVEL 5 X*** /tmp/,RCSt1a16973 Fri Dec 15 17:23:32 1989 X--- put_aentry.c Fri Dec 15 17:18:06 1989 X*************** X*** 1,5 X /* X! * $Header: put_aentry.c,v 2.1 89/05/09 14:19:36 billr Exp $ X */ X /* X * put_aentry - write calentool style files X X--- 1,5 ----- X /* X! * $Header: put_aentry.c,v 2.2 89/12/15 17:18:04 billr Exp $ X */ X /* X * put_aentry - write calentool style files X*************** X*** 91,96 X X if (appt->flags & LOOKAHEAD) X fprintf(apts_file, "<%d> ", appt->lookahead); X if (appt->flags & DELETED) X fprintf(apts_file, "# %s", appt->str); X else X X--- 91,98 ----- X X if (appt->flags & LOOKAHEAD) X fprintf(apts_file, "<%d> ", appt->lookahead); X+ if (appt->flags & RUN) X+ fprintf(apts_file, "+%d ", appt->runlength); X if (appt->flags & DELETED) X fprintf(apts_file, "# %s", appt->str); X else X*** /tmp/,RCSt1a16978 Fri Dec 15 17:23:36 1989 X--- ras2ps.c Fri Dec 15 17:18:10 1989 X*************** X*** 1,5 X /* X! * $Header: ras2ps.c,v 2.2 89/07/19 20:30:25 billr Exp $ X */ X /* X * ras2ps - convert Sun raster file to RLL Postscript file X X--- 1,5 ----- X /* X! * $Header: ras2ps.c,v 2.3 89/12/15 17:18:07 billr Exp $ X */ X /* X * ras2ps - convert Sun raster file to RLL Postscript file X*************** X*** 91,97 X sizey = 10.0; X transx = transy = 0.5; X inv = 0; X! rotate = 90.0; X ofile = outfile; X X if (pr_load_header(infile, &rh) != 0) X X--- 91,97 ----- X sizey = 10.0; X transx = transy = 0.5; X inv = 0; X! rotate = 0.0; X ofile = outfile; X X if (pr_load_header(infile, &rh) != 0) X*** /tmp/,RCSt1a16983 Fri Dec 15 17:23:40 1989 X--- riseset.c Fri Dec 15 17:18:14 1989 X*************** X*** 1,5 X /* X! * $Header: riseset.c,v 2.2 89/07/19 20:31:05 billr Exp $ X */ X /* X * riseset.c X X--- 1,5 ----- X /* X! * $Header: riseset.c,v 2.3 89/12/15 17:18:11 billr Exp $ X */ X /* X * riseset.c X*************** X*** 46,51 X #include "riseset.h" X X extern char *daynames[], *monthnames[]; X X long UTC, TDT, tim, tim2; X double Julian_Day, MJD, Tu, Ru, T70, Local, GMST, LST; X X--- 46,52 ----- X #include "riseset.h" X X extern char *daynames[], *monthnames[]; X+ extern int day_first; X X long UTC, TDT, tim, tim2; X double Julian_Day, MJD, Tu, Ru, T70, Local, GMST, LST; X*************** X*** 134,141 X ltm = localtime(&UTC); X sprintf(riseset_buf[B_LCT], "%.24s Local Civil Time", asctime(ltm)); X X! sprintf(riseset_buf[B_DMY], "%s %s %d, %d", daynames[ltm->tm_wday], X! monthnames[ltm->tm_mon], ltm->tm_mday, ltm->tm_year+1900); X tim2 = UTC + (long)(Local + Round); /* Compute Local Solar Time */ X tdate= gmctime(&tim2); X *(tdate+19) = '\0'; X X--- 135,146 ----- X ltm = localtime(&UTC); X sprintf(riseset_buf[B_LCT], "%.24s Local Civil Time", asctime(ltm)); X X! if (day_first) X! sprintf(riseset_buf[B_DMY], "%s %d %s %d", daynames[ltm->tm_wday], X! ltm->tm_mday, monthnames[ltm->tm_mon], ltm->tm_year+1900); X! else X! sprintf(riseset_buf[B_DMY], "%s %s %d, %d", daynames[ltm->tm_wday], X! monthnames[ltm->tm_mon], ltm->tm_mday, ltm->tm_year+1900); X tim2 = UTC + (long)(Local + Round); /* Compute Local Solar Time */ X tdate= gmctime(&tim2); X *(tdate+19) = '\0'; X*** /tmp/,RCSt1a16988 Fri Dec 15 17:23:45 1989 X--- tool.c Fri Dec 15 17:18:22 1989 X*************** X*** 1,5 X /* X! * $Header: tool.c,v 2.2 89/07/19 20:31:31 billr Exp $ X */ X /* X * tool.c X X--- 1,5 ----- X /* X! * $Header: tool.c,v 2.3 89/12/15 17:18:15 billr Exp $ X */ X /* X * tool.c X*************** X*** 45,50 X Panel_item monthmenu_pi, yearmenu_pi, weekbutton_pi, daybutton_pi; X Panel_item previous_pi, next_pi, current_pi, filebutton_pi; X Panel_item clock_pi; X #ifndef NO_PRINTER X Panel_item printbutton_pi; X #endif X X--- 45,51 ----- X Panel_item monthmenu_pi, yearmenu_pi, weekbutton_pi, daybutton_pi; X Panel_item previous_pi, next_pi, current_pi, filebutton_pi; X Panel_item clock_pi; X+ Panel_item runl_pi; X #ifndef NO_PRINTER X Panel_item printbutton_pi; X #endif X*************** X*** 125,130 X Notify_value check_close(); X int monthlength(); X char year_str[NR_YEARS][5]; /* holds strings for year menu */ X extern Pixwin *main_pixwin; X extern Cursor day_cursor, wait_cursor; X extern int day_is_open, mainsw_state; X X--- 126,132 ----- X Notify_value check_close(); X int monthlength(); X char year_str[NR_YEARS][5]; /* holds strings for year menu */ X+ Rect *closed_rect; X extern Pixwin *main_pixwin; X extern Cursor day_cursor, wait_cursor; X extern int day_is_open, mainsw_state; X*************** X*** 128,134 X extern Pixwin *main_pixwin; X extern Cursor day_cursor, wait_cursor; X extern int day_is_open, mainsw_state; X! extern char todays_date[]; X extern struct appt_entry future[]; X extern int findex; X extern struct dayslot slots[]; X X--- 130,136 ----- X extern Pixwin *main_pixwin; X extern Cursor day_cursor, wait_cursor; X extern int day_is_open, mainsw_state; X! extern char clockstr[]; X extern struct appt_entry future[]; X extern int findex; X extern struct dayslot slots[]; X*************** X*** 136,141 X extern Pixrect moon_icon_pr, sun_icon_pr; X #endif X extern char printer[]; X X /* Create and init control panel */ X create_panel() X X--- 138,144 ----- X extern Pixrect moon_icon_pr, sun_icon_pr; X #endif X extern char printer[]; X+ extern int day_first; X X /* Create and init control panel */ X create_panel() X*************** X*** 288,293 X X width = (int)window_get(panel, WIN_WIDTH); X X clock_pi = panel_create_item(panel, PANEL_MESSAGE, X PANEL_ITEM_X, width-150-(strlen(todays_date)*font->pf_defaultsize.x), X PANEL_ITEM_Y, ATTR_ROW(2)+3, X X--- 291,297 ----- X X width = (int)window_get(panel, WIN_WIDTH); X X+ get_today(); /* get current date and time */ X clock_pi = panel_create_item(panel, PANEL_MESSAGE, X PANEL_ITEM_X, width-150-(strlen(clockstr)*font->pf_defaultsize.x), X PANEL_ITEM_Y, ATTR_ROW(2)+3, X*************** X*** 289,295 X width = (int)window_get(panel, WIN_WIDTH); X X clock_pi = panel_create_item(panel, PANEL_MESSAGE, X! PANEL_ITEM_X, width-150-(strlen(todays_date)*font->pf_defaultsize.x), X PANEL_ITEM_Y, ATTR_ROW(2)+3, X PANEL_LABEL_STRING, todays_date, X PANEL_LABEL_FONT, font, X X--- 293,299 ----- X X get_today(); /* get current date and time */ X clock_pi = panel_create_item(panel, PANEL_MESSAGE, X! PANEL_ITEM_X, width-150-(strlen(clockstr)*font->pf_defaultsize.x), X PANEL_ITEM_Y, ATTR_ROW(2)+3, X PANEL_LABEL_STRING, clockstr, X PANEL_LABEL_FONT, font, X*************** X*** 291,297 X clock_pi = panel_create_item(panel, PANEL_MESSAGE, X PANEL_ITEM_X, width-150-(strlen(todays_date)*font->pf_defaultsize.x), X PANEL_ITEM_Y, ATTR_ROW(2)+3, X! PANEL_LABEL_STRING, todays_date, X PANEL_LABEL_FONT, font, X 0); X X X--- 295,301 ----- X clock_pi = panel_create_item(panel, PANEL_MESSAGE, X PANEL_ITEM_X, width-150-(strlen(clockstr)*font->pf_defaultsize.x), X PANEL_ITEM_Y, ATTR_ROW(2)+3, X! PANEL_LABEL_STRING, clockstr, X PANEL_LABEL_FONT, font, X 0); X X*************** X*** 479,485 X if (!fframe) { X /* create new frame and control panel */ X fframe = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE, X! WIN_SHOW, TRUE, WIN_X, ATTR_COL(12), X WIN_Y, slots[N_SLOTS-4].slot_pos.top, X FRAME_LABEL, "Future Appointments", X FRAME_SHOW_LABEL, TRUE, X X--- 483,489 ----- X if (!fframe) { X /* create new frame and control panel */ X fframe = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE, X! WIN_X, ATTR_COL(12), X WIN_Y, slots[N_SLOTS-4].slot_pos.top, X FRAME_LABEL, "Future Appointments", X FRAME_SHOW_LABEL, TRUE, X*************** X*** 484,489 X FRAME_LABEL, "Future Appointments", X FRAME_SHOW_LABEL, TRUE, X WIN_ERROR_MSG, "Can't create future frame.", X 0); X X fcpanel = window_create(fframe, PANEL, 0); X X--- 488,494 ----- X FRAME_LABEL, "Future Appointments", X FRAME_SHOW_LABEL, TRUE, X WIN_ERROR_MSG, "Can't create future frame.", X+ FRAME_CLOSED_RECT, closed_rect, X 0); X X fcpanel = window_create(fframe, PANEL, 0); X*************** X*** 553,558 X 0); X } X window_fit(fframe); X } X X /* X X--- 558,564 ----- X 0); X } X window_fit(fframe); X+ window_set(fframe, WIN_SHOW, TRUE, 0); X } X X /* X*************** X*** 567,572 X attr_frame = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE, X FRAME_SHOW_LABEL, FALSE, X WIN_ERROR_MSG, "Can't create attributes frame.", X 0); X X attr_panel = window_create(attr_frame, PANEL, X X--- 573,579 ----- X attr_frame = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE, X FRAME_SHOW_LABEL, FALSE, X WIN_ERROR_MSG, "Can't create attributes frame.", X+ FRAME_CLOSED_RECT, closed_rect, X 0); X X attr_panel = window_create(attr_frame, PANEL, X*************** X*** 631,636 X PANEL_BLINK_CARET, TRUE, X 0); X X remind_pi = panel_create_item(attr_panel, PANEL_TEXT, X PANEL_SHOW_ITEM, TRUE, X PANEL_LABEL_STRING, X X--- 638,654 ----- X PANEL_BLINK_CARET, TRUE, X 0); X X+ runl_pi = panel_create_item(attr_panel, PANEL_TEXT, X+ PANEL_SHOW_ITEM, TRUE, X+ PANEL_LABEL_STRING, X+ "Repeat specified number of times (default forever):", X+ PANEL_VALUE, 0, PANEL_VALUE_STORED_LENGTH, 4, X+ PANEL_VALUE_DISPLAY_LENGTH, 4, X+ PANEL_ITEM_X, ATTR_COL(1), X+ PANEL_ITEM_Y, ATTR_ROW(4), X+ PANEL_BLINK_CARET, TRUE, X+ 0); X+ X remind_pi = panel_create_item(attr_panel, PANEL_TEXT, X PANEL_SHOW_ITEM, TRUE, X PANEL_LABEL_STRING, X*************** X*** 638,644 X PANEL_VALUE, 0, PANEL_VALUE_STORED_LENGTH, 4, X PANEL_VALUE_DISPLAY_LENGTH, 4, X PANEL_ITEM_X, ATTR_COL(1), X! PANEL_ITEM_Y, ATTR_ROW(4), X PANEL_BLINK_CARET, TRUE, X 0); X X X--- 656,662 ----- X PANEL_VALUE, 0, PANEL_VALUE_STORED_LENGTH, 4, X PANEL_VALUE_DISPLAY_LENGTH, 4, X PANEL_ITEM_X, ATTR_COL(1), X! PANEL_ITEM_Y, ATTR_ROW(5), X PANEL_BLINK_CARET, TRUE, X 0); X X*************** X*** 651,657 X "Mark in month/year display:", X PANEL_CHOICE_STRINGS, "Yes", "No", 0, X PANEL_ITEM_X, ATTR_COL(1), X! PANEL_ITEM_Y, ATTR_ROW(5), X 0); X X window_fit(attr_panel); X X--- 669,675 ----- X "Mark in month/year display:", X PANEL_CHOICE_STRINGS, "Yes", "No", 0, X PANEL_ITEM_X, ATTR_COL(1), X! PANEL_ITEM_Y, ATTR_ROW(6), X 0); X X window_fit(attr_panel); X*************** X*** 667,672 X del_frame = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE, X FRAME_SHOW_LABEL, FALSE, X WIN_ERROR_MSG, "Can't create delete frame.", X 0); X X del_panel = window_create(del_frame, PANEL, X X--- 685,691 ----- X del_frame = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE, X FRAME_SHOW_LABEL, FALSE, X WIN_ERROR_MSG, "Can't create delete frame.", X+ FRAME_CLOSED_RECT, closed_rect, X 0); X X del_panel = window_create(del_frame, PANEL, X*************** X*** 720,726 X /* create new frame and canvas */ X if (!sframe) { X sframe = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE, X! WIN_SHOW, TRUE, WIN_X, ATTR_COL(12), X FRAME_LABEL, "Solar Data", X FRAME_SHOW_LABEL, TRUE, X FRAME_DONE_PROC, sframe_done, X X--- 739,745 ----- X /* create new frame and canvas */ X if (!sframe) { X sframe = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE, X! WIN_X, ATTR_COL(12), X FRAME_LABEL, "Solar Data", X FRAME_SHOW_LABEL, TRUE, X FRAME_DONE_PROC, sframe_done, X*************** X*** 725,730 X FRAME_SHOW_LABEL, TRUE, X FRAME_DONE_PROC, sframe_done, X WIN_ERROR_MSG, "Can't create sun data frame.", X 0); X X spanel = window_create(sframe, PANEL, WIN_FONT, font, X X--- 744,750 ----- X FRAME_SHOW_LABEL, TRUE, X FRAME_DONE_PROC, sframe_done, X WIN_ERROR_MSG, "Can't create sun data frame.", X+ FRAME_CLOSED_RECT, closed_rect, X 0); X X spanel = window_create(sframe, PANEL, WIN_FONT, font, X*************** X*** 759,764 X X write_sun_data(); X window_fit(sframe); X } else X write_sun_data(); X } X X--- 779,785 ----- X X write_sun_data(); X window_fit(sframe); X+ window_set(sframe, WIN_SHOW, TRUE, 0); X } else X write_sun_data(); X } X*************** X*** 773,779 X /* create new frame and canvas */ X if (!mframe) { X mframe = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE, X! WIN_SHOW, TRUE, WIN_X, ATTR_COL(12), X FRAME_LABEL, "Lunar Data", X FRAME_SHOW_LABEL, TRUE, X FRAME_INHERIT_COLORS, TRUE, X X--- 794,800 ----- X /* create new frame and canvas */ X if (!mframe) { X mframe = window_create(frame, FRAME, FRAME_NO_CONFIRM, TRUE, X! WIN_X, ATTR_COL(12), X FRAME_LABEL, "Lunar Data", X FRAME_SHOW_LABEL, TRUE, X FRAME_FOREGROUND_COLOR, &fg_default, X*************** X*** 776,782 X WIN_SHOW, TRUE, WIN_X, ATTR_COL(12), X FRAME_LABEL, "Lunar Data", X FRAME_SHOW_LABEL, TRUE, X- FRAME_INHERIT_COLORS, TRUE, X FRAME_FOREGROUND_COLOR, &fg_default, X FRAME_BACKGROUND_COLOR, &bg_default, X FRAME_DONE_PROC, mframe_done, X X--- 797,802 ----- X WIN_X, ATTR_COL(12), X FRAME_LABEL, "Lunar Data", X FRAME_SHOW_LABEL, TRUE, X FRAME_FOREGROUND_COLOR, &fg_default, X FRAME_BACKGROUND_COLOR, &bg_default, X FRAME_DONE_PROC, mframe_done, X*************** X*** 781,786 X FRAME_BACKGROUND_COLOR, &bg_default, X FRAME_DONE_PROC, mframe_done, X WIN_ERROR_MSG, "Can't create moon data frame.", X 0); X X mpanel = window_create(mframe, PANEL, WIN_FONT, font, X X--- 801,807 ----- X FRAME_BACKGROUND_COLOR, &bg_default, X FRAME_DONE_PROC, mframe_done, X WIN_ERROR_MSG, "Can't create moon data frame.", X+ FRAME_CLOSED_RECT, closed_rect, X 0); X X mpanel = window_create(mframe, PANEL, WIN_FONT, font, X*************** X*** 816,821 X X write_moon_data(); X window_fit(mframe); X } else X write_moon_data(); X } X X--- 837,843 ----- X X write_moon_data(); X window_fit(mframe); X+ window_set(mframe, WIN_SHOW, TRUE, 0); X } else X write_moon_data(); X } X*************** X*** 833,838 X FRAME_SHOW_LABEL, TRUE, X FRAME_DONE_PROC, fileframe_done, X WIN_ERROR_MSG, "Can't create file frame.", X 0); X X filepanel = window_create(fileframe, PANEL, WIN_FONT, font, X X--- 855,861 ----- X FRAME_SHOW_LABEL, TRUE, X FRAME_DONE_PROC, fileframe_done, X WIN_ERROR_MSG, "Can't create file frame.", X+ FRAME_CLOSED_RECT, closed_rect, X 0); X X filepanel = window_create(fileframe, PANEL, WIN_FONT, font, X*************** X*** 925,930 X WIN_SHOW, TRUE, X WIN_X, ATTR_COL(15), WIN_Y, ATTR_ROW(15), X WIN_ERROR_MSG, "Can't create error frame.", X 0); X X prompt_panel = window_create(prompt_frame, PANEL, X X--- 948,954 ----- X WIN_SHOW, TRUE, X WIN_X, ATTR_COL(15), WIN_Y, ATTR_ROW(15), X WIN_ERROR_MSG, "Can't create error frame.", X+ FRAME_CLOSED_RECT, closed_rect, X 0); X X prompt_panel = window_create(prompt_frame, PANEL, X*************** X*** 995,1000 X FRAME_SHOW_LABEL, TRUE, X FRAME_DONE_PROC, prframe_done, X WIN_ERROR_MSG, "Can't create printer frame.", X 0); X X prpanel = window_create(prframe, PANEL, WIN_FONT, font, X X--- 1019,1025 ----- X FRAME_SHOW_LABEL, TRUE, X FRAME_DONE_PROC, prframe_done, X WIN_ERROR_MSG, "Can't create printer frame.", X+ FRAME_CLOSED_RECT, closed_rect, X 0); X X prpanel = window_create(prframe, PANEL, WIN_FONT, font, X*************** X*** 1039,1044 X FRAME_SHOW_LABEL, TRUE, X FRAME_DONE_PROC, dtframe_done, X WIN_ERROR_MSG, "Can't create date frame.", X 0); X X dtpanel = window_create(date_frame, PANEL, WIN_FONT, font, X X--- 1064,1070 ----- X FRAME_SHOW_LABEL, TRUE, X FRAME_DONE_PROC, dtframe_done, X WIN_ERROR_MSG, "Can't create date frame.", X+ FRAME_CLOSED_RECT, closed_rect, X 0); X X dtpanel = window_create(date_frame, PANEL, WIN_FONT, font, X*************** X*** 1057,1063 X PANEL_SHOW_ITEM, TRUE, X PANEL_ITEM_X, ATTR_COL(1), X PANEL_ITEM_Y, ATTR_ROW(1)+5, X! PANEL_LABEL_STRING, "Enter date (D, M/D, or M/D/Y):", X PANEL_LABEL_FONT, font, X PANEL_LABEL_BOLD, TRUE, X PANEL_VALUE_STORED_LENGTH, 10, X X--- 1083,1089 ----- X PANEL_SHOW_ITEM, TRUE, X PANEL_ITEM_X, ATTR_COL(1), X PANEL_ITEM_Y, ATTR_ROW(1)+5, X! PANEL_LABEL_STRING, (day_first ? "Enter date (D, D/M, or D/M/Y):" : "Enter date (D, M/D, or M/D/Y):"), X PANEL_LABEL_FONT, font, X PANEL_LABEL_BOLD, TRUE, X PANEL_VALUE_STORED_LENGTH, 10, X*************** X*** 1065,1071 X PANEL_BLINK_CARET, TRUE, X 0); X X! sprintf(date, "%d/%d/%02d", current.tm_mon+1, current.tm_mday, current.tm_year); X panel_set_value(setdate_pi, date); X window_fit(dtpanel); X window_fit(date_frame); X X--- 1091,1100 ----- X PANEL_BLINK_CARET, TRUE, X 0); X X! if (day_first) X! sprintf(date, "%d/%d/%02d", current.tm_mday, current.tm_mon+1, current.tm_year); X! else X! sprintf(date, "%d/%d/%02d", current.tm_mon+1, current.tm_mday, current.tm_year); X panel_set_value(setdate_pi, date); X window_fit(dtpanel); X window_fit(date_frame); END_OF_FILE if test 57477 -ne `wc -c <'patches05c'`; then echo shar: \"'patches05c'\" unpacked with wrong size! fi # end of 'patches05c' fi echo shar: End of archive 3 \(of 4\). cp /dev/null ark3isdone MISSING="" for I in 1 2 3 4 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 4 archives. rm -f ark[1-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0