author | Mikael Berthe <mikael@lilotux.net> |
Mon, 13 Mar 2006 19:20:03 +0100 | |
changeset 749 | 6c633adaae10 |
parent 748 | 53a000411587 |
child 753 | 584db5f21e43 |
permissions | -rw-r--r-- |
745
413e95f3051a
Introduce user "events" list
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
1 |
#ifndef __EVENTS_H__ |
413e95f3051a
Introduce user "events" list
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
2 |
#define __EVENTS_H__ 1 |
413e95f3051a
Introduce user "events" list
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
3 |
|
413e95f3051a
Introduce user "events" list
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
4 |
#include "jabglue.h" |
413e95f3051a
Introduce user "events" list
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
5 |
|
413e95f3051a
Introduce user "events" list
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
6 |
|
413e95f3051a
Introduce user "events" list
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
7 |
#define EVS_DEFAULT_TIMEOUT 90 |
747
9875bc774ddf
Event maximum timeout could be higher... Set to 5 days.
Mikael Berthe <mikael@lilotux.net>
parents:
745
diff
changeset
|
8 |
#define EVS_MAX_TIMEOUT 432000 |
745
413e95f3051a
Introduce user "events" list
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
9 |
|
748 | 10 |
#define EVS_CONTEXT_TIMEOUT 0 |
11 |
#define EVS_CONTEXT_CANCEL 1 |
|
12 |
#define EVS_CONTEXT_USER 2 |
|
745
413e95f3051a
Introduce user "events" list
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
13 |
|
749
6c633adaae10
Use events system for subscription requests
Mikael Berthe <mikael@lilotux.net>
parents:
748
diff
changeset
|
14 |
typedef enum { |
6c633adaae10
Use events system for subscription requests
Mikael Berthe <mikael@lilotux.net>
parents:
748
diff
changeset
|
15 |
EVS_TYPE_SUBSCRIPTION = 1 |
6c633adaae10
Use events system for subscription requests
Mikael Berthe <mikael@lilotux.net>
parents:
748
diff
changeset
|
16 |
} evs_type; |
6c633adaae10
Use events system for subscription requests
Mikael Berthe <mikael@lilotux.net>
parents:
748
diff
changeset
|
17 |
|
745
413e95f3051a
Introduce user "events" list
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
18 |
/* Common structure for events (evs) and IQ requests (iqs) */ |
413e95f3051a
Introduce user "events" list
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
19 |
typedef struct { |
413e95f3051a
Introduce user "events" list
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
20 |
char *id; |
413e95f3051a
Introduce user "events" list
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
21 |
time_t ts_create; |
413e95f3051a
Introduce user "events" list
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
22 |
time_t ts_expire; |
413e95f3051a
Introduce user "events" list
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
23 |
guint8 type; |
413e95f3051a
Introduce user "events" list
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
24 |
gpointer data; |
413e95f3051a
Introduce user "events" list
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
25 |
void (*callback)(); |
413e95f3051a
Introduce user "events" list
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
26 |
xmlnode xmldata; |
413e95f3051a
Introduce user "events" list
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
27 |
} eviqs; |
413e95f3051a
Introduce user "events" list
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
28 |
|
748 | 29 |
eviqs *evs_new(guint8 type, time_t timeout); |
30 |
int evs_del(const char *evid); |
|
31 |
int evs_callback(const char *evid, guint evcontext); |
|
32 |
void evs_check_timeout(time_t now_t); |
|
33 |
void evs_display_list(void); |
|
745
413e95f3051a
Introduce user "events" list
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
34 |
|
413e95f3051a
Introduce user "events" list
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
35 |
#endif /* __EVENTS_H__ */ |
413e95f3051a
Introduce user "events" list
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
36 |
|
413e95f3051a
Introduce user "events" list
Mikael Berthe <mikael@lilotux.net>
parents:
diff
changeset
|
37 |
/* vim: set expandtab cindent cinoptions=>2\:2(0: For Vim users... */ |