comparison mcabber/src/jab_priv.h @ 698:60522cf6d325

Propagate context to IQ callback functions It will allow to deal with timeouts and errors more easily.
author Mikael Berthe <mikael@lilotux.net>
date Sun, 12 Feb 2006 11:06:26 +0100
parents 3c0a0a993de8
children 603b43e4f56a
comparison
equal deleted inserted replaced
697:f75972271c1f 698:60522cf6d325
21 21
22 22
23 #define IQS_DEFAULT_TIMEOUT 40 23 #define IQS_DEFAULT_TIMEOUT 40
24 #define IQS_MAX_TIMEOUT 600 24 #define IQS_MAX_TIMEOUT 600
25 25
26 #define IQS_CONTEXT_RESULT 0 /* Normal result should be zero */
27 #define IQS_CONTEXT_TIMEOUT 1
28 #define IQS_CONTEXT_ERROR 2
29
30
26 typedef struct { 31 typedef struct {
27 char *id; 32 char *id;
28 time_t ts_create; 33 time_t ts_create;
29 time_t ts_expire; 34 time_t ts_expire;
30 guint8 type; 35 guint8 type;
40 char *jidtodisp(const char *jid); 45 char *jidtodisp(const char *jid);
41 void handle_packet_iq(jconn conn, char *type, char *from, xmlnode xmldata); 46 void handle_packet_iq(jconn conn, char *type, char *from, xmlnode xmldata);
42 void display_server_error(xmlnode x); 47 void display_server_error(xmlnode x);
43 iqs *iqs_new(guint8 type, const char *ns, const char *prefix, time_t timeout); 48 iqs *iqs_new(guint8 type, const char *ns, const char *prefix, time_t timeout);
44 int iqs_del(const char *iqid); 49 int iqs_del(const char *iqid);
45 int iqs_callback(const char *iqid, xmlnode xml_anwser); 50 int iqs_callback(const char *iqid, xmlnode xml_result, guint iqcontext);
46 void iqs_check_timeout(void); 51 void iqs_check_timeout(void);
47 void iqscallback_auth(iqs *iqp, xmlnode xml_result); 52 void iqscallback_auth(iqs *iqp, xmlnode xml_result);
48 void request_version(const char *fulljid); 53 void request_version(const char *fulljid);
49 void request_time(const char *fulljid); 54 void request_time(const char *fulljid);
50 55