summaryrefslogtreecommitdiffstats
path: root/src/util/events.h
blob: b7f20471cc9a8c221c62bc76f77ecb1c62d02aea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef _EVENTS_H_INCLUDED_
#define _EVENTS_H_INCLUDED_

/*++
/* NAME
/*	events 3h
/* SUMMARY
/*	event manager
/* SYNOPSIS
/*	#include <events.h>
/* DESCRIPTION
/* .nf

 /*
  * System library.
  */
#include <time.h>

 /*
  * External interface.
  */
typedef void (*EVENT_NOTIFY_FN) (int, void *);

#define EVENT_NOTIFY_TIME_FN EVENT_NOTIFY_FN	/* legacy */
#define EVENT_NOTIFY_RDWR_FN EVENT_NOTIFY_FN	/* legacy */

extern time_t event_time(void);
extern void event_enable_read(int, EVENT_NOTIFY_RDWR_FN, void *);
extern void event_enable_write(int, EVENT_NOTIFY_RDWR_FN, void *);
extern void event_disable_readwrite(int);
extern time_t event_request_timer(EVENT_NOTIFY_TIME_FN, void *, int);
extern int event_cancel_timer(EVENT_NOTIFY_TIME_FN, void *);
extern void event_loop(int);
extern void event_drain(int);
extern void event_fork(void);

 /*
  * Event codes.
  */
#define EVENT_READ	(1<<0)		/* read event */
#define EVENT_WRITE	(1<<1)		/* write event */
#define EVENT_XCPT	(1<<2)		/* exception */
#define EVENT_TIME	(1<<3)		/* timer event */

#define EVENT_ERROR	EVENT_XCPT

 /*
  * Dummies.
  */
#define EVENT_NULL_TYPE		(0)
#define EVENT_NULL_CONTEXT	((void *) 0)
#define EVENT_NULL_DELAY	(0)

/* LICENSE
/* .ad
/* .fi
/*	The Secure Mailer license must be distributed with this software.
/* AUTHOR(S)
/*	Wietse Venema
/*	IBM T.J. Watson Research
/*	P.O. Box 704
/*	Yorktown Heights, NY 10598, USA
/* CREATION DATE
/*	Wed Jan 29 17:00:03 EST 1997
/*--*/

#endif