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
 
 if (!string||!cmd=xstrchr(string, ' '))
 
 if ((tmp=xstrchr(aname, ' ')))
 
 xfree (aname)
 
list_add xstrdup (cmd))
 
 aliases_add (a)
 
 command_add (NULL, a->name, array, cmd_alias_exec, COMMAND_ISALIAS, NULL)
 
 xfree (array)
 
 printq ("aliases_add", a->name,(""))
 
int alias_remove (const char *name, int quiet)
 
static LIST_FREE_ITEM (list_buffer_free, struct buffer *)
 
static __DYNSTUFF_ADD (static __DYNSTUFF_REMOVE_ITER(buffers, static __DYNSTUFF_REMOVE_ITER(struct buffer, NULL)
 
int buffer_add (struct buffer_info *type, const char *target, const char *line)
 
int buffer_add_str (struct buffer_info *type, const char *target, const char *str)
 
char * buffer_tail (struct buffer_info *type)
 
void buffer_free (struct buffer_info *type)
 
void changed_make_window (const char *var)
 
void changed_mesg (const char *var)
 
void changed_auto_save (const char *var)
 
void changed_display_blinking (const char *var)
 
void changed_theme (const char *var)
 
const char * compile_time ()
 
static LIST_FREE_ITEM (newconference_free_item, newconference_t *)
 
 DYNSTUFF_LIST_DECLARE (newconferences, newconference_t, newconference_free_item, static __DYNSTUFF_LIST_ADD, static __DYNSTUFF_LIST_REMOVE_SAFE, __DYNSTUFF_LIST_DESTROY) userlist_t *newconference_member_find(newconference_t *conf
 
 if (!conf||!uid) return NULL
 
 for (ul=conf->participants;ul;ul=ul->next)
 
userlist_tnewconference_member_add (newconference_t *conf, const char *uid, const char *nick)
 
int newconference_member_remove (newconference_t *conf, userlist_t *u)
 
newconference_tnewconference_find (session_t *s, const char *name)
 
newconference_tnewconference_create (session_t *s, const char *name, int create_wnd)
 
void newconference_destroy (newconference_t *conf, int kill_wnd)
 
static LIST_FREE_ITEM (conference_free_item, struct conference *)
 
 DYNSTUFF_LIST_DECLARE (conferences, struct conference, conference_free_item, static __DYNSTUFF_LIST_ADD, static __DYNSTUFF_LIST_REMOVE_ITER, __DYNSTUFF_LIST_DESTROY) struct conference *conference_add(session_t *session
 
 if (!name||!nicklist) return NULL
 
 if (nicklist[0]== ','||nicklist[xstrlen(nicklist)-1]== ',')
 
 for (i=0;nicks[i];i++)
 
 for (cf=conferences;cf;cf=cf->next)
 
memset & c (c)
 
 for (p=nicks, i=0;*p;p++)
 
 array_free (nicks)
 
 if (i!=count)
 
 printq ("conferences_add", name)
 
 tabnick_add (name)
 
 conferences_add (cf)
 
int conference_remove (const char *name, int quiet)
 
struct conferenceconference_create (session_t *session, const char *nicks)
 
struct conferenceconference_find (const char *name)
 
int conference_participant (struct conference *c, const char *uid)
 
struct conferenceconference_find_by_uids (session_t *s, const char *from, const char **recipients, int count, int quiet)
 
int conference_set_ignore (const char *name, int flag, int quiet)
 
int conference_rename (const char *oldname, const char *newname, int quiet)
 
FILE * help_path (char *name, char *plugin)
 
int ekg_hash (const char *name)
 
int mesg_set (int what)
 
char * strip_spaces (char *line)
 
int play_sound (const char *sound_path)
 
child_tchild_add (plugin_t *plugin, pid_t pid, const char *name, child_handler_t handler, void *priv_data)
 
int mkdir_recursive (const char *pathname, int isdir)
 
const char * prepare_pathf (const char *filename,...)
 
const char * prepare_path (const char *filename, int do_mkdir)
 
const char * prepare_path_user (const char *path)
 
static char * random_line (const char *path)
 
char * read_file (FILE *f, int alloc)
 
char * read_file_iso (FILE *f, int alloc)
 
const char * timestamp (const char *format)
 
const char * timestamp_time (const char *format, time_t t)
 
struct timertimer_add_ms (plugin_t *plugin, const char *name, unsigned int period, int persist, int(*function)(int, void *), void *data)
 
struct timertimer_add (plugin_t *plugin, const char *name, unsigned int period, int persist, int(*function)(int, void *), void *data)
 
struct timertimer_add_session (session_t *session, const char *name, unsigned int period, int persist, int(*function)(int, session_t *))
 
int timer_remove (plugin_t *plugin, const char *name)
 
struct timertimer_find_session (session_t *session, const char *name)
 
int timer_remove_session (session_t *session, const char *name)
 
int timer_handle_command (int type, void *data)
 
int timer_remove_user (int at)
 
char * xstrmid (const char *str, int start, int length)
 
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
 
int int append
 
command_tc
 
alias_ta = xmalloc(sizeof(struct alias))
 
char ** params = NULL
 
char * array = (params) ? array_join(params, (" ")) : xstrdup(("?"))
 
int i
 
 aname = xstrdup((*cmd == '/') ? cmd + 1 : cmd)
 
a name = xstrdup(string)
 
a commands = NULL
 
 return
 
const char * uid
 
return NULL
 
const char const char * nicklist
 
char ** nicks = array_make(nicklist, " ,", 0, 1, 0)
 
int count = array_count(nicks)
 
char ** p
 
 cf = xmemdup(&c, sizeof(c))
 
struct color_map color_map_default [26]
 
static char base64_charset []
 
struct ekg_status_info ekg_statuses []
 

Dokumentacja definicji

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

Dokumentacja funkcji

static __DYNSTUFF_ADD ( static __DYNSTUFF_REMOVE_ITER buffers,
static __DYNSTUFF_REMOVE_ITER struct buffer,
NULL   
)
static
int alias_remove ( const char *  name,
int  quiet 
)
aliases_add ( a  )
array_free ( nicks  )
char* base64_decode ( const char *  buf)
char* base64_encode ( const char *  buf,
size_t  len 
)
int buffer_add ( struct buffer_info type,
const char *  target,
const char *  line 
)

buffer_add()

Add new line to given buffer_t, if max_lines > 0 than it maintain list that we can have max: max_lines items on it.

Parametry
type- pointer to buffer beginning ptr
target- name of target.. or just name of smth we want to keep in b->target
line- line which we want to save.
Zwraca
0 - when line was successfully added to buffer, else -1 (when type was NULL)
int buffer_add_str ( struct buffer_info type,
const char *  target,
const char *  str 
)

buffer_add_str()

Add new line to given buffer_t, if max_lines > 0 than it maintain list that we can have max: max_lines items on it.

Parametry
type- pointer to buffer beginning ptr
target- name of target, or just name of smth we want to keep in b->target
str- string in format: [time_when_it_happen proper line... blah, blah] time_when_it_happen should be in digits.
Zwraca
0 - when line was successfully added to buffer, else -1 (when type was NULL, or line was in wrong format)
void buffer_free ( struct buffer_info type)

buffer_free()

Free memory after given buffer.
After it set *type to NULL

Parametry
type- pointer to buffer beginning ptr
char* buffer_tail ( struct buffer_info type)

buffer_tail()

Return oldest b->line, free b->target and remove whole buffer_t from list

Parametry
type- pointer to buffer beginning ptr
Zwraca
First b->line on the list, or NULL, if no items on list.
memset& c ( )
void changed_auto_save ( const char *  var)
void changed_display_blinking ( const char *  var)
void changed_make_window ( const char *  var)
void changed_mesg ( const char *  var)
void changed_theme ( const char *  var)
child_t* child_add ( plugin_t plugin,
pid_t  pid,
const char *  name,
child_handler_t  handler,
void *  priv_data 
)
char color_map ( unsigned char  r,
unsigned char  g,
unsigned char  b 
)
command_add ( NULL  ,
a->  name,
array  ,
cmd_alias_exec  ,
COMMAND_ISALIAS  ,
NULL   
)
const char* compile_time ( )

compile_time()

Return compilation date, and time..
Used by /version command and ekg2 –version

Zwraca
DATE" "__TIME__
For example: "Jun 21 1987" " " "22:06:47"
struct conference* conference_create ( session_t session,
const char *  nicks 
)
struct conference* conference_find ( const char *  name)
struct conference* conference_find_by_uids ( session_t s,
const char *  from,
const char **  recipients,
int  count,
int  quiet 
)
int conference_participant ( struct conference c,
const char *  uid 
)
int conference_remove ( const char *  name,
int  quiet 
)
int conference_rename ( const char *  oldname,
const char *  newname,
int  quiet 
)
int conference_set_ignore ( const char *  name,
int  flag,
int  quiet 
)
conferences_add ( cf  )
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_DECLARE ( newconferences  ,
newconference_t  ,
newconference_free_item  ,
static  __DYNSTUFF_LIST_ADD,
static  __DYNSTUFF_LIST_REMOVE_SAFE,
__DYNSTUFF_LIST_DESTROY   
)
DYNSTUFF_LIST_DECLARE ( conferences  ,
struct conference  ,
conference_free_item  ,
static  __DYNSTUFF_LIST_ADD,
static  __DYNSTUFF_LIST_REMOVE_ITER,
__DYNSTUFF_LIST_DESTROY   
)
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)
int ekg_hash ( const char *  name)
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

for ( ul  = conf->participants; ul; ul = ul->next)
for ( i  = 0; nicks[i]; i++)
for ( cf  = conferencescfcf = cf->next)
for ( p  = nicks,
i  = 0; *pp++ 
)
FILE* help_path ( char *  name,
char *  plugin 
)
if ( !string||!  cmd=xstrchr(string, ' '))
if ( (tmp=xstrchr(aname, ' '))  )
if ( !conf||!  uid)
if ( !name||!  nicklist)
if ( nicklist  [0] = = ',' || nicklist[xstrlen(nicklist) - 1] == ',')
if ( i!  = count)
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
static LIST_FREE_ITEM ( list_buffer_free  ,
struct buffer  
)
static
static LIST_FREE_ITEM ( newconference_free_item  ,
newconference_t  
)
static
static LIST_FREE_ITEM ( conference_free_item  ,
struct conference  
)
static
int mesg_set ( int  what)
int mkdir_recursive ( const char *  pathname,
int  isdir 
)

mkdir_recursive()

Create directory pathname and all needed parent directories.

Do zrobienia:
Maybe at begining of function let's check with stat() if that dir/file already exists?
Parametry
pathname- path to directory or file (see isdir comment)
isdir- if isdir is set, than we should also create dir specified by full pathname path, else we shouldn't do it, because it's filename and we want to create directory only to last '/' char
Zwraca
Like mkdir() do we return -1 on fail with errno set.
int msg_all ( session_t s,
const char *  function,
const char *  what 
)
newconference_t* newconference_create ( session_t s,
const char *  name,
int  create_wnd 
)
void newconference_destroy ( newconference_t conf,
int  kill_wnd 
)
newconference_t* newconference_find ( session_t s,
const char *  name 
)
userlist_t* newconference_member_add ( newconference_t conf,
const char *  uid,
const char *  nick 
)
int newconference_member_remove ( newconference_t conf,
userlist_t u 
)
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).
int play_sound ( const char *  sound_path)
const char* prepare_path ( const char *  filename,
int  do_mkdir 
)
const char* prepare_path_user ( const char *  path)

prepare_path_user()

Converts path given by user to absolute path.

Błąd:
Behaves correctly only with POSIX slashes, need to be modified for NO_POSIX_SYSTEM.
Parametry
path- input path.
Zwraca
Pointer to output path or NULL, if longer than PATH_MAX.
const char* prepare_pathf ( const char *  filename,
  ... 
)

prepare_pathf()

Return path to configdir/profiledir (~/.ekg2 or ~/.ekg2/$PROFILE) and append filename (formated using vsnprintf()) If length of this string is larger than PATH_MAX (4096 on Linux) than unlike prepare_path() it'll return NULL

printq ( "aliases_add"  ,
a->  name,
("")   
)
printq ( "conferences_add"  ,
name   
)
static char* random_line ( const char *  path)
static

random_line()

Open file specified by path and select by random one line from file specified by path

Parametry
path- path to file.
Zobacz również
read_file() - if you want read next line from file.
Zwraca
NULL - if file was not found or file has no line inside.
else random line founded at file,
char* read_file ( FILE *  f,
int  alloc 
)

read_file()

Read next line from file f, if needed alloc memory for it.
Remove \r and \n chars from end of line if needed.

Parametry
f- opened FILE *
alloc
  • If 0 than it return internal read_file() either xrealloc()'ed or static char with sizeof()==1024, which you MUST NOT xfree()
  • If 1 than it return strdup()'ed string this MUST xfree()
  • If -1 than it free internal pointer which were used by xrealloc()
Zwraca
Line without \r and \n which must or mustn't be xfree()'d. It depends on alloc param
char* read_file_iso ( FILE *  f,
int  alloc 
)
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)
static
char* strcasestr ( const char *  haystack,
const char *  needle 
)
char* strip_spaces ( char *  line)

strip_spaces()

strips spaces from the begining and the end of string line

Parametry
line- given string
Nota
If you pass here smth which was strdup'ed() malloc'ed() or smth which was allocated.
You must xfree() string passed, not result of this function.
Zwraca
buffer without spaces.
size_t strlen_pl ( const char *  s)
int strncasecmp_pl ( const char *  cs,
const char *  ct,
size_t  count 
)
tabnick_add ( name  )
struct timer* timer_add ( plugin_t plugin,
const char *  name,
unsigned int  period,
int  persist,
int(*)(int, void *)  function,
void *  data 
)
struct timer* timer_add_ms ( plugin_t plugin,
const char *  name,
unsigned int  period,
int  persist,
int(*)(int, void *)  function,
void *  data 
)
struct timer* timer_add_session ( session_t session,
const char *  name,
unsigned int  period,
int  persist,
int(*)(int, session_t *)  function 
)
struct timer* timer_find_session ( session_t session,
const char *  name 
)
int timer_handle_command ( int  type,
void *  data 
)
int timer_remove ( plugin_t plugin,
const char *  name 
)
int timer_remove_session ( session_t session,
const char *  name 
)
int timer_remove_user ( int  at)
const char* timestamp ( const char *  format)

timestamp()

It returns static buffer with formated current time.

Parametry
format- format to pass to strftime() [man 3 strftime]
Zwraca
if format is NULL or format == '\0' than it return ""
else it returns strftime()'d value, or "TOOLONG" if buf (sizeof(buf) == 100) was too small..
const char* timestamp_time ( const char *  format,
time_t  t 
)
static int tolower_pl ( const unsigned char  c)
static
void windows_save ( )
xfree ( aname  )
xfree ( array  )
list_add xstrdup ( cmd  )
char* xstrmid ( const char *  str,
int  start,
int  length 
)
char* xstrncat_pl ( char *  dest,
const char *  src,
size_t  n 
)
void xstrtr ( char *  text,
char  from,
char  to 
)

Dokumentacja zmiennych

list_add a = xmalloc(sizeof(struct alias))
aname = xstrdup((*cmd == '/') ? cmd + 1 : cmd)
int int append
Wartość początkowa:
{
char *cmd, *aname, *tmp
array = (params) ? array_join(params, (" ")) : xstrdup(("?"))
list_t autofinds = NULL
char base64_charset[]
static
Wartość początkowa:
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
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

return cf = xmemdup(&c, sizeof(c))
child_t* children = NULL
struct color_map color_map_default[26]
Wartość początkowa:
= {
{ 'k', 0, 0, 0 },
{ 'r', 168, 0, 0, },
{ 'g', 0, 168, 0, },
{ 'y', 168, 168, 0, },
{ 'b', 0, 0, 168, },
{ 'm', 168, 0, 168, },
{ 'c', 0, 168, 168, },
{ 'w', 168, 168, 168, },
{ 'K', 96, 96, 96 },
{ 'R', 255, 0, 0, },
{ 'G', 0, 255, 0, },
{ 'Y', 255, 255, 0, },
{ 'B', 0, 0, 255, },
{ 'M', 255, 0, 255, },
{ 'C', 0, 255, 255, },
{ 'W', 255, 255, 255, },
{ 'C', 128, 255, 255, },
{ 'G', 128, 255, 128, },
{ 'M', 255, 128, 255, },
{ 'B', 128, 128, 255, },
{ 'R', 255, 128, 128, },
{ 'Y', 255, 255, 128, },
{ 'm', 168, 128, 168, },
{ 'c', 128, 168, 168, },
{ 'g', 64, 168, 64, },
{ 'm', 128, 64, 128, }
}
a commands = 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
count = array_count(nicks)
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 i
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
c name = xstrdup(string)
newconference_t* newconferences = NULL
const char const char* nicklist
nicks = array_make(nicklist, " ,", 0, 1, 0)
return NULL
int old_stderr
char** p
char** params = NULL
const char const char int quiet
Wartość początkowa:
{
struct conference c, *cf
int quit_message_send = 0
return
struct timer* timers = NULL
const char* uid
Wartość początkowa:
{