include/events.h
changeset 79 05328c643696
child 81 9008e2daa1b1
equal deleted inserted replaced
78:1253cacc0f21 79:05328c643696
       
     1 #ifndef __EVENTS_H__
       
     2 #define __EVENTS_H__ 1
       
     3 
       
     4 #include "xmpp.h"
       
     5 #include "config.h" // MODULES_ENABLE
       
     6 
       
     7 
       
     8 #define EVS_DEFAULT_TIMEOUT 90
       
     9 #define EVS_MAX_TIMEOUT     432000
       
    10 
       
    11 #define EVS_CONTEXT_TIMEOUT 0U
       
    12 #define EVS_CONTEXT_CANCEL  1U
       
    13 #define EVS_CONTEXT_USER    2U
       
    14 
       
    15 typedef enum {
       
    16   EVS_TYPE_SUBSCRIPTION = 1,
       
    17   EVS_TYPE_INVITATION = 2,
       
    18 #ifdef MODULES_ENABLE
       
    19   EVS_TYPE_USER = 3,
       
    20 #endif
       
    21 } evs_type;
       
    22 
       
    23 /* Common structure for events (evs) and IQ requests (iqs) */
       
    24 typedef struct {
       
    25   char *id;
       
    26   time_t ts_create;
       
    27   time_t ts_expire;
       
    28   guint8 type;
       
    29   gpointer data;
       
    30   int (*callback)();
       
    31   char *desc;
       
    32 } eviqs;
       
    33 
       
    34 typedef struct {
       
    35   char* to;
       
    36   char* from;
       
    37   char* passwd;
       
    38   char* reason;
       
    39 } event_muc_invitation;
       
    40 
       
    41 eviqs   *evs_new(guint8 type, time_t timeout);
       
    42 int      evs_del(const char *evid);
       
    43 int      evs_callback(const char *evid, guint evcontext);
       
    44 gboolean evs_check_timeout();
       
    45 void     evs_display_list(void);
       
    46 GSList  *evs_geteventslist(int forcompl);
       
    47 
       
    48 #endif /* __EVENTS_H__ */
       
    49 
       
    50 /* vim: set expandtab cindent cinoptions=>2\:2(0:  For Vim users... */