xdiary 1/5 (X based calendar and diary)

Jason Baietto jason at gcx1.ssd.csd.harris.com
Thu Dec 13 10:32:28 AEST 1990


#! /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 1 (of 5)."
# Contents:  Calendar.h Date.h DateP.h DayName.c DayName.h DayNameP.h
#   Gravity.c Gravity.h GravityP.h Imakefile MANIFEST README
#   StrInRect.h StrInRectP.h StrTable.c StrTable.h StrTableP.h
#   Xdiary.ad arrow_l.xbm arrow_r.xbm cal.icon common.h diary.h
#   diary.icon patchlevel.h resource.h template.c template.h
# Wrapped by jason at hcx2 on Thu Dec  6 12:49:20 1990
#
#
#  xdiary version 1.0 -- An X application which displays a calendar in one of
#                      two formats and/or an interactive daily dairy.
#
#  Author: Jason Baietto, jason at ssd.csd.harris.com
#  xdiary Copyright 1990 Harris Corporation
#
#
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Calendar.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Calendar.h'\"
else
echo shar: Extracting \"'Calendar.h'\" \(4040 characters\)
sed "s/^X//" >'Calendar.h' <<'END_OF_FILE'
X/*
X * Author: Jason Baietto, jason at ssd.csd.harris.com
X * xdiary Copyright 1990 Harris Corporation
X *
X * Permission to use, copy, modify, and distribute, this software and its
X * documentation for any purpose is hereby granted without fee, provided that
X * the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of the copyright holder be used in
X * advertising or publicity pertaining to distribution of the software with
X * specific, written prior permission, and that no fee is charged for further
X * distribution of this software, or any modifications thereof.  The copyright
X * holder makes no representations about the suitability of this software for
X * any purpose.  It is provided "as is" without express or implied warranty.
X *
X * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
X * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
X * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ITS USE,
X * LOSS OF DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT,
X * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
X * THE USE OR PERFORMANCE OF THIS SOFTWARE.
X */
X
X#ifndef _CalendarWidget_h
X#define _CalendarWidget_h
X
X#include <X11/Core.h>
X#include "StrInRect.h"
X#include "Date.h"
X
X/* 
X   Calendar.h -- Public Include File.
X   Author: Jason Baietto
X   Date:   September 16, 1990
X*/
X
X/* Public functions: */
Xextern void CalendarSetDate();
Xextern void CalendarShowMonth();
Xextern void CalendarGetDate();
Xextern void CalendarSetMonthInfo();
Xextern void CalendarIncMonth();
Xextern void CalendarDecMonth();
Xextern void CalendarIncYear();
Xextern void CalendarDecYear();
Xextern void CalendarIncDay();
Xextern void CalendarDecDay();
Xextern Date GetTodaysDate();
Xextern Date DateConverter();
Xextern char * CalendarPrettyDate();
X
Xtypedef struct {
X   unsigned int mask;
X   union {
X      char * string;
X      Pixmap pixmap;
X   } info[9]; /* one per gravity */
X} DayInfo;
X
Xtypedef DayInfo MonthInfo[31];
X
X/* Resource Names: */
X#ifndef XtNlineWidth
X#define XtNlineWidth        "lineWidth"
X#endif
X#define XtNdigitFont        "digitFont"
X#define XtNweekdayFont      "weekdayFont"
X#define XtNtitleFont        "titleFont"
X#define XtNinfoFont         "infoFont"
X#define XtNdigitGravity     "digitGravity"
X#define XtNdigitNames       "digitNames"
X#define XtNweekdayNames     "weekdayNames"
X#define XtNmonthNames       "monthNames"
X#ifndef XtNhighlight
X#define XtNhighlight        "highlight"
X#endif
X#define XtNshowYear         "showYear"
X#define XtNstartingWeekday  "startingWeekday"
X
X/* Resource Classes: */
X#ifndef XtCLineWidth
X#define XtCLineWidth        "LineWidth"
X#endif
X#define XtCCalendarFont     "CalendarFont"
X#define XtCDigitGravity     "DigitGravity"
X#define XtCDigitNames       "DigitNames"
X#define XtCWeekdayNames     "WeekdayNames"
X#define XtCMonthNames       "MonthNames"
X#ifndef XtCHighlight
X#define XtCHighlight        "Highlight"
X#endif
X#define XtCShowYear         "ShowYear"
X#define XtCStartingWeekday  "StartingWeekday"
X
Xextern WidgetClass calendarWidgetClass;
X
Xtypedef struct _CalendarClassRec *CalendarWidgetClass;
Xtypedef struct _CalendarRec      *CalendarWidget;
X
X#define DIstringNW  (1L<<0)
X#define DIstringN   (1L<<1)
X#define DIstringNE  (1L<<2)
X#define DIstringW   (1L<<3)
X#define DIstringC   (1L<<4)
X#define DIstringE   (1L<<5)
X#define DIstringSW  (1L<<6)
X#define DIstringS   (1L<<7)
X#define DIstringSE  (1L<<8)
X
X#define DIpixmapNW  (1L<<9)
X#define DIpixmapN   (1L<<10)
X#define DIpixmapNE  (1L<<11)
X#define DIpixmapW   (1L<<12)
X#define DIpixmapC   (1L<<13)
X#define DIpixmapE   (1L<<14)
X#define DIpixmapSW  (1L<<15)
X#define DIpixmapS   (1L<<16)
X#define DIpixmapSE  (1L<<17)
X
X
X#define XtRcalendarDefaultTranslations \
X   "<Btn1Down>:    select()\n\
X    <Btn1Motion>:  select()\n\
X    <Btn1Up>:      notify()"
X
X#endif /* _CalendarWidget_h */
END_OF_FILE
if test 4040 -ne `wc -c <'Calendar.h'`; then
    echo shar: \"'Calendar.h'\" unpacked with wrong size!
fi
# end of 'Calendar.h'
fi
if test -f 'Date.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Date.h'\"
else
echo shar: Extracting \"'Date.h'\" \(1636 characters\)
sed "s/^X//" >'Date.h' <<'END_OF_FILE'
X/*
X * Author: Jason Baietto, jason at ssd.csd.harris.com
X * xdiary Copyright 1990 Harris Corporation
X *
X * Permission to use, copy, modify, and distribute, this software and its
X * documentation for any purpose is hereby granted without fee, provided that
X * the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of the copyright holder be used in
X * advertising or publicity pertaining to distribution of the software with
X * specific, written prior permission, and that no fee is charged for further
X * distribution of this software, or any modifications thereof.  The copyright
X * holder makes no representations about the suitability of this software for
X * any purpose.  It is provided "as is" without express or implied warranty.
X *
X * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
X * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
X * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ITS USE,
X * LOSS OF DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT,
X * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
X * THE USE OR PERFORMANCE OF THIS SOFTWARE.
X */
X
X#ifndef _DateConverter_h
X#define _DateConverter_h
X
Xtypedef struct {
X   short year;
X   char day;
X   char month;
X} Date;
X
Xextern Date convert_string_to_date();
Xextern int is_valid_date();
Xextern char * default_month_names[];
X
X#define XtRDate "Date"
X
X#endif /* _DateConverter_h */
END_OF_FILE
if test 1636 -ne `wc -c <'Date.h'`; then
    echo shar: \"'Date.h'\" unpacked with wrong size!
fi
# end of 'Date.h'
fi
if test -f 'DateP.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'DateP.h'\"
else
echo shar: Extracting \"'DateP.h'\" \(1783 characters\)
sed "s/^X//" >'DateP.h' <<'END_OF_FILE'
X/*
X * Author: Jason Baietto, jason at ssd.csd.harris.com
X * xdiary Copyright 1990 Harris Corporation
X *
X * Permission to use, copy, modify, and distribute, this software and its
X * documentation for any purpose is hereby granted without fee, provided that
X * the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of the copyright holder be used in
X * advertising or publicity pertaining to distribution of the software with
X * specific, written prior permission, and that no fee is charged for further
X * distribution of this software, or any modifications thereof.  The copyright
X * holder makes no representations about the suitability of this software for
X * any purpose.  It is provided "as is" without express or implied warranty.
X *
X * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
X * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
X * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ITS USE,
X * LOSS OF DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT,
X * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
X * THE USE OR PERFORMANCE OF THIS SOFTWARE.
X */
X
X#ifndef _DateConverterP_h
X#define _DateConverterP_h
X
X#include "Date.h"
X
X#define JANUARY   1
X#define FEBRUARY  2
X#define MARCH     3
X#define APRIL     4
X#define MAY       5
X#define JUNE      6
X#define JULY      7
X#define AUGUST    8
X#define SEPTEMBER 9
X#define OCTOBER   10
X#define NOVEMBER  11
X#define DECEMBER  12
X
X#define A_LEAP_YEAR(year) (year%4 == 0 && !(year%100 == 0 && year%400 != 0))
X
X#endif /* _DateConverterP_h */
END_OF_FILE
if test 1783 -ne `wc -c <'DateP.h'`; then
    echo shar: \"'DateP.h'\" unpacked with wrong size!
fi
# end of 'DateP.h'
fi
if test -f 'DayName.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'DayName.c'\"
else
echo shar: Extracting \"'DayName.c'\" \(3732 characters\)
sed "s/^X//" >'DayName.c' <<'END_OF_FILE'
X/*
X * Author: Jason Baietto, jason at ssd.csd.harris.com
X * xdiary Copyright 1990 Harris Corporation
X *
X * Permission to use, copy, modify, and distribute, this software and its
X * documentation for any purpose is hereby granted without fee, provided that
X * the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of the copyright holder be used in
X * advertising or publicity pertaining to distribution of the software with
X * specific, written prior permission, and that no fee is charged for further
X * distribution of this software, or any modifications thereof.  The copyright
X * holder makes no representations about the suitability of this software for
X * any purpose.  It is provided "as is" without express or implied warranty.
X *
X * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
X * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
X * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ITS USE,
X * LOSS OF DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT,
X * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
X * THE USE OR PERFORMANCE OF THIS SOFTWARE.
X */
X
X#include <stdio.h>
X#include <ctype.h>
X#include <X11/StringDefs.h>
X#include <X11/IntrinsicP.h>
X#include "DayNameP.h"
X#include "common.h"
X
X#define MAX_STRING_LEN 256
X
X/*==========================================================================*/
X/*                                 Quarks:                                  */
X/*==========================================================================*/
XXrmQuark XtQSunday;
XXrmQuark XtQMonday;
XXrmQuark XtQTuesday;
XXrmQuark XtQWednesday;
XXrmQuark XtQThursday;
XXrmQuark XtQFriday;
XXrmQuark XtQSaturday;
X
X
X/*==========================================================================*/
X/*                         DayName Type Converter:                          */
X/*==========================================================================*/
Xstatic void downcase_string(source, dest)
Xchar * source;
Xchar * dest;
X{
X   for (; *source != 0; source++, dest++) {
X      *dest = DOWNCASE(*source);
X   }
X   *dest = 0;
X}
X
X
X
X/*ARGSUSED*/
Xvoid DayNameConverter(args, num_args, fromVal, toVal)
XXrmValuePtr args;
XCardinal    *num_args;
XXrmValuePtr fromVal;
XXrmValuePtr toVal;
X{
X   static int initialized = FALSE;
X   static XtDayName DayName;
X   XrmQuark q;
X   char lowerName[MAX_STRING_LEN];
X
X   if (!initialized) {
X      /* Create quarks the first time we're called. */
X      XtQSunday     = XrmStringToQuark(XtNsunday);
X      XtQMonday     = XrmStringToQuark(XtNmonday);
X      XtQTuesday    = XrmStringToQuark(XtNtuesday);
X      XtQWednesday  = XrmStringToQuark(XtNwednesday);
X      XtQThursday   = XrmStringToQuark(XtNthursday);
X      XtQFriday     = XrmStringToQuark(XtNfriday);
X      XtQSaturday   = XrmStringToQuark(XtNsaturday);
X   }
X
X   downcase_string((char*)fromVal->addr, lowerName);
X   q = XrmStringToQuark(lowerName);
X
X   toVal->size = sizeof(XtDayName);
X   toVal->addr = (XtPointer) &DayName;
X
X   if (q == XtQSunday) {
X      DayName = Sunday;
X   } else if (q == XtQMonday) {
X      DayName = Monday;
X   } else if (q == XtQTuesday) {
X      DayName = Tuesday;
X   } else if (q == XtQWednesday) {
X      DayName = Wednesday;
X   } else if (q == XtQThursday) {
X      DayName = Thursday;
X   } else if (q == XtQFriday) {
X      DayName = Friday;
X   } else if (q == XtQSaturday) {
X      DayName = Saturday;
X   } else {
X      XtStringConversionWarning(fromVal->addr, "XtRDayName");
X      toVal->addr = NULL;
X      toVal->size = 0;
X   }
X}
X
END_OF_FILE
if test 3732 -ne `wc -c <'DayName.c'`; then
    echo shar: \"'DayName.c'\" unpacked with wrong size!
fi
# end of 'DayName.c'
fi
if test -f 'DayName.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'DayName.h'\"
else
echo shar: Extracting \"'DayName.h'\" \(1638 characters\)
sed "s/^X//" >'DayName.h' <<'END_OF_FILE'
X/*
X * Author: Jason Baietto, jason at ssd.csd.harris.com
X * xdiary Copyright 1990 Harris Computer Systems Division
X *
X * Permission to use, copy, modify, and distribute, this software and its
X * documentation for any purpose is hereby granted without fee, provided that
X * the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of the copyright holder be used in
X * advertising or publicity pertaining to distribution of the software with
X * specific, written prior permission, and that no fee is charged for further
X * distribution of this software, or any modifications thereof.  The copyright
X * holder makes no representations about the suitability of this software for
X * any purpose.  It is provided "as is" without express or implied warranty.
X *
X * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
X * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
X * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ITS USE,
X * LOSS OF DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT,
X * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
X * THE USE OR PERFORMANCE OF THIS SOFTWARE.
X */
X
X#ifndef _DayNameConverter_h
X#define _DayNameConverter_h
X
Xextern void DayNameConverter();
X
X#define XtRDayName "DayName"
X
Xtypedef enum {
X   Sunday,
X   Monday,
X   Tuesday,
X   Wednesday,
X   Thursday,
X   Friday,
X   Saturday
X} XtDayName;
X
X#endif /* _DayNameConverter_h */
END_OF_FILE
if test 1638 -ne `wc -c <'DayName.h'`; then
    echo shar: \"'DayName.h'\" unpacked with wrong size!
fi
# end of 'DayName.h'
fi
if test -f 'DayNameP.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'DayNameP.h'\"
else
echo shar: Extracting \"'DayNameP.h'\" \(1888 characters\)
sed "s/^X//" >'DayNameP.h' <<'END_OF_FILE'
X/*
X * Author: Jason Baietto, jason at ssd.csd.harris.com
X * xdiary Copyright 1990 Harris Corporation
X *
X * Permission to use, copy, modify, and distribute, this software and its
X * documentation for any purpose is hereby granted without fee, provided that
X * the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of the copyright holder be used in
X * advertising or publicity pertaining to distribution of the software with
X * specific, written prior permission, and that no fee is charged for further
X * distribution of this software, or any modifications thereof.  The copyright
X * holder makes no representations about the suitability of this software for
X * any purpose.  It is provided "as is" without express or implied warranty.
X *
X * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
X * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
X * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ITS USE,
X * LOSS OF DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT,
X * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
X * THE USE OR PERFORMANCE OF THIS SOFTWARE.
X */
X
X#ifndef _DayNameConverterP_h
X#define _DayNameConverterP_h
X
X#include "DayName.h"
X
X#define XtNsunday    "sunday"
X#define XtNmonday    "monday"
X#define XtNtuesday   "tuesday"
X#define XtNwednesday "wednesday"
X#define XtNthursday  "thursday"
X#define XtNfriday    "friday"
X#define XtNsaturday  "saturday"
X
Xextern XrmQuark XtQSunday;
Xextern XrmQuark XtQMonday;
Xextern XrmQuark XtQTuesday;
Xextern XrmQuark XtQWednesday;
Xextern XrmQuark XtQThursday;
Xextern XrmQuark XtQFriday;
Xextern XrmQuark XtQSaturdy;
X
X#endif /* _DayNameConverter_h */
END_OF_FILE
if test 1888 -ne `wc -c <'DayNameP.h'`; then
    echo shar: \"'DayNameP.h'\" unpacked with wrong size!
fi
# end of 'DayNameP.h'
fi
if test -f 'Gravity.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Gravity.c'\"
else
echo shar: Extracting \"'Gravity.c'\" \(4651 characters\)
sed "s/^X//" >'Gravity.c' <<'END_OF_FILE'
X/*
X * Author: Jason Baietto, jason at ssd.csd.harris.com
X * xdiary Copyright 1990 Harris Corporation
X *
X * Permission to use, copy, modify, and distribute, this software and its
X * documentation for any purpose is hereby granted without fee, provided that
X * the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of the copyright holder be used in
X * advertising or publicity pertaining to distribution of the software with
X * specific, written prior permission, and that no fee is charged for further
X * distribution of this software, or any modifications thereof.  The copyright
X * holder makes no representations about the suitability of this software for
X * any purpose.  It is provided "as is" without express or implied warranty.
X *
X * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
X * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
X * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ITS USE,
X * LOSS OF DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT,
X * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
X * THE USE OR PERFORMANCE OF THIS SOFTWARE.
X */
X
X#include <stdio.h>
X#include <ctype.h>
X#include <X11/StringDefs.h>
X#include <X11/IntrinsicP.h>
X#include "GravityP.h"
X#include "common.h"
X
X#define MAX_STRING_LEN 256
X
X/*==========================================================================*/
X/*                                 Quarks:                                  */
X/*==========================================================================*/
XXrmQuark XtQNorthWest;
XXrmQuark XtQNorth;
XXrmQuark XtQNorthEast;
XXrmQuark XtQWest;
XXrmQuark XtQCenter;
XXrmQuark XtQEast;
XXrmQuark XtQSouthWest;
XXrmQuark XtQSouth;
XXrmQuark XtQSouthEast;
X
XXrmQuark XtQNW;
XXrmQuark XtQN;
XXrmQuark XtQNE;
XXrmQuark XtQW;
XXrmQuark XtQC;
XXrmQuark XtQE;
XXrmQuark XtQSW;
XXrmQuark XtQS;
XXrmQuark XtQSE;
X
X
X/*==========================================================================*/
X/*                         Gravity Type Converter:                          */
X/*==========================================================================*/
Xstatic void downcase_string(source, dest)
Xchar * source;
Xchar * dest;
X{
X   for (; *source != 0; source++, dest++) {
X      *dest = DOWNCASE(*source);
X   }
X   *dest = 0;
X}
X
X
X
X/*ARGSUSED*/
Xvoid GravityConverter(args, num_args, fromVal, toVal)
XXrmValuePtr args;
XCardinal    *num_args;
XXrmValuePtr fromVal;
XXrmValuePtr toVal;
X{
X   static int initialized = FALSE;
X   static XtGravity gravity;
X   XrmQuark q;
X   char lowerName[MAX_STRING_LEN];
X
X   if (!initialized) {
X      /* Create quarks the first time we're called. */
X      XtQNorthWest  = XrmStringToQuark(XtNnorthWest);
X      XtQNorth      = XrmStringToQuark(XtNnorth);
X      XtQNorthEast  = XrmStringToQuark(XtNnorthEast);
X      XtQWest       = XrmStringToQuark(XtNwest);
X      XtQCenter     = XrmStringToQuark(XtNcenter);
X      XtQEast       = XrmStringToQuark(XtNeast);
X      XtQSouthWest  = XrmStringToQuark(XtNsouthWest);
X      XtQSouth      = XrmStringToQuark(XtNsouth);
X      XtQSouthEast  = XrmStringToQuark(XtNsouthEast);
X
X      XtQNW  = XrmStringToQuark(XtNnorthWest2);
X      XtQN   = XrmStringToQuark(XtNnorth2);
X      XtQNE  = XrmStringToQuark(XtNnorthEast2);
X      XtQW   = XrmStringToQuark(XtNwest2);
X      XtQC   = XrmStringToQuark(XtNcenter2);
X      XtQE   = XrmStringToQuark(XtNeast2);
X      XtQSW  = XrmStringToQuark(XtNsouthWest2);
X      XtQS   = XrmStringToQuark(XtNsouth2);
X      XtQSE  = XrmStringToQuark(XtNsouthEast2);
X   }
X
X   downcase_string((char*)fromVal->addr, lowerName);
X   q = XrmStringToQuark(lowerName);
X
X   toVal->size = sizeof(XtGravity);
X   toVal->addr = (XtPointer) &gravity;
X
X   if (q == XtQNorthWest || q == XtQNW) {
X      gravity = NorthWest;
X   } else if (q == XtQNorth || q == XtQN) {
X      gravity = North;
X   } else if (q == XtQNorthEast || q == XtQNE) {
X      gravity = NorthEast;
X   } else if (q == XtQWest || q == XtQW) {
X      gravity = West;
X   } else if (q == XtQCenter || q == XtQC) {
X      gravity = Center;
X   } else if (q == XtQEast || q == XtQE) {
X      gravity = East;
X   } else if (q == XtQSouthWest || q == XtQSW) {
X      gravity = SouthWest;
X   } else if (q == XtQSouth || q == XtQS) {
X      gravity = South;
X   } else if (q == XtQSouthEast || q == XtQSE) {
X      gravity = SouthEast;
X   } else {
X      XtStringConversionWarning(fromVal->addr, "XtRGravity");
X      toVal->addr = NULL;
X      toVal->size = 0;
X   }
X}
X
END_OF_FILE
if test 4651 -ne `wc -c <'Gravity.c'`; then
    echo shar: \"'Gravity.c'\" unpacked with wrong size!
fi
# end of 'Gravity.c'
fi
if test -f 'Gravity.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Gravity.h'\"
else
echo shar: Extracting \"'Gravity.h'\" \(1644 characters\)
sed "s/^X//" >'Gravity.h' <<'END_OF_FILE'
X/*
X * Author: Jason Baietto, jason at ssd.csd.harris.com
X * xdiary Copyright 1990 Harris Corporation
X *
X * Permission to use, copy, modify, and distribute, this software and its
X * documentation for any purpose is hereby granted without fee, provided that
X * the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of the copyright holder be used in
X * advertising or publicity pertaining to distribution of the software with
X * specific, written prior permission, and that no fee is charged for further
X * distribution of this software, or any modifications thereof.  The copyright
X * holder makes no representations about the suitability of this software for
X * any purpose.  It is provided "as is" without express or implied warranty.
X *
X * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
X * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
X * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ITS USE,
X * LOSS OF DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT,
X * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
X * THE USE OR PERFORMANCE OF THIS SOFTWARE.
X */
X
X#ifndef _GravityConverter_h
X#define _GravityConverter_h
X
Xextern void GravityConverter();
X
X#define XtRGravity "Gravity"
X
Xtypedef enum {
X   NorthWest,
X   North,
X   NorthEast,
X   West,
X   Center,
X   East,
X   SouthWest,
X   South,
X   SouthEast
X} XtGravity;
X
X#endif /* _GravityConverter_h */
END_OF_FILE
if test 1644 -ne `wc -c <'Gravity.h'`; then
    echo shar: \"'Gravity.h'\" unpacked with wrong size!
fi
# end of 'Gravity.h'
fi
if test -f 'GravityP.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'GravityP.h'\"
else
echo shar: Extracting \"'GravityP.h'\" \(2441 characters\)
sed "s/^X//" >'GravityP.h' <<'END_OF_FILE'
X/*
X * Author: Jason Baietto, jason at ssd.csd.harris.com
X * xdiary Copyright 1990 Harris Corporation
X *
X * Permission to use, copy, modify, and distribute, this software and its
X * documentation for any purpose is hereby granted without fee, provided that
X * the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of the copyright holder be used in
X * advertising or publicity pertaining to distribution of the software with
X * specific, written prior permission, and that no fee is charged for further
X * distribution of this software, or any modifications thereof.  The copyright
X * holder makes no representations about the suitability of this software for
X * any purpose.  It is provided "as is" without express or implied warranty.
X *
X * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
X * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
X * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ITS USE,
X * LOSS OF DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT,
X * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
X * THE USE OR PERFORMANCE OF THIS SOFTWARE.
X */
X
X#ifndef _GravityConverterP_h
X#define _GravityConverterP_h
X
X#include "Gravity.h"
X
X#define XtNnorthWest "northwest"
X#define XtNnorth     "north"
X#define XtNnorthEast "northeast"
X#define XtNwest      "west"
X#define XtNcenter    "center"
X#define XtNeast      "east"
X#define XtNsouthWest "southwest"
X#define XtNsouth     "south"
X#define XtNsouthEast "southeast"
X
X#define XtNnorthWest2 "nw"
X#define XtNnorth2     "n"
X#define XtNnorthEast2 "ne"
X#define XtNwest2      "w"
X#define XtNcenter2    "c"
X#define XtNeast2      "e"
X#define XtNsouthWest2 "sw"
X#define XtNsouth2     "s"
X#define XtNsouthEast2 "se"
X
Xextern XrmQuark XtQNorthWest;
Xextern XrmQuark XtQNorth;
Xextern XrmQuark XtQNorthEast;
Xextern XrmQuark XtQWest;
Xextern XrmQuark XtQCenter;
Xextern XrmQuark XtQEast;
Xextern XrmQuark XtQSouthWest;
Xextern XrmQuark XtQSouth;
Xextern XrmQuark XtQSouthEast;
X
Xextern XrmQuark XtQNW;
Xextern XrmQuark XtQN;
Xextern XrmQuark XtQNE;
Xextern XrmQuark XtQW;
Xextern XrmQuark XtQC;
Xextern XrmQuark XtQE;
Xextern XrmQuark XtQSW;
Xextern XrmQuark XtQS;
Xextern XrmQuark XtQSE;
X
X#endif /* _GravityConverter_h */
END_OF_FILE
if test 2441 -ne `wc -c <'GravityP.h'`; then
    echo shar: \"'GravityP.h'\" unpacked with wrong size!
fi
# end of 'GravityP.h'
fi
if test -f 'Imakefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Imakefile'\"
else
echo shar: Extracting \"'Imakefile'\" \(2166 characters\)
sed "s/^X//" >'Imakefile' <<'END_OF_FILE'
X#
X# Author: Jason Baietto, jason at ssd.csd.harris.com
X# xdiary Copyright 1990 Harris Corporation
X#
X# Permission to use, copy, modify, and distribute, this software and its
X# documentation for any purpose is hereby granted without fee, provided that
X# the above copyright notice appear in all copies and that both that
X# copyright notice and this permission notice appear in supporting
X# documentation, and that the name of the copyright holder be used in
X# advertising or publicity pertaining to distribution of the software with
X# specific, written prior permission, and that no fee is charged for further
X# distribution of this software, or any modifications thereof.  The copyright
X# holder makes no representations about the suitability of this software for
X# any purpose.  It is provided "as is" without express or implied warranty.
X#
X# THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
X# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
X# EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
X# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ITS USE,
X# LOSS OF DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT,
X# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
X# THE USE OR PERFORMANCE OF THIS SOFTWARE.
X#
X
X#
X# Imakefile for xdiary
X# Use xmkmf at your site to generate a site specific Makefile
X#
X
X        DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB) $(DEPXEXTLIB)
XLOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB) $(XEXTLIB)
X           SRCS = Calendar.c \
X                  StrInRect.c \
X                  StrTable.c \
X                  Gravity.c \
X                  Date.c \
X                  DayName.c \
X                  template.c \
X                  diary.c \
X                  main.c
X
X           OBJS = Calendar.o \
X                  StrInRect.o \
X                  StrTable.o \
X                  Gravity.o \
X                  Date.o \
X                  DayName.o \
X                  diary.o \
X                  template.o \
X                  main.o
X
XComplexProgramTarget(xdiary)
X
XInstallAppDefaults(Xdiary)
END_OF_FILE
if test 2166 -ne `wc -c <'Imakefile'`; then
    echo shar: \"'Imakefile'\" unpacked with wrong size!
fi
# end of 'Imakefile'
fi
if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'MANIFEST'\"
else
echo shar: Extracting \"'MANIFEST'\" \(1292 characters\)
sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
X   File Name		Archive #	Description
X-----------------------------------------------------------
X Calendar.c                 5	
X Calendar.doc               2	
X Calendar.h                 1	
X CalendarP.h                2	
X Date.c                     2	
X Date.h                     1	
X DateP.h                    1	
X DayName.c                  1	
X DayName.h                  1	
X DayNameP.h                 1	
X Gravity.c                  1	
X Gravity.h                  1	
X GravityP.h                 1	
X Imakefile                  1	
X MANIFEST                   1	This shipping list
X Makefile                   2	
X README                     1	
X StrInRect.c                2	
X StrInRect.h                1	
X StrInRectP.h               1	
X StrTable.c                 1	
X StrTable.h                 1	
X StrTableP.h                1	
X Xdiary.ad                  1	
X arrow_l.xbm                1	
X arrow_r.xbm                1	
X cal.icon                   1	
X common.h                   1	
X diary.c                    3	
X diary.h                    1	
X diary.icon                 1	
X main.c                     4	
X main.h                     2	
X patchlevel.h               1	
X resource.h                 1	
X template.c                 1	
X template.h                 1	
X xdiary.man                 3	
END_OF_FILE
if test 1292 -ne `wc -c <'MANIFEST'`; then
    echo shar: \"'MANIFEST'\" unpacked with wrong size!
fi
# end of 'MANIFEST'
fi
if test -f 'README' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'README'\"
else
echo shar: Extracting \"'README'\" \(3148 characters\)
sed "s/^X//" >'README' <<'END_OF_FILE'
Xxdiary version 1.0 -- An X application which displays a calendar in one of
X                      two formats and/or an interactive daily dairy.
X
XAuthor: Jason Baietto, jason at ssd.csd.harris.com
Xxdiary Copyright 1990 Harris Corporation
X
Xxdiary was initially developed as an exercise for me to learn the basics
Xof widget writing and toolkit programming.  However, the further along
Xit came the more I realized that a useful tool could be made of it.
X
XIn its current form (version 1.0) xdiary provides a somewhat robust tool
Xfor associating text with a specified date, suitable for keeping a daily
Xdiary or work log.  By using templates, the diary entries can be
Xconfigured or personalized to be suitabile for a wide range of needs.
XSee the man page for more details.
X
Xxdiary will only build under Release 4.  The Makefile supplied is the
Xresult of running xmkmf on a Sun-3 with Release 4 installed.  Running
Xxmkmf on your system should provide you with a suitable makefile, if
Xthe one provided doesn't work right off.
X
XThere are many improvements currently under consideration, and I am
Xinterested in hearing "reasonable" requests for features and enhancements
Xfor the next version.  I have no intention of adding xclock-like
Xfunctionality to xdiary (for an "integrated desktop" feel) so please
Xsend those requests to /dev/null.
X
Xxdiary was developed on a Harris Night Hawk 3800 running CX/UX 5.0, and
Xit has also been tested on a Sun-3 running SunOS 4.0.3.  Please email
Xcomments and bug reports directly to me (at the address listed above).
X
XA large part of the xdiary coding effort was devoted to the CalendarWidget in
Xhopes that other developers might use it in their own applications.  The
XCalendar.doc document is in the standard Xaw widget document format and can be
Xprinted out on unix systems via:
X
X    tbl macros.t strings.xaw Calendar.doc | roff -ms
X
Xwhere macros.t and strings.xaw can be found in the mit/doc/Xaw/ directory
Xof the X tree.
X
XPermission to use, copy, modify, and distribute, this software and its
Xdocumentation for any purpose is hereby granted without fee, provided that
Xthe above copyright notice appear in all copies and that both that
Xcopyright notice and this permission notice appear in supporting
Xdocumentation, and that the name of the copyright holder be used in
Xadvertising or publicity pertaining to distribution of the software with
Xspecific, written prior permission, and that no fee is charged for further
Xdistribution of this software, or any modifications thereof.  The copyright
Xholder makes no representations about the suitability of this software for
Xany purpose.  It is provided "as is" without express or implied warranty.
X
XTHE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
XINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
XEVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
XCONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ITS USE,
XLOSS OF DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT,
XNEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
XTHE USE OR PERFORMANCE OF THIS SOFTWARE.
END_OF_FILE
if test 3148 -ne `wc -c <'README'`; then
    echo shar: \"'README'\" unpacked with wrong size!
fi
# end of 'README'
fi
if test -f 'StrInRect.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'StrInRect.h'\"
else
echo shar: Extracting \"'StrInRect.h'\" \(2459 characters\)
sed "s/^X//" >'StrInRect.h' <<'END_OF_FILE'
X/*
X * Author: Jason Baietto, jason at ssd.csd.harris.com
X * xdiary Copyright 1990 Harris Corporation
X *
X * Permission to use, copy, modify, and distribute, this software and its
X * documentation for any purpose is hereby granted without fee, provided that
X * the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of the copyright holder be used in
X * advertising or publicity pertaining to distribution of the software with
X * specific, written prior permission, and that no fee is charged for further
X * distribution of this software, or any modifications thereof.  The copyright
X * holder makes no representations about the suitability of this software for
X * any purpose.  It is provided "as is" without express or implied warranty.
X *
X * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
X * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
X * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ITS USE,
X * LOSS OF DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT,
X * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
X * THE USE OR PERFORMANCE OF THIS SOFTWARE.
X */
X
X#ifndef _DrawStringInRect_h
X#define _DrawStringInRect_h
X
X#include "Gravity.h"
X
X/*
X   Author: Jason Baietto
X   Date:   9/22/90
X
X   The DrawStringInRect routine draws text in a specified XtRectangle at the
X   location specified by the XtGravity parameter.  
X
X   The DrawStringsInRects routine does the same thing, but for multiple
X   strings.  It is passed a pointer to an array of strings, an array of string
X   lengths, and an array of rectangles, thus making it possible for each
X   string to specify a different rectangle.
X
X   Care must be taken to ensure that the XFontStruct passed in matches the
X   font that is specified in the GC that is passed in, otherwise the extent
X   measurements will be incorrect and the string will be drawn incorrectly.
X
X   Absolutely no error checking is done.  The application is responsible for
X   providing a rectangle large enough for the specified string.
X
X   You must include this file in your widget or application to use the
X   DrawStringInRect routines.
X*/
X
Xextern void DrawStringInRect();
Xextern void DrawStringsInRects();
X
X#endif /* _DrawStringInRect_h */
END_OF_FILE
if test 2459 -ne `wc -c <'StrInRect.h'`; then
    echo shar: \"'StrInRect.h'\" unpacked with wrong size!
fi
# end of 'StrInRect.h'
fi
if test -f 'StrInRectP.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'StrInRectP.h'\"
else
echo shar: Extracting \"'StrInRectP.h'\" \(1497 characters\)
sed "s/^X//" >'StrInRectP.h' <<'END_OF_FILE'
X/*
X * Author: Jason Baietto, jason at ssd.csd.harris.com
X * xdiary Copyright 1990 Harris Corporation
X *
X * Permission to use, copy, modify, and distribute, this software and its
X * documentation for any purpose is hereby granted without fee, provided that
X * the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of the copyright holder be used in
X * advertising or publicity pertaining to distribution of the software with
X * specific, written prior permission, and that no fee is charged for further
X * distribution of this software, or any modifications thereof.  The copyright
X * holder makes no representations about the suitability of this software for
X * any purpose.  It is provided "as is" without express or implied warranty.
X *
X * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
X * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
X * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ITS USE,
X * LOSS OF DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT,
X * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
X * THE USE OR PERFORMANCE OF THIS SOFTWARE.
X */
X
X#ifndef _DrawStringInRectP_h
X#define _DrawStringInRectP_h
X
X#include "StrInRect.h"
X#include "StrTable.h"
X
X#endif /* _DrawStringInRectP_h */
END_OF_FILE
if test 1497 -ne `wc -c <'StrInRectP.h'`; then
    echo shar: \"'StrInRectP.h'\" unpacked with wrong size!
fi
# end of 'StrInRectP.h'
fi
if test -f 'StrTable.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'StrTable.c'\"
else
echo shar: Extracting \"'StrTable.c'\" \(4873 characters\)
sed "s/^X//" >'StrTable.c' <<'END_OF_FILE'
X/*
X * Author: Jason Baietto, jason at ssd.csd.harris.com
X * xdiary Copyright 1990 Harris Corporation
X *
X * Permission to use, copy, modify, and distribute, this software and its
X * documentation for any purpose is hereby granted without fee, provided that
X * the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of the copyright holder be used in
X * advertising or publicity pertaining to distribution of the software with
X * specific, written prior permission, and that no fee is charged for further
X * distribution of this software, or any modifications thereof.  The copyright
X * holder makes no representations about the suitability of this software for
X * any purpose.  It is provided "as is" without express or implied warranty.
X *
X * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
X * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
X * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ITS USE,
X * LOSS OF DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT,
X * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
X * THE USE OR PERFORMANCE OF THIS SOFTWARE.
X */
X
X#include <stdio.h>
X#include <X11/StringDefs.h>
X#include <X11/IntrinsicP.h>
X#include "StrTableP.h"
X
X/* Copy a string, replacing two consecutive double quotes with a single. */
Xstatic void string_copy(dest_string, source_string, length)
Xchar * dest_string;
Xchar * source_string;
Xint length;
X{
X   char * dest_ptr = dest_string;
X   char * src_ptr = source_string;
X   char * end_ptr = src_ptr + length;
X
X   while (src_ptr < end_ptr) {
X      if (*src_ptr == QUOTE) {
X         src_ptr++;
X      }
X      *dest_ptr = *src_ptr;
X      dest_ptr++;
X      src_ptr++;
X   }
X   
X   /* Null terminate the string */
X   *dest_ptr = NULL;
X}
X
X
X/* Convert a string containing quoted strings into a string table.   */
X/* Two consecutive quotes inside a "string" become a single quote.   */
X/* This algorithm just ignores all characters between each "string". */
X/* Not the most robust thing I ever wrote, but it'll do the job.     */
X
X/*ARGSUSED*/
Xvoid StringTableConverter(args, num_args, fromVal, toVal)
XXrmValuePtr args;
XCardinal    *num_args;
XXrmValuePtr fromVal;
XXrmValuePtr toVal;
X{
X   static char ** array;
X   int num_allocated;
X   int token_len;
X   char * beg_ptr = (char *) fromVal->addr;
X   char * cur_ptr = beg_ptr;
X   int token_num = 0;
X   int in_token = FALSE;
X
X   num_allocated = INIT_SIZE;
X   array = (char **) XtMalloc(num_allocated*sizeof(char *));
X
X   while (*cur_ptr) {
X      if (*cur_ptr == QUOTE) {
X         if (in_token) {
X            if (*(cur_ptr+sizeof(char)) == QUOTE) {
X               /* Two consecutive quotes become one quote. */
X               cur_ptr++;
X            } else {
X               /* Finished with this token, ignore final quote. */
X               token_len = cur_ptr - beg_ptr;
X               array[token_num] = (char*)XtMalloc((token_len+1)*sizeof(char));
X               string_copy(array[token_num], beg_ptr, token_len);
X               in_token = FALSE;
X               token_num++;
X
X               /* Allocate more array space if necessary. */
X               if (token_num == num_allocated) {
X                  num_allocated += GROW_BY;
X                  array = (char**)XtRealloc(array, num_allocated*sizeof(char*));
X               }
X            }
X
X         } else {
X            /* We've got a new token, skip leading quote */
X            beg_ptr = cur_ptr;
X            beg_ptr++;
X            in_token = TRUE;
X         }
X      }
X      cur_ptr++;
X   }
X
X   if (in_token) {
X      /* Exited above loop still in a token. */
X      /*VARARGS*/
X      fprintf(stderr,
X         "StringTableConverter: Unmatched quote in resource string.\n"
X      );
X      toVal->addr = NULL;
X      toVal->size = 0;
X   } else {
X      /* Null terminate the array. */
X      array[token_num] = NULL;
X
X      /* Load the return value. */
X      toVal->addr = (caddr_t) &array;
X      toVal->size = sizeof(array);
X   }
X}
X
X
X/* Return the number of strings in a string table. */
Xint StringTableNumber(table)
XStringTable table;
X{
X   int number = -1;
X   while (table[++number]);
X   return number;
X}
X
X
X/* Dump the specified string table.  For debugging only. */
Xvoid StringTableDump(table)
XStringTable table;
X{
X   int number = -1;
X   while (table[++number]) {
X      /*VARARGS*/
X      printf("%d: %s\n", number, table[number]);
X   }
X}
X
X
X
X/* Create new array with old contents. */
XStringTable StringTableCopy(old)
XStringTable old;
X{
X   int i;
X   int length = StringTableNumber(old) + 1;
X   StringTable new = (StringTable) XtMalloc(length * sizeof(char *));
X
X   for (i=0; i < length; i++) {   
X      new[i] = old[i];
X   }
X
X   return new;
X}
END_OF_FILE
if test 4873 -ne `wc -c <'StrTable.c'`; then
    echo shar: \"'StrTable.c'\" unpacked with wrong size!
fi
# end of 'StrTable.c'
fi
if test -f 'StrTable.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'StrTable.h'\"
else
echo shar: Extracting \"'StrTable.h'\" \(2790 characters\)
sed "s/^X//" >'StrTable.h' <<'END_OF_FILE'
X/*
X * Author: Jason Baietto, jason at ssd.csd.harris.com
X * xdiary Copyright 1990 Harris Corporation
X *
X * Permission to use, copy, modify, and distribute, this software and its
X * documentation for any purpose is hereby granted without fee, provided that
X * the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of the copyright holder be used in
X * advertising or publicity pertaining to distribution of the software with
X * specific, written prior permission, and that no fee is charged for further
X * distribution of this software, or any modifications thereof.  The copyright
X * holder makes no representations about the suitability of this software for
X * any purpose.  It is provided "as is" without express or implied warranty.
X *
X * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
X * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
X * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ITS USE,
X * LOSS OF DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT,
X * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
X * THE USE OR PERFORMANCE OF THIS SOFTWARE.
X */
X
X#ifndef _StringTableConverter_h
X#define _StringTableConverter_h
X/* 
X   StringTableConverter --  Convert a comma separated list of quote
X                            enclosed strings into a StringTable resource.
X
X   example:  xdiary*dayNames: "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
X
X   A StringTable is an array of pointers to strings whose last entry is NULL.
X   If no strings are specified, the initial entry is NULL.  Double quotes 
X   delimit the string, but two consecutive quotes become a single double
X   quote in the final string.  For example, """Wow!""" becomes "Wow!".
X
X   int StringTableNumber(StringTable) -- Returns the number of strings in
X                                         a specified string table.
X
X   void StringTableDump(StringTable) -- Dumps the contents of a string table.
X                                        Useful for debugging purposes only.
X
X   StringTable StringTableCopy(StringTable) -- Allocates a new array, but uses
X                                               the same string pointers.
X                                               Be careful with this one.
X
X   Author: Jason Baietto
X   Date:   9/20/90
X*/
X
Xtypedef char ** StringTable;
X
Xextern void StringTableConverter();
Xextern int StringTableNumber();
Xextern void StringTableDump();
Xextern StringTable StringTableCopy();
X
X#ifndef XtRStringTable
X#define XtRStringTable "StringTable"
X#endif
X
X#endif /* _StringTableConverter_h */
END_OF_FILE
if test 2790 -ne `wc -c <'StrTable.h'`; then
    echo shar: \"'StrTable.h'\" unpacked with wrong size!
fi
# end of 'StrTable.h'
fi
if test -f 'StrTableP.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'StrTableP.h'\"
else
echo shar: Extracting \"'StrTableP.h'\" \(1650 characters\)
sed "s/^X//" >'StrTableP.h' <<'END_OF_FILE'
X/*
X * Author: Jason Baietto, jason at ssd.csd.harris.com
X * xdiary Copyright 1990 Harris Corporation
X *
X * Permission to use, copy, modify, and distribute, this software and its
X * documentation for any purpose is hereby granted without fee, provided that
X * the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of the copyright holder be used in
X * advertising or publicity pertaining to distribution of the software with
X * specific, written prior permission, and that no fee is charged for further
X * distribution of this software, or any modifications thereof.  The copyright
X * holder makes no representations about the suitability of this software for
X * any purpose.  It is provided "as is" without express or implied warranty.
X *
X * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
X * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
X * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ITS USE,
X * LOSS OF DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT,
X * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
X * THE USE OR PERFORMANCE OF THIS SOFTWARE.
X */
X
X#ifndef _StringTableConverterP_h
X#define _StringTableConverterP_h
X
X#include "StrTable.h"
X
X#define QUOTE     '\"'
X#define BACKSLASH '\\'
X
X/* Initial size of string table */
X#define INIT_SIZE 10
X
X/* Size to grow it by if necessary. */
X#define GROW_BY 10
X
X
X#endif /* _StringTableConverterP_h */
END_OF_FILE
if test 1650 -ne `wc -c <'StrTableP.h'`; then
    echo shar: \"'StrTableP.h'\" unpacked with wrong size!
fi
# end of 'StrTableP.h'
fi
if test -f 'Xdiary.ad' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Xdiary.ad'\"
else
echo shar: Extracting \"'Xdiary.ad'\" \(221 characters\)
sed "s/^X//" >'Xdiary.ad' <<'END_OF_FILE'
X*diary.width:                   267
X*diary.height:                  302
X*diary*text*autoFill:           on
X*diary*text*wrap:               word
X*diary*text*scrollHorizontal:   never
X*diary*text*scrollVertical:     always
END_OF_FILE
if test 221 -ne `wc -c <'Xdiary.ad'`; then
    echo shar: \"'Xdiary.ad'\" unpacked with wrong size!
fi
# end of 'Xdiary.ad'
fi
if test -f 'arrow_l.xbm' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'arrow_l.xbm'\"
else
echo shar: Extracting \"'arrow_l.xbm'\" \(257 characters\)
sed "s/^X//" >'arrow_l.xbm' <<'END_OF_FILE'
X#define left_arrow_width 10
X#define left_arrow_height 13
Xstatic char left_arrow_bits[] = {
X   0x00, 0x00, 0x80, 0x00, 0xc0, 0x00, 0xe0, 0x00, 0xf0, 0x00, 0xf8, 0x00,
X   0xfc, 0x00, 0xf8, 0x00, 0xf0, 0x00, 0xe0, 0x00, 0xc0, 0x00, 0x80, 0x00,
X   0x00, 0x00};
END_OF_FILE
if test 257 -ne `wc -c <'arrow_l.xbm'`; then
    echo shar: \"'arrow_l.xbm'\" unpacked with wrong size!
fi
# end of 'arrow_l.xbm'
fi
if test -f 'arrow_r.xbm' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'arrow_r.xbm'\"
else
echo shar: Extracting \"'arrow_r.xbm'\" \(260 characters\)
sed "s/^X//" >'arrow_r.xbm' <<'END_OF_FILE'
X#define right_arrow_width 10
X#define right_arrow_height 13
Xstatic char right_arrow_bits[] = {
X   0x00, 0xfc, 0x04, 0xfc, 0x0c, 0xfc, 0x1c, 0xfc, 0x3c, 0xfc, 0x7c, 0xfc,
X   0xfc, 0xfc, 0x7c, 0xfc, 0x3c, 0xfc, 0x1c, 0xfc, 0x0c, 0xfc, 0x04, 0xfc,
X   0x00, 0xfc};
END_OF_FILE
if test 260 -ne `wc -c <'arrow_r.xbm'`; then
    echo shar: \"'arrow_r.xbm'\" unpacked with wrong size!
fi
# end of 'arrow_r.xbm'
fi
if test -f 'cal.icon' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'cal.icon'\"
else
echo shar: Extracting \"'cal.icon'\" \(1596 characters\)
sed "s/^X//" >'cal.icon' <<'END_OF_FILE'
X#define calendar_width 44
X#define calendar_height 49
Xstatic char calendar_bits[] = {
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x80,0xff,0xff,0x00,0x00,0x00,0x80,0x00,0x80,0x00,0x00,0x00,
X 0xe0,0xff,0xbf,0x00,0x00,0x00,0x20,0x00,0xa0,0x00,0x00,0x00,0xf8,0xff,0xaf,
X 0x00,0x00,0x00,0x08,0x00,0xa8,0x00,0x00,0x00,0x08,0x08,0xa8,0x00,0x00,0x00,
X 0x08,0x00,0xa8,0x00,0x00,0x00,0x08,0x1c,0xa8,0x00,0x00,0x00,0x08,0x63,0xa8,
X 0x00,0x00,0x00,0x88,0xc1,0xa8,0x00,0x00,0x00,0x88,0x80,0xa9,0x00,0x00,0x00,
X 0x48,0x80,0xa9,0x06,0x00,0x00,0x08,0x80,0xa9,0x1a,0x00,0x00,0x08,0x80,0xa9,
X 0x61,0x00,0x00,0x08,0xc0,0xa8,0x81,0x01,0x00,0x08,0xc0,0xa8,0x00,0x06,0x00,
X 0x08,0x60,0xa8,0x00,0x19,0x00,0x08,0x30,0x68,0x00,0x60,0x00,0x08,0x18,0x68,
X 0xe0,0x81,0x01,0x08,0x0c,0x28,0x80,0x01,0x01,0x08,0x06,0x28,0xc0,0x80,0x00,
X 0x08,0x03,0x18,0xc0,0x80,0x00,0x88,0x01,0x19,0x60,0x40,0x00,0x88,0x00,0x09,
X 0x60,0x40,0x00,0xc8,0x80,0x09,0x30,0x20,0x00,0xc8,0xff,0x05,0x30,0x20,0x00,
X 0xc8,0xff,0x05,0x18,0x10,0x00,0x08,0x00,0x02,0x18,0x10,0x00,0x08,0x00,0x02,
X 0x0c,0x08,0x00,0xf8,0xff,0x01,0x0c,0x08,0x00,0x00,0x00,0x01,0x06,0x04,0x00,
X 0x00,0x80,0x00,0x06,0x04,0x00,0x00,0x80,0x00,0x03,0x02,0x00,0x00,0x40,0x60,
X 0x03,0x02,0x00,0x00,0xc0,0xe0,0x01,0x01,0x00,0x00,0x00,0x83,0x07,0x01,0x00,
X 0x00,0x00,0x0c,0x86,0x00,0x00,0x00,0x00,0x30,0x80,0x00,0x00,0x00,0x00,0xc0,
X 0x40,0x00,0x00,0x00,0x00,0x00,0x43,0x00,0x00,0x00,0x00,0x00,0x2c,0x00,0x00,
X 0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
END_OF_FILE
if test 1596 -ne `wc -c <'cal.icon'`; then
    echo shar: \"'cal.icon'\" unpacked with wrong size!
fi
# end of 'cal.icon'
fi
if test -f 'common.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'common.h'\"
else
echo shar: Extracting \"'common.h'\" \(1416 characters\)
sed "s/^X//" >'common.h' <<'END_OF_FILE'
X/*
X * Author: Jason Baietto, jason at ssd.csd.harris.com
X * xdiary Copyright 1990 Harris Corporation
X *
X * Permission to use, copy, modify, and distribute, this software and its
X * documentation for any purpose is hereby granted without fee, provided that
X * the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of the copyright holder be used in
X * advertising or publicity pertaining to distribution of the software with
X * specific, written prior permission, and that no fee is charged for further
X * distribution of this software, or any modifications thereof.  The copyright
X * holder makes no representations about the suitability of this software for
X * any purpose.  It is provided "as is" without express or implied warranty.
X *
X * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
X * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
X * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ITS USE,
X * LOSS OF DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT,
X * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
X * THE USE OR PERFORMANCE OF THIS SOFTWARE.
X */
X
X#define DOWNCASE(c) ( isupper((c)) ? tolower((c)) : (c) )
END_OF_FILE
if test 1416 -ne `wc -c <'common.h'`; then
    echo shar: \"'common.h'\" unpacked with wrong size!
fi
# end of 'common.h'
fi
if test -f 'diary.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'diary.h'\"
else
echo shar: Extracting \"'diary.h'\" \(1557 characters\)
sed "s/^X//" >'diary.h' <<'END_OF_FILE'
X/*
X * Author: Jason Baietto, jason at ssd.csd.harris.com
X * xdiary Copyright 1990 Harris Corporation
X *
X * Permission to use, copy, modify, and distribute, this software and its
X * documentation for any purpose is hereby granted without fee, provided that
X * the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of the copyright holder be used in
X * advertising or publicity pertaining to distribution of the software with
X * specific, written prior permission, and that no fee is charged for further
X * distribution of this software, or any modifications thereof.  The copyright
X * holder makes no representations about the suitability of this software for
X * any purpose.  It is provided "as is" without express or implied warranty.
X *
X * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
X * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
X * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ITS USE,
X * LOSS OF DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT,
X * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
X * THE USE OR PERFORMANCE OF THIS SOFTWARE.
X */
X
Xextern int init_diary();
Xextern void save_diary();
Xextern void install();
Xextern char * retrieve();
Xextern Date next_entry();
Xextern Date prev_entry();
X
X#ifdef DEBUG
Xextern void dump_diary();
X#endif
END_OF_FILE
if test 1557 -ne `wc -c <'diary.h'`; then
    echo shar: \"'diary.h'\" unpacked with wrong size!
fi
# end of 'diary.h'
fi
if test -f 'diary.icon' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'diary.icon'\"
else
echo shar: Extracting \"'diary.icon'\" \(1812 characters\)
sed "s/^X//" >'diary.icon' <<'END_OF_FILE'
X#define diary_width 43
X#define diary_height 45
X#define diary_x_hot -1
X#define diary_y_hot -1
Xstatic char diary_bits[] = {
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x00,
X   0x40, 0x01, 0x00, 0x00, 0x80, 0x00, 0xa0, 0xff, 0xff, 0xff, 0xbf, 0x00,
X   0x50, 0x00, 0x00, 0x00, 0xa0, 0x00, 0xe8, 0xff, 0xff, 0xff, 0xaf, 0x00,
X   0x18, 0x00, 0x00, 0x00, 0xa8, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xab, 0x00,
X   0x08, 0x00, 0x00, 0x00, 0xaa, 0x00, 0x08, 0x00, 0x00, 0x00, 0xaa, 0x00,
X   0x08, 0x00, 0x00, 0x00, 0xaa, 0x00, 0x88, 0x63, 0x2e, 0x22, 0xaa, 0x00,
X   0x88, 0x94, 0x24, 0x22, 0xaa, 0x00, 0x88, 0x94, 0x24, 0x14, 0xaa, 0x00,
X   0x88, 0xf4, 0x24, 0x08, 0xaa, 0x00, 0x88, 0x94, 0x24, 0x08, 0xaa, 0x00,
X   0x88, 0x93, 0xee, 0x09, 0xea, 0x00, 0x08, 0x00, 0x00, 0x00, 0xea, 0x00,
X   0x08, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x08, 0x00, 0x00, 0x00, 0xfa, 0x00,
X   0x08, 0x00, 0x00, 0xff, 0xff, 0x00, 0x08, 0x00, 0x00, 0xff, 0xff, 0x00,
X   0x08, 0x00, 0x00, 0xe7, 0xff, 0x00, 0x08, 0x00, 0x00, 0x03, 0xbf, 0x00,
X   0x08, 0x00, 0x00, 0xe7, 0xbf, 0x00, 0x08, 0x00, 0x00, 0xff, 0xaf, 0x00,
X   0x08, 0x00, 0x00, 0xff, 0xaf, 0x00, 0x08, 0x00, 0x00, 0x00, 0xaa, 0x00,
X   0x08, 0x00, 0x00, 0x00, 0xaa, 0x00, 0x08, 0x00, 0x00, 0x00, 0xaa, 0x00,
X   0x88, 0x73, 0xe6, 0x44, 0xaa, 0x00, 0x88, 0x24, 0x29, 0x45, 0xaa, 0x00,
X   0x88, 0x24, 0x29, 0x29, 0xaa, 0x00, 0x88, 0x24, 0xef, 0x10, 0xaa, 0x00,
X   0x88, 0x24, 0x29, 0x11, 0x6a, 0x00, 0x88, 0x73, 0x29, 0x11, 0x2a, 0x00,
X   0x08, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0a, 0x00,
X   0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x03, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
END_OF_FILE
if test 1812 -ne `wc -c <'diary.icon'`; then
    echo shar: \"'diary.icon'\" unpacked with wrong size!
fi
# end of 'diary.icon'
fi
if test -f 'patchlevel.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'patchlevel.h'\"
else
echo shar: Extracting \"'patchlevel.h'\" \(1379 characters\)
sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE'
X/*
X * Author: Jason Baietto, jason at ssd.csd.harris.com
X * xdiary Copyright 1990 Harris Corporation
X *
X * Permission to use, copy, modify, and distribute, this software and its
X * documentation for any purpose is hereby granted without fee, provided that
X * the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of the copyright holder be used in
X * advertising or publicity pertaining to distribution of the software with
X * specific, written prior permission, and that no fee is charged for further
X * distribution of this software, or any modifications thereof.  The copyright
X * holder makes no representations about the suitability of this software for
X * any purpose.  It is provided "as is" without express or implied warranty.
X *
X * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
X * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
X * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ITS USE,
X * LOSS OF DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT,
X * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
X * THE USE OR PERFORMANCE OF THIS SOFTWARE.
X */
X
X#define PATCHLEVEL 0
END_OF_FILE
if test 1379 -ne `wc -c <'patchlevel.h'`; then
    echo shar: \"'patchlevel.h'\" unpacked with wrong size!
fi
# end of 'patchlevel.h'
fi
if test -f 'resource.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'resource.h'\"
else
echo shar: Extracting \"'resource.h'\" \(3779 characters\)
sed "s/^X//" >'resource.h' <<'END_OF_FILE'
X/*
X * Author: Jason Baietto, jason at ssd.csd.harris.com
X * xdiary Copyright 1990 Harris Corporation
X *
X * Permission to use, copy, modify, and distribute, this software and its
X * documentation for any purpose is hereby granted without fee, provided that
X * the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of the copyright holder be used in
X * advertising or publicity pertaining to distribution of the software with
X * specific, written prior permission, and that no fee is charged for further
X * distribution of this software, or any modifications thereof.  The copyright
X * holder makes no representations about the suitability of this software for
X * any purpose.  It is provided "as is" without express or implied warranty.
X *
X * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
X * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
X * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ITS USE,
X * LOSS OF DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT,
X * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
X * THE USE OR PERFORMANCE OF THIS SOFTWARE.
X */
X
X/* Application Resources */
X
Xtypedef struct {
X   String  language;
X   String  diaryfile;
X   String  templatefile;
X   Boolean nocalendar;
X   Boolean nodiary;
X   Boolean long_opt;
X   int     abbrev;
X   Boolean fullyear;
X   Boolean singlemonth;
X} app_data_type, *app_data_ptr_type;
X
X#define XtNlanguage     "language"
X#define XtNdiaryFile    "diaryFile"
X#define XtNtemplateFile "templateFile"
X#define XtNnoCalendar   "noCalendar"
X#define XtNnoDiary      "noDiary"
X#define XtNlong         "long"
X#define XtNabbrev       "abbrev"
X#define XtNfullYear     "fullYear"
X#define XtNsingleMonth  "singleMonth"
X
X#define XtCLanguage     "Language"
X#define XtCDiaryFile    "DiaryFile"
X#define XtCTemplateFile "TemplateFile"
X#define XtCNoCalendar   "NoCalendar"
X#define XtCNoDiary      "NoDiary"
X#define XtCLong         "Long"
X#define XtCAbbrev       "Abbrev"
X#define XtCFullYear     "FullYear"
X#define XtCSingleMonth  "SingleMonth"
X
X#define offset(field) XtOffset(app_data_ptr_type, field)
XXtResource application_resources[] = {
X   {
X      XtNlanguage,
X      XtCLanguage,
X      XtRString,
X      sizeof(String),
X      offset(language),
X      XtRImmediate,
X      (XtPointer)NULL
X   },
X   {
X      XtNdiaryFile,
X      XtCDiaryFile,
X      XtRString,
X      sizeof(String),
X      offset(diaryfile),
X      XtRImmediate,
X      (XtPointer)NULL
X   },
X   {
X      XtNtemplateFile,
X      XtCTemplateFile,
X      XtRString,
X      sizeof(String),
X      offset(templatefile),
X      XtRImmediate,
X      (XtPointer)NULL
X   },
X   {
X      XtNnoCalendar,
X      XtCNoCalendar,
X      XtRBoolean,
X      sizeof(Boolean),
X      offset(nocalendar),
X      XtRImmediate,
X      (XtPointer)False
X   },
X   {
X      XtNnoDiary,
X      XtCNoDiary,
X      XtRBoolean,
X      sizeof(Boolean),
X      offset(nodiary),
X      XtRImmediate,
X      (XtPointer)False
X   },
X   {
X      XtNlong,
X      XtCLong,
X      XtRBoolean,
X      sizeof(Boolean),
X      offset(long_opt),
X      XtRImmediate,
X      (XtPointer)False
X   },
X   {
X      XtNabbrev,
X      XtCAbbrev,
X      XtRInt,
X      sizeof(int),
X      offset(abbrev),
X      XtRImmediate,
X      (XtPointer)0
X   },
X   {
X      XtNfullYear,
X      XtCFullYear,
X      XtRBoolean,
X      sizeof(Boolean),
X      offset(fullyear),
X      XtRImmediate,
X      (XtPointer)False
X   },
X   {
X      XtNsingleMonth,
X      XtCSingleMonth,
X      XtRBoolean,
X      sizeof(Boolean),
X      offset(singlemonth),
X      XtRImmediate,
X      (XtPointer)False
X   }
X};
END_OF_FILE
if test 3779 -ne `wc -c <'resource.h'`; then
    echo shar: \"'resource.h'\" unpacked with wrong size!
fi
# end of 'resource.h'
fi
if test -f 'template.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'template.c'\"
else
echo shar: Extracting \"'template.c'\" \(4381 characters\)
sed "s/^X//" >'template.c' <<'END_OF_FILE'
X/*
X * Author: Jason Baietto, jason at ssd.csd.harris.com
X * xdiary Copyright 1990 Harris Corporation
X *
X * Permission to use, copy, modify, and distribute, this software and its
X * documentation for any purpose is hereby granted without fee, provided that
X * the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of the copyright holder be used in
X * advertising or publicity pertaining to distribution of the software with
X * specific, written prior permission, and that no fee is charged for further
X * distribution of this software, or any modifications thereof.  The copyright
X * holder makes no representations about the suitability of this software for
X * any purpose.  It is provided "as is" without express or implied warranty.
X *
X * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
X * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
X * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ITS USE,
X * LOSS OF DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT,
X * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
X * THE USE OR PERFORMANCE OF THIS SOFTWARE.
X */
X
X/*
X   template.c -- routines to read and manage a diary template.
X
X   Author: Jason Baietto
X     Date: November 9, 1990
X*/
X
X
X/*---------------------------------------------------------------------------*/
X/*                               Header Files                                */
X/*---------------------------------------------------------------------------*/
X#include <stdio.h>
X#include <ctype.h>
X#include <values.h>
X#include <X11/Intrinsic.h>
X
X
X/*---------------------------------------------------------------------------*/
X/*                          Global Types And Macros                          */
X/*---------------------------------------------------------------------------*/
X#define START_LENGTH 1000
X#define GROW_LENGTH 1000
X#define EMPTYSTRING ""
X
X
X
Xstatic template_length;
X
X/*---------------------------------------------------------------------------*/
X/*                              Static Routines                              */
X/*---------------------------------------------------------------------------*/
Xstatic char * read_template(file_name)
Xchar * file_name;
X{
X   int i = 0;
X   int c = 0;
X   char * char_ptr;
X   long current_length = START_LENGTH;
X   FILE * file;
X
X   char_ptr = (char *) XtMalloc(current_length);
X
X   file = fopen(file_name, "r");
X   if (!file) {
X      return ((char *) NULL);
X   }
X
X   /* Just read the whole thing into memory to minimize file I/O time */
X   c = getc(file);
X   while (c != EOF) {
X      char_ptr[i++] = c;
X
X      if (i >= current_length) {
X         current_length += GROW_LENGTH;
X         char_ptr = (char *) XtRealloc(char_ptr, current_length);
X      }
X
X      c = getc(file);
X   }
X
X   char_ptr[i] = NULL;   
X   template_length = i;
X
X   fclose(file);
X   return(char_ptr);
X}
X
X
X
X
Xstatic char * compressed_template;
X
Xstatic char * compress(uncompressed)
Xchar * uncompressed;
X{
X   char * buffer = (char *) XtCalloc(template_length+1, sizeof(char));
X   char * compressed = buffer;
X   
X   while (*uncompressed) {
X      if (isspace(*uncompressed)) {
X         uncompressed++;
X      } else {
X         *compressed = *uncompressed;
X         compressed++;
X         uncompressed++;
X      }
X   }
X
X   return buffer;
X
X}
X
X
X
X
X
X/*---------------------------------------------------------------------------*/
X/*                              Global Routines                              */
X/*---------------------------------------------------------------------------*/
Xchar * template;
X
X
X
X
Xint init_template(file_name)
Xchar * file_name;
X{
X   template = read_template(file_name);
X
X   if (!template) {
X      /* The template specified does not exist. */
X      return FALSE;
X   }
X
X   compressed_template = compress(template);
X   return TRUE;
X}
X
X
X
X
Xint entry_modified(entry)
Xchar * entry;
X{
X   char * temp = compressed_template;
X
X   while(*entry && *temp) {
X      if (isspace(*entry)) {
X         entry++;
X      } else {
X         if (*entry != *temp) {
X            return TRUE;
X         } else {
X            entry++;
X            temp++;
X         }
X      }
X   }
X   
X   return FALSE;
X}
END_OF_FILE
if test 4381 -ne `wc -c <'template.c'`; then
    echo shar: \"'template.c'\" unpacked with wrong size!
fi
# end of 'template.c'
fi
if test -f 'template.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'template.h'\"
else
echo shar: Extracting \"'template.h'\" \(1440 characters\)
sed "s/^X//" >'template.h' <<'END_OF_FILE'
X/*
X * Author: Jason Baietto, jason at ssd.csd.harris.com
X * xdiary Copyright 1990 Harris Corporation
X *
X * Permission to use, copy, modify, and distribute, this software and its
X * documentation for any purpose is hereby granted without fee, provided that
X * the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of the copyright holder be used in
X * advertising or publicity pertaining to distribution of the software with
X * specific, written prior permission, and that no fee is charged for further
X * distribution of this software, or any modifications thereof.  The copyright
X * holder makes no representations about the suitability of this software for
X * any purpose.  It is provided "as is" without express or implied warranty.
X *
X * THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
X * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
X * EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, INDIRECT OR
X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ITS USE,
X * LOSS OF DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT,
X * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
X * THE USE OR PERFORMANCE OF THIS SOFTWARE.
X */
X
Xextern int init_template();
Xextern int entry_modified();
X
Xextern char * template;
END_OF_FILE
if test 1440 -ne `wc -c <'template.h'`; then
    echo shar: \"'template.h'\" unpacked with wrong size!
fi
# end of 'template.h'
fi
echo shar: End of archive 1 \(of 5\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 2 3 4 5 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 5 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

-- 
|===================================|===================================|
|      Jason "Jasper" Baietto       |       otteiaB "repsaJ" nosaJ      |
| Harris Computer Systems Division  |  noisiviD smetsyS retupmoC sirraH |
|     Fort Lauderdale, Florida      |      adirolF ,eladreduaL troF     |
|   jason at hcx2.ssd.csd.harris.com   |   moc.sirrah.dsc.dss.2xch at nosaj   |
|===================================|===================================|



More information about the Alt.sources mailing list