#include <time.h>#include "dynstuff.h"Go to the source code of this file.
| #define EKG_STATUS_IS_AVAIL | ( | x | ) | (x >= EKG_STATUS_AVAIL) |
| #define EKG_STATUS_IS_AWAY | ( | x | ) | ((x > EKG_STATUS_NA) && (x < EKG_STATUS_AVAIL)) |
| #define EKG_STATUS_IS_NA | ( | x | ) | (x <= EKG_STATUS_NA) |
| #define EKG_STATUS_IS_NODELIVERY | ( | x | ) | (x < EKG_STATUS_UNKNOWN) |
| #define session_alias_uid_n | ( | a | ) | session_alias_uid(session_find(a)) |
| #define session_format_n | ( | a | ) | session_format(session_find(a)) |
| #define session_status_get_n | ( | a | ) | session_status_get(session_find(a)) |
| typedef struct session_param session_param_t |
| typedef struct ekg_session session_t |
session_t contains all information about session
| enum status_t |
status_t - user's current status, as prioritized enum
| session_t* session_add | ( | const char * | uid | ) |
Add session with uid to session list.
Check by plugin_find_uid() if any plugin can handle this type of session if not return NULL
Allocate memory for variables, switch windows.. etc, etc..
Emit global SESSION_ADDED plugin which handle this session can alloc memory for his private data
| uid | - full uid of new session |
| const char* session_alias_get | ( | session_t * | s | ) |
| int session_alias_set | ( | session_t * | s, | |
| const char * | alias | |||
| ) |
| int session_check | ( | session_t * | s, | |
| int | need_private, | |||
| const char * | protocol | |||
| ) |
| int session_connected_get | ( | session_t * | s | ) |
| int session_connected_set | ( | session_t * | s, | |
| int | connected | |||
| ) |
| const char* session_descr_get | ( | session_t * | s | ) |
| int session_descr_set | ( | session_t * | s, | |
| const char * | descr | |||
| ) |
| session_t* session_find | ( | const char * | uid | ) |
It's search over sessions list and checks if we have session with uid uid
| uid | - uid of session you look for |
it's search over sessions list and checks if param s is in that list. it's useful for all watch handler, and if programmer was too lazy to destroy watches associated with that session (in private watch data struct) before it gone.
| s | - session to look for. |
| const char* session_format | ( | session_t * | s | ) |
| const char* session_get | ( | session_t * | s, | |
| const char * | key | |||
| ) |
| void session_help | ( | session_t * | s, | |
| const char * | name | |||
| ) |
| int session_int_get | ( | session_t * | s, | |
| const char * | key | |||
| ) |
| int session_int_set | ( | session_t * | s, | |
| const char * | key, | |||
| int | value | |||
| ) |
| int session_is_var | ( | session_t * | s, | |
| const char * | key | |||
| ) |
| const char* session_name | ( | session_t * | s | ) |
| const char* session_password_get | ( | session_t * | s | ) |
It's decrypt ,,encrypted''(and return) using base64 from session struct (s->password) is s was passed, otherwise it cleanup decrypted password from internal buffer.
session_get() - session_get() can be used to get password also... but it's just a wrapper with several xstrcmp() to this function so it's slower. Instead of using session_get(session, "password") it's better If you use: session_password_get(session)
| s | - session of which we want get password from or NULL if we want to erase internal buf with password |
| int session_password_set | ( | session_t * | s, | |
| const char * | password | |||
| ) |
| void* session_private_get | ( | session_t * | s | ) |
| int session_private_set | ( | session_t * | s, | |
| void * | priv | |||
| ) |
| int session_read | ( | const char * | filename | ) |
| int session_remove | ( | const char * | uid | ) |
Remove session with uid passed in uid
This function free session params variable and internal
session data like alias, current status, descr, password..
If sesssion is connected, /disconnect command will be executed with session uid as reason
Also it remove watches connected with this session (if watch->is_session && watch->data == s)br> It'll do window->session swapping if needed... and changing current session also.
Current ekg2 API have got session watches. Use watch_add_session()
Current ekg2 API have got timer watches. Use timer_add_session()
| uid | - uid of session to remove |
| int session_set | ( | session_t * | s, | |
| const char * | key, | |||
| const char * | value | |||
| ) |
| int session_status_get | ( | session_t * | s | ) |
| const char* session_uid_get | ( | session_t * | s | ) |
| int session_unidle | ( | session_t * | s | ) |
| int session_write | ( | ) |
| void sessions_free | ( | ) |
1.5.1