ekg2
 All Struktury Danych Pliki Funkcje Zmienne Definicje typów Wyliczenia Wartości wyliczeń Definicje Grupay Strony
Struktury danych | Definicje | Funkcje | Zmienne
Dokumentacja pliku stuff.c
#include "ekg2-config.h"
#include "win32.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <sched.h>
#include <pwd.h>
#include <signal.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include "compat/strlcpy.h"
#include "compat/strlcat.h"
#include "debug.h"
#include "commands.h"
#include "dynstuff.h"
#include "protocol.h"
#include "stuff.h"
#include "themes.h"
#include "userlist.h"
#include "vars.h"
#include "windows.h"
#include "xmalloc.h"
#include "plugins.h"
#include "sessions.h"
#include "recode.h"
#include "dynstuff_inline.h"
#include "queries.h"

Struktury danych

struct  ekg_status_info

Definicje

#define _XOPEN_SOURCE   600
#define __EXTENSIONS__
#define __USE_BSD
#define __sq(x)   ((x)*(x))

Funkcje

static LIST_FREE_ITEM (child_free_item, child_t *)
 DYNSTUFF_LIST_DECLARE (children, child_t, child_free_item, static __DYNSTUFF_LIST_ADD, __DYNSTUFF_LIST_REMOVE_ITER, __DYNSTUFF_LIST_DESTROY) alias_t *aliases
static LIST_FREE_ITEM (timer_free_item, struct timer *)
 DYNSTUFF_LIST_DECLARE2 (timers, struct timer, timer_free_item, static __DYNSTUFF_LIST_ADD, __DYNSTUFF_LIST_REMOVE_SAFE, __DYNSTUFF_LIST_REMOVE_ITER, __DYNSTUFF_LIST_DESTROY) struct conference *conferences
void windows_save ()
static LIST_FREE_ITEM (list_alias_free, alias_t *)
 DYNSTUFF_LIST_DECLARE (aliases, alias_t, list_alias_free, static __DYNSTUFF_LIST_ADD, static __DYNSTUFF_LIST_REMOVE_ITER, __DYNSTUFF_LIST_DESTROY) int alias_add(const char *string
char color_map (unsigned char r, unsigned char g, unsigned char b)
int isalpha_pl (unsigned char c)
char * strcasestr (const char *haystack, const char *needle)
int msg_all (session_t *s, const char *function, const char *what)
int say_it (const char *str)
void debug_ext (debug_level_t level, const char *format,...)
void debug (const char *format,...)
char * base64_encode (const char *buf, size_t len)
char * base64_decode (const char *buf)
char * split_line (char **ptr)
const char * ekg_status_label (const int status, const char *descr, const char *prefix)
char * ekg_draw_descr (const int status)
void ekg_update_status (session_t *session)
static struct ekg_status_infostatus_find (const int status)
const char * ekg_status_string (const int status, const int cmd)
int ekg_status_int (const char *text)
uint32_t * ekg_sent_message_format (const char *text)
static int tolower_pl (const unsigned char c)
size_t strlen_pl (const char *s)
char * xstrncat_pl (char *dest, const char *src, size_t n)
int strncasecmp_pl (const char *cs, const char *ct, size_t count)
char * saprintf (const char *format,...)
void xstrtr (char *text, char from, char to)
void ekg_yield_cpu ()
int ekg_write (int fd, const char *buf, int len)
int ekg_writef (int fd, const char *format,...)
int ekg_close (int fd)
char * password_input (const char *prompt, const char *rprompt, const bool norepeat)
int is_utf8_string (const char *txt)

Zmienne

child_tchildren = NULL
list_t autofinds = NULL
struct timertimers = NULL
newconference_tnewconferences = NULL
struct buffer_info buffer_debug = { NULL, 0, DEBUG_MAX_LINES }
struct buffer_info buffer_speech = { NULL, 0, 50 }
int old_stderr
char * config_subject_prefix
char * config_subject_reply_prefix
int in_autoexec = 0
int config_auto_save = 0
int config_auto_user_add = 0
time_t last_save = 0
int config_display_color = 1
int config_beep = 1
int config_beep_msg = 1
int config_beep_chat = 1
int config_beep_notify = 1
char * config_console_charset
char * config_dcc_dir
int config_display_blinking = 1
int config_events_delay = 3
int config_expert_mode = 0
int config_history_savedups = 1
char * config_sound_msg_file = NULL
char * config_sound_chat_file = NULL
char * config_sound_notify_file = NULL
char * config_sound_sysmsg_file = NULL
char * config_sound_mail_file = NULL
char * config_sound_app = NULL
int config_use_unicode
int config_use_iso
int config_changed = 0
int config_display_ack = 12
int config_completion_notify = 1
char * config_completion_char = NULL
time_t ekg_started = 0
int config_display_notify = 1
char * config_theme = NULL
int config_default_status_window = 0
char * home_dir = NULL
char * config_quit_reason = NULL
char * config_away_reason = NULL
char * config_back_reason = NULL
int config_query_commands = 0
int config_slash_messages = 0
int quit_message_send = 0
int batch_mode = 0
char * batch_line = NULL
int config_make_window = 6
char * config_tab_command = NULL
int config_save_password = 1
int config_save_quit = 1
char * config_timestamp = NULL
int config_timestamp_show = 1
int config_display_sent = 1
int config_send_white_lines = 0
int config_sort_windows = 1
int config_keep_reason = 1
char * config_speech_app = NULL
int config_time_deviation = 300
int config_mesg = MESG_DEFAULT
int config_display_welcome = 1
char * config_display_color_map = NULL
char * config_session_default = NULL
int config_sessions_save = 0
int config_window_session_allow = 0
int config_windows_save = 0
char * config_windows_layout = NULL
char * config_profile = NULL
int config_debug = 1
int config_lastlog_noitems = 0
int config_lastlog_case = 0
int config_lastlog_display_all = 0
int config_version = 0
char * config_exit_exec = NULL
int config_session_locks = 0
char * config_nickname = NULL
char * last_search_first_name = NULL
char * last_search_last_name = NULL
char * last_search_nickname = NULL
char * last_search_uid = 0
int ekg2_reason_changed = 0
int quiet
static char base64_charset [] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
struct ekg_status_info ekg_statuses []

Dokumentacja definicji

#define __EXTENSIONS__
#define __sq (   x)    ((x)*(x))
#define __USE_BSD
#define _XOPEN_SOURCE   600

Dokumentacja funkcji

char* base64_decode ( const char *  buf)
char* base64_encode ( const char *  buf,
size_t  len 
)
char color_map ( unsigned char  r,
unsigned char  g,
unsigned char  b 
)
void debug ( const char *  format,
  ... 
)
void debug_ext ( debug_level_t  level,
const char *  format,
  ... 
)
DYNSTUFF_LIST_DECLARE ( children  ,
child_t  ,
child_free_item  ,
static  __DYNSTUFF_LIST_ADD,
__DYNSTUFF_LIST_REMOVE_ITER  ,
__DYNSTUFF_LIST_DESTROY   
)
DYNSTUFF_LIST_DECLARE ( aliases  ,
alias_t  ,
list_alias_free  ,
static  __DYNSTUFF_LIST_ADD,
static  __DYNSTUFF_LIST_REMOVE_ITER,
__DYNSTUFF_LIST_DESTROY   
) const
DYNSTUFF_LIST_DECLARE2 ( timers  ,
struct timer  ,
timer_free_item  ,
static  __DYNSTUFF_LIST_ADD,
__DYNSTUFF_LIST_REMOVE_SAFE  ,
__DYNSTUFF_LIST_REMOVE_ITER  ,
__DYNSTUFF_LIST_DESTROY   
)
int ekg_close ( int  fd)

ekg_close()

close fd and all watches associated with that fd

Nota:
This should be used as replacement for close() (especially in protocol plugins)
char* ekg_draw_descr ( const int  status)
uint32_t* ekg_sent_message_format ( const char *  text)
int ekg_status_int ( const char *  text)
const char* ekg_status_label ( const int  status,
const char *  descr,
const char *  prefix 
)
const char* ekg_status_string ( const int  status,
const int  cmd 
)
void ekg_update_status ( session_t session)
int ekg_write ( int  fd,
const char *  buf,
int  len 
)

ekg_write()

write data to given fd, if it cannot be done [because system buffer is too small. it'll create watch, and write as soon as possible] XXX, for now it'll always create watch. (You can be notified about state of buffer when you call ekg_write(fd, NULL, -1))

Nota:
This should be used as replacement for write()
int ekg_writef ( int  fd,
const char *  format,
  ... 
)
void ekg_yield_cpu ( )
inline

ekg_yield_cpu()

releases cpu meant to be called while busy-looping

int is_utf8_string ( const char *  txt)
int isalpha_pl ( unsigned char  c)
static LIST_FREE_ITEM ( child_free_item  ,
child_t  
)
static
static LIST_FREE_ITEM ( timer_free_item  ,
struct timer  
)
static
static LIST_FREE_ITEM ( list_alias_free  ,
alias_t  
)
static
int msg_all ( session_t s,
const char *  function,
const char *  what 
)
char* password_input ( const char *  prompt,
const char *  rprompt,
const bool  norepeat 
)

password_input()

Try to get password through UI_PASSWORD_INPUT, printing error messages if needed.

Zwraca:
Pointer to new password (which needs to be freed) or NULL, if not succeeded (wrong input / no support).
char* saprintf ( const char *  format,
  ... 
)
int say_it ( const char *  str)
char* split_line ( char **  ptr)
static struct ekg_status_info* status_find ( const int  status)
staticread
char* strcasestr ( const char *  haystack,
const char *  needle 
)
size_t strlen_pl ( const char *  s)
int strncasecmp_pl ( const char *  cs,
const char *  ct,
size_t  count 
)
static int tolower_pl ( const unsigned char  c)
static
void windows_save ( )
char* xstrncat_pl ( char *  dest,
const char *  src,
size_t  n 
)
void xstrtr ( char *  text,
char  from,
char  to 
)

Dokumentacja zmiennych

list_t autofinds = NULL
char base64_charset[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
static
char* batch_line = NULL
int batch_mode = 0
struct buffer_info buffer_debug = { NULL, 0, DEBUG_MAX_LINES }

debug buffer

struct buffer_info buffer_speech = { NULL, 0, 50 }

speech buffer

child_t* children = NULL
int config_auto_save = 0
int config_auto_user_add = 0
char* config_away_reason = NULL
char* config_back_reason = NULL
int config_beep = 1
int config_beep_chat = 1
int config_beep_msg = 1
int config_beep_notify = 1
int config_changed = 0
char* config_completion_char = NULL
int config_completion_notify = 1
char* config_console_charset
char* config_dcc_dir
int config_debug = 1
int config_default_status_window = 0
int config_display_ack = 12
int config_display_blinking = 1
int config_display_color = 1
char* config_display_color_map = NULL
int config_display_notify = 1
int config_display_sent = 1
int config_display_welcome = 1
int config_events_delay = 3
char* config_exit_exec = NULL
int config_expert_mode = 0
int config_history_savedups = 1
int config_keep_reason = 1
int config_lastlog_case = 0
int config_lastlog_display_all = 0
int config_lastlog_noitems = 0
int config_make_window = 6
int config_mesg = MESG_DEFAULT
char* config_nickname = NULL
char* config_profile = NULL
int config_query_commands = 0
char* config_quit_reason = NULL
int config_save_password = 1
int config_save_quit = 1
int config_send_white_lines = 0
char* config_session_default = NULL
int config_session_locks = 0
int config_sessions_save = 0
int config_slash_messages = 0
int config_sort_windows = 1
char* config_sound_app = NULL
char* config_sound_chat_file = NULL
char* config_sound_mail_file = NULL
char* config_sound_msg_file = NULL
char* config_sound_notify_file = NULL
char* config_sound_sysmsg_file = NULL
char* config_speech_app = NULL
char* config_subject_prefix
char* config_subject_reply_prefix
char* config_tab_command = NULL
char* config_theme = NULL
int config_time_deviation = 300
char* config_timestamp = NULL
int config_timestamp_show = 1
int config_use_iso
int config_use_unicode
int config_version = 0
int config_window_session_allow = 0
char* config_windows_layout = NULL
int config_windows_save = 0
int ekg2_reason_changed = 0
time_t ekg_started = 0
struct ekg_status_info ekg_statuses[]
Wartość początkowa:
{
{ EKG_STATUS_ERROR, "error" },
{ EKG_STATUS_BLOCKED, "blocking" },
{ EKG_STATUS_UNKNOWN, "unknown" },
{ EKG_STATUS_NA, "notavail" },
{ EKG_STATUS_INVISIBLE,"invisible" },
{ EKG_STATUS_DND, "dnd" },
{ EKG_STATUS_GONE, "gone" },
{ EKG_STATUS_XA, "xa" },
{ EKG_STATUS_AWAY, "away" },
{ EKG_STATUS_AVAIL, "avail", "back", },
{ EKG_STATUS_FFC, "chat", "ffc" },
{ EKG_STATUS_AUTOAWAY, "autoaway" },
{ EKG_STATUS_AUTOXA, "autoxa" },
{ EKG_STATUS_AUTOBACK, "autoback" },
}
char* home_dir = NULL
int in_autoexec = 0
time_t last_save = 0
char* last_search_first_name = NULL
char* last_search_last_name = NULL
char* last_search_nickname = NULL
char* last_search_uid = 0
newconference_t* newconferences = NULL
int old_stderr
int quiet
int quit_message_send = 0
struct timer* timers = NULL