ekg2
 All Struktury Danych Pliki Funkcje Zmienne Definicje typów Wyliczenia Wartości wyliczeń Definicje Grupay Strony
Funkcje | Zmienne
Dokumentacja pliku stuff.c
#include "ekg2-config.h"
#include <ctype.h>
#include <sys/time.h>
#include <time.h>
#include <stdarg.h>
#include <string.h>
#include "debug.h"
#include "dynstuff.h"
#include "plugins.h"
#include "stuff.h"
#include "xmalloc.h"
#include "dynstuff_inline.h"

Funkcje

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, EXPORTNOT __DYNSTUFF_LIST_REMOVE_ITER, EXPORTNOT __DYNSTUFF_LIST_DESTROY) EXPORTNOT int old_stderr
 
static LIST_FREE_ITEM (binding_free_item, struct binding *)
 
static LIST_FREE_ITEM (binding_added_free_item, binding_added_t *)
 
static __DYNSTUFF_LIST_DESTROY (bindings, struct binding, binding_free_item)
 
static __DYNSTUFF_LIST_DESTROY (bindings_added, binding_added_t, binding_added_free_item)
 
EXPORTNOT void binding_free ()
 
const char * compile_time ()
 
void iso_to_ascii (unsigned char *buf)
 
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)
 
int timer_remove (plugin_t *plugin, const char *name)
 
int isalpha_pl (unsigned char c)
 
void debug_ext (debug_level_t level, const char *format,...)
 
void debug (const char *format,...)
 
const char * ekg_status_string (const int status, const int cmd)
 
char * saprintf (const char *format,...)
 
EXPORTNOT int ekg_write (int fd, const char *buf, int len)
 

Zmienne

EXPORTNOT struct timertimers = NULL
 
struct bindingbindings = NULL
 
binding_added_tbindings_added
 
EXPORTNOT int config_make_window = 6
 
EXPORTNOT int config_debug = 1
 
EXPORTNOT char * server_console_charset
 
EXPORTNOT int config_slash_messages = 0
 
EXPORTNOT int config_default_status_window = 0
 
EXPORTNOT int config_query_commands = 0
 
EXPORTNOT int config_display_welcome = 1
 
char * config_console_charset
 
int config_send_white_lines = 0
 
int config_sort_windows = 1
 
char * config_timestamp = NULL
 
int config_timestamp_show = 1
 
int config_use_unicode
 
int config_use_iso
 
int config_display_color = 1
 
int config_history_savedups = 1
 
int config_display_pl_chars = 1
 
char * config_tab_command = NULL
 
int config_save_quit = 1
 
int config_lastlog_noitems = 0
 
int config_lastlog_case = 0
 
int config_lastlog_display_all = 0
 
char * config_completion_char = NULL
 
int config_changed = 0
 
int in_autoexec = 0
 

Dokumentacja funkcji

static __DYNSTUFF_LIST_DESTROY ( bindings  ,
struct binding  ,
binding_free_item   
)
static
static __DYNSTUFF_LIST_DESTROY ( bindings_added  ,
binding_added_t  ,
binding_added_free_item   
)
static
EXPORTNOT void binding_free ( )

binding_free()

Free memory allocated for key bindings.

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"
void debug ( const char *  format,
  ... 
)
void debug_ext ( debug_level_t  level,
const char *  format,
  ... 
)
DYNSTUFF_LIST_DECLARE2 ( timers  ,
struct timer  ,
timer_free_item  ,
static  __DYNSTUFF_LIST_ADD,
__DYNSTUFF_LIST_REMOVE_SAFE  ,
EXPORTNOT  __DYNSTUFF_LIST_REMOVE_ITER,
EXPORTNOT  __DYNSTUFF_LIST_DESTROY 
)
const char* ekg_status_string ( const int  status,
const int  cmd 
)
EXPORTNOT 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 isalpha_pl ( unsigned char  c)
void iso_to_ascii ( unsigned char *  buf)
static LIST_FREE_ITEM ( timer_free_item  ,
struct timer  
)
static
static LIST_FREE_ITEM ( binding_free_item  ,
struct binding  
)
static
static LIST_FREE_ITEM ( binding_added_free_item  ,
binding_added_t  
)
static
char* saprintf ( const char *  format,
  ... 
)
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 
)
int timer_remove ( plugin_t plugin,
const char *  name 
)
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 
)

Dokumentacja zmiennych

struct binding* bindings = NULL
binding_added_t* bindings_added
int config_changed = 0
char* config_completion_char = NULL
char* config_console_charset
EXPORTNOT int config_debug = 1
EXPORTNOT int config_default_status_window = 0
int config_display_color = 1
int config_display_pl_chars = 1
EXPORTNOT int config_display_welcome = 1
int config_history_savedups = 1
int config_lastlog_case = 0
int config_lastlog_display_all = 0
int config_lastlog_noitems = 0
EXPORTNOT int config_make_window = 6
EXPORTNOT int config_query_commands = 0
int config_save_quit = 1
int config_send_white_lines = 0
EXPORTNOT int config_slash_messages = 0
int config_sort_windows = 1
char* config_tab_command = NULL
char* config_timestamp = NULL
int config_timestamp_show = 1
int config_use_iso
int config_use_unicode
int in_autoexec = 0
EXPORTNOT char* server_console_charset
EXPORTNOT struct timer* timers = NULL