#include "../../str.h"#include "xjab_base.h"


Go to the source code of this file.
Data Structures | |
| struct | _xj_pres_cell |
| struct | _xj_pres_list |
Defines | |
| #define | XJ_PRES_STATUS_NULL 0 |
| #define | XJ_PRES_STATUS_SUBS 1 |
| #define | XJ_PRES_STATUS_WAIT 2 |
| #define | XJ_PS_CHECK -1 |
| #define | XJ_PS_OFFLINE 0 |
| #define | XJ_PS_ONLINE 1 |
| #define | XJ_PS_REFUSED 3 |
| #define | XJ_PS_TERMINATED 2 |
Typedefs | |
| typedef struct _xj_pres_cell | t_xj_pres_cell |
| typedef struct _xj_pres_list | t_xj_pres_list |
| typedef struct _xj_pres_cell * | xj_pres_cell |
| typedef struct _xj_pres_list * | xj_pres_list |
Functions | |
| void | xj_pres_cell_free (xj_pres_cell) |
| void | xj_pres_cell_free_all (xj_pres_cell) |
| int | xj_pres_cell_init (xj_pres_cell, str *, pa_callback_f, void *) |
| xj_pres_cell | xj_pres_cell_new (void) |
| int | xj_pres_cell_update (xj_pres_cell, pa_callback_f, void *) |
| xj_pres_cell | xj_pres_list_add (xj_pres_list, xj_pres_cell) |
| xj_pres_cell | xj_pres_list_check (xj_pres_list, str *) |
| int | xj_pres_list_del (xj_pres_list, str *) |
| void | xj_pres_list_free (xj_pres_list) |
| xj_pres_list | xj_pres_list_init (void) |
| void | xj_pres_list_notifyall (xj_pres_list, int) |
| #define XJ_PRES_STATUS_NULL 0 |
| #define XJ_PRES_STATUS_SUBS 1 |
Definition at line 38 of file xjab_presence.h.
| #define XJ_PRES_STATUS_WAIT 2 |
| #define XJ_PS_CHECK -1 |
| #define XJ_PS_OFFLINE 0 |
Definition at line 32 of file xjab_presence.h.
Referenced by xj_manage_jab(), xj_pres_cell_new(), and xj_worker_check_watcher().
| #define XJ_PS_ONLINE 1 |
| #define XJ_PS_REFUSED 3 |
| #define XJ_PS_TERMINATED 2 |
| typedef struct _xj_pres_cell t_xj_pres_cell |
| typedef struct _xj_pres_list t_xj_pres_list |
| typedef struct _xj_pres_cell * xj_pres_cell |
| typedef struct _xj_pres_list * xj_pres_list |
| void xj_pres_cell_free | ( | xj_pres_cell | prc | ) |
free the presence cell
Definition at line 61 of file xjab_presence.c.
References NULL, pkg_free, _str::s, and _xj_pres_cell::userid.
Referenced by xj_manage_jab(), xj_pres_cell_free_all(), xj_pres_list_add(), xj_pres_list_del(), and xj_worker_check_watcher().
| void xj_pres_cell_free_all | ( | xj_pres_cell | prc | ) |
free all presence cell linked to
Definition at line 74 of file xjab_presence.c.
References _xj_pres_cell::next, and xj_pres_cell_free().
Referenced by xj_pres_list_free().
| int xj_pres_cell_init | ( | xj_pres_cell | prc, | |
| str * | uid, | |||
| pa_callback_f | f, | |||
| void * | p | |||
| ) |
init a presence cell
Definition at line 91 of file xjab_presence.c.
References _xj_pres_cell::cbf, _xj_pres_cell::cbp, _xj_pres_cell::key, _str::len, NULL, pkg_malloc, _str::s, _xj_pres_cell::userid, and xj_get_hash().
Referenced by xj_manage_jab(), and xj_worker_check_watcher().
| xj_pres_cell xj_pres_cell_new | ( | void | ) |
create a presence cell
Definition at line 39 of file xjab_presence.c.
References _xj_pres_cell::cbf, _xj_pres_cell::cbp, _xj_pres_cell::key, _str::len, _xj_pres_cell::next, NULL, pkg_malloc, _xj_pres_cell::prev, _str::s, _xj_pres_cell::state, _xj_pres_cell::status, _xj_pres_cell::userid, XJ_PRES_STATUS_NULL, and XJ_PS_OFFLINE.
Referenced by xj_manage_jab(), and xj_worker_check_watcher().
| int xj_pres_cell_update | ( | xj_pres_cell | prc, | |
| pa_callback_f | f, | |||
| void * | p | |||
| ) |
update attributes for a presence cell
Definition at line 109 of file xjab_presence.c.
References _xj_pres_cell::cbf, and _xj_pres_cell::cbp.
Referenced by xj_worker_check_watcher().
| xj_pres_cell xj_pres_list_add | ( | xj_pres_list | prl, | |
| xj_pres_cell | prc | |||
| ) |
add, if does not exist, an user in present list
Definition at line 149 of file xjab_presence.c.
References _xj_pres_cell::cbf, _xj_pres_cell::cbp, _xj_pres_list::clist, _xj_pres_cell::key, _str::len, _xj_pres_cell::next, _xj_pres_list::nr, NULL, _xj_pres_cell::prev, _str::s, _xj_pres_cell::userid, and xj_pres_cell_free().
Referenced by xj_manage_jab(), and xj_worker_check_watcher().
| xj_pres_cell xj_pres_list_check | ( | xj_pres_list | prl, | |
| str * | uid | |||
| ) |
Check if a user is already in presence list
Definition at line 233 of file xjab_presence.c.
References _xj_pres_list::clist, _xj_pres_cell::key, _str::len, _xj_pres_cell::next, _xj_pres_list::nr, NULL, _str::s, _xj_pres_cell::userid, and xj_get_hash().
Referenced by xj_manage_jab(), and xj_worker_check_watcher().
| int xj_pres_list_del | ( | xj_pres_list | prl, | |
| str * | uid | |||
| ) |
delete a user from presence list
Definition at line 197 of file xjab_presence.c.
References _xj_pres_list::clist, _xj_pres_cell::key, _str::len, _xj_pres_cell::next, _xj_pres_list::nr, NULL, _xj_pres_cell::prev, _str::s, _xj_pres_cell::userid, xj_get_hash(), and xj_pres_cell_free().
| void xj_pres_list_free | ( | xj_pres_list | prl | ) |
free the presence list
Definition at line 137 of file xjab_presence.c.
References _xj_pres_list::clist, NULL, pkg_free, and xj_pres_cell_free_all().
Referenced by xj_jcon_free().
| xj_pres_list xj_pres_list_init | ( | void | ) |
init a presence list
Definition at line 121 of file xjab_presence.c.
References _xj_pres_list::clist, _xj_pres_list::nr, NULL, and pkg_malloc.
Referenced by xj_jcon_init().
| void xj_pres_list_notifyall | ( | xj_pres_list | prl, | |
| int | s | |||
| ) |
Notify all users from list
Definition at line 256 of file xjab_presence.c.
References _xj_pres_cell::cbf, _xj_pres_cell::cbp, _xj_pres_list::clist, _xj_pres_cell::next, _xj_pres_list::nr, NULL, _xj_pres_cell::state, _xj_pres_cell::userid, and XJ_PS_CHECK.
Referenced by xj_worker_check_jcons().
1.5.6