/*
 * when.h:
 *
 * Copyright (c) 2000 James McKenzie <james@fishsoup.dhs.org>,
 * All rights reserved.
 *
 */

/*
 * $Id: when.h,v 1.2 2000/09/24 01:46:06 root Exp $
 */

/*
 * $Log: when.h,v $
 * Revision 1.2  2000/09/24 01:46:06  root
 * #
 *
 * Revision 1.1  2000/09/24 01:12:49  root
 * #
 *
 */

#ifndef __WHEN_H__
#define __WHEN_H__

#include <sys/time.h>

BEGIN_OBJECT (El)
     int v;
END_OBJECT (El) CREATOR (El) = (Creator (El)) Obj_DefaultCreator;
DESTRUCTOR (El) = (Destructor (El)) Obj_DefaultDestructor;


BEGIN_OBJECT (When)
     El_list year;
     El_list month;
     El_list day;
     El_list weekday;
     El_list hour;
     El_list min;
     El_list sec;
     El_list usec;

     struct timeval tv;

     void (*callback) (void *);
     void *clientdata;

END_OBJECT (When)
     extern void When_creator (When);
     extern void When_destructor (When);

CREATOR (When) = (Creator (When)) When_creator;
DESTRUCTOR (When) = (Destructor (When)) When_destructor;


#define DT_SEC 1
#define DT_MIN (DT_SEC*60)
#define DT_HOUR (DT_MIN*60)
#define DT_DAY (DT_HOUR*24)

     typedef struct
     {
       int year;
       int month;
       int day;
       int weekday;
       int hour;
       int min;
       int sec;
       int usec;
     }
Daytime;


#endif /* __WHEN_H__ */
