8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / cmd-inet / usr.lib / wpad / eloop.h
blob456f8f9831e1548373ff67be1b2ba6ec8e7e73f6
1 /*
2 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
4 */
6 /*
7 * Copyright (c) 2003-2004, Jouni Malinen <jkmaline@cc.hut.fi>
8 * Sun elects to license this software under the BSD license.
9 * See README for more details.
11 #ifndef __ELOOP_H
12 #define __ELOOP_H
14 #pragma ident "%Z%%M% %I% %E% SMI"
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
20 /* Magic number for eloop_cancel_timeout() */
21 #define ELOOP_ALL_CTX (void *) -1
22 #define MAX_POLLFDS 32
24 struct eloop_sock {
25 int sock;
26 void *eloop_data;
27 void *user_data;
28 void (*handler)(int, void *, void *);
31 struct eloop_timeout {
32 struct timeval time;
33 void *eloop_data;
34 void *user_data;
35 void (*handler)(void *, void *);
36 struct eloop_timeout *next;
39 struct eloop_signal {
40 int sig;
41 void *user_data;
42 void (*handler)(int, void *, void *);
43 int signaled;
46 struct eloop_data {
47 void *user_data;
49 int max_sock, reader_count;
50 struct eloop_sock *readers;
52 struct eloop_timeout *timeout;
54 int signal_count;
55 struct eloop_signal *signals;
56 int signaled;
58 int terminate;
61 void eloop_init(void *);
63 int eloop_register_read_sock(int,
64 void (*handler)(int, void *, void *), void *, void *);
66 void eloop_unregister_read_sock(int);
68 int eloop_register_timeout(unsigned int, unsigned int,
69 void (*handler)(void *, void *), void *, void *);
71 void eloop_cancel_timeout(void (*handler)(void *, void *), void *, void *);
72 int eloop_register_signal(int, void (*handler)(int, void *, void *), void *);
74 void eloop_run(void);
75 void eloop_terminate(void);
76 void eloop_destroy(void);
78 #ifdef __cplusplus
80 #endif
82 #endif /* __ELOOP_H */