home *** CD-ROM | disk | FTP | other *** search
- /*
- * monthnam.c
- * contains: monthname(),wkday()
- *
- * Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
- */
-
- #include <stdio.h>
- #include "gfuncts.h"
-
- /*
- * char *
- * monthname(n)
- *
- * ARGUMENT
- * (int) n - month number, 1==January etc.
- *
- * DESCRIPTION
- * Given the integer value for the month (1=january etc) return
- * a pointer to a string containing the name of the month.
- *
- * RETURNS
- * Pointer to string containing the month name.
- */
- char* GF_CONV monthname(n)
- int n;
- {
- static char *name[] = {
- "illegal month","January","February","March","April",
- "May","June","July","August","September",
- "October","November","December"
- };
- return((n<1||n>12)?name[0]:name[n]);
- }
-
- /*
- * char *
- * wkday(iday)
- *
- * ARGUMENT
- * (int) iday - Integer value of day of week, 1==MONDAY
- *
- * DESCRIPTION
- * Given the integer value of the day of week (1=MONDAY, 2=TUESDAY,
- * 3=WEDNESDAY etc. return pointer to string containing the name of
- * the day.
- *
- * RETURNS
- * Pointer to string name of day.
- */
- char* GF_CONV wkday(iday)
- int iday;
- {
- static char *day_tab[] = {
- "Sunday","Monday","Tuesday","Wednesday",
- "Thursday","Friday","Saturday","illegal day" };
- return day_tab[iday];
- }
-