
/* 
 * File: teatime.h
 *       Part of the ever expanding tea time library.
 *
 * Decsription: This file is a header that contains some function
 *              declarations and some random numbers.
 *
 * Author: Tom Coppeto  11/10/89
 *
 * $Source: /afs/net.mit.edu/tools/src/tea/RCS/teatime.h,v $
 * $Author: tom $  
 * $Locker:  $
 * $Log:	teatime.h,v $
 * Revision 2.0  90/05/23  13:05:43  tom
 * *** empty log message ***
 * 
 * Revision 1.3  90/05/21  17:11:34  tom
 * *** empty log message ***
 * 
 * Revision 1.2  89/12/17  17:42:59  tjcoppet
 * changed <time.h> to <sys/time.h>
 * 
 * Revision 1.1  89/11/13  20:50:30  tjcoppet
 * Initial revision
 * 
 * $Header: /afs/net.mit.edu/tools/src/tea/RCS/teatime.h,v 2.0 90/05/23 13:05:43 tom Exp $
 */


#include <sys/time.h>

/* Should probably have command line options to override these defaults */


#define SECONDS_IN_MINUTE 60
#define MINUTES_IN_HOUR   60
#define HOURS_IN_DAY      24
#define DAYS_IN_WEEK       7

#define SECONDS_IN_DAY       86400
#define SECONDS_IN_YEAR      31536000
#define SECONDS_IN_LEAP_YEAR 31622400

#define TMNULL (-1)     /* Items not specified are given this value
                         * in order to distinguish null specs from zero
                         * specs.  This is only used by partime and
                         * maketime. */
#define TM_SEC 0        /* 0-59                 */
#define TM_MIN 1        /* 0-59                 */
#define TM_HOUR 2       /* 0-23                 */
#define TM_MDAY 3       /* 1-31                 day of month */
#define TM_DAY TM_MDAY  /*  "                   synonym      */
#define TM_MON 4        /* 0-11                 */
#define TM_YEAR 5       /* (year-1900) (year)   */
#define TM_WDAY 6       /* 0-6                  day of week (0 = Sunday) */
#define TM_YDAY 7       /* 0-365                day of year */
#define TM_ISDST 8      /* 0 Std, 1 DST         */
        /* New stuff */
#define TM_ZON 9        /* 0-(24*60) minutes west of Greenwich */
#define TM_AMPM 10      /* 1 AM, 2 PM           */

void   tt_min_offset();
void   tt_hour_offset();
void   tt_day_offset();
void   tt_week_offset();

void   tt_sec_offset();
long   tt_tmtoseconds();
char   *tt_format();
char   *tt_month();
char   *tt_wday();

#define tt_parse(str,ret) partime(str,ret)
#define isleap(y) (((y) % 4) == 0 && ((y) % 100) != 0 || ((y) % 400) == 0)
