clock.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* Copyright (c) 1998-2001, 2004 Sendmail, Inc. and its suppliers.
* All rights reserved.
* Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* By using this file, you agree to the terms and conditions set
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*
* $Id: clock.h,v 1.12 2004/08/03 19:57:21 ca Exp $
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
** CLOCK.H -- for co-ordinating timed events
*/
#ifndef _SM_CLOCK_H
# define _SM_CLOCK_H 1
# if SM_CONF_SETITIMER
# endif /* SM_CONF_SETITIMER */
/*
** STRUCT SM_EVENT -- event queue.
**
** Maintained in sorted order.
**
** We store the pid of the process that set this event to insure
** that when we fork we will not take events intended for the parent.
*/
struct sm_event
{
# if SM_CONF_SETITIMER
# else /* SM_CONF_SETITIMER */
# endif /* SM_CONF_SETITIMER */
/* function to call */
int ev_arg; /* argument to ev_func */
};
/* functions */
extern void sm_clear_events __P((void));
/*
** SM_SETEVENT -- set an event to happen at a specific time in seconds.
**
** Translates the seconds into millseconds and calls sm_seteventm()
** to get a specific event to happen in the future at a specific time.
**
** Parameters:
** t -- intvl until next event occurs (seconds).
** f -- function to call on event.
** a -- argument to func on event.
**
** Returns:
** result of sm_seteventm().
**
** Side Effects:
** Any that sm_seteventm() have.
*/
#endif /* _SM_CLOCK_H */