ekg2
 All Struktury Danych Pliki Funkcje Zmienne Definicje typów Wyliczenia Wartości wyliczeń Definicje Grupay Strony
Definicje | Funkcje | Zmienne
Dokumentacja pliku commands.c
#include "ekg2-config.h"
#include <string.h>
#include <ctype.h>
#include "commands.h"
#include "debug.h"
#include "dynstuff.h"
#include "sessions.h"
#include "stuff.h"
#include "themes.h"
#include "userlist.h"
#include "windows.h"
#include "xmalloc.h"
#include "queries.h"
#include "dynstuff_inline.h"

Definicje

#define _XOPEN_SOURCE   600
 
#define __EXTENSIONS__
 
#define _BSD_SOURCE
 

Funkcje

static int command_add_compare (command_t *data1, command_t *data2)
 
static LIST_FREE_ITEM (list_command_free, command_t *)
 
 DYNSTUFF_LIST_DECLARE_SORTED (commands, command_t, command_add_compare, list_command_free, static __DYNSTUFF_LIST_ADD_SORTED, EXPORTNOT __DYNSTUFF_LIST_REMOVE_ITER, EXPORTNOT __DYNSTUFF_LIST_DESTROY) int match_arg(const char *arg
 
 if (len=longoptlen, len)
 
void tabnick_remove (const char *nick)
 
static int cmd_forward_to_server (const char *name, const char **params, session_t *session, const char *target, int quiet)
 
static int cmd_real_quit (const char *name, const char **params, session_t *session, const char *target, int quiet)
 
static int cmd_quit (const char *name, const char **params, session_t *session, const char *target, int quiet)
 
static char * strip_spaces (char *line)
 
int command_exec (const char *target, session_t *session, const char *xline, int quiet)
 
int command_exec_format (const char *target, session_t *session, int quiet, const char *format,...)
 
int binding_help (int a, int b)
 
static const char * ekg_status_label (const int status)
 
int binding_quick_list (int a, int b)
 
static command_tcommand_find (const char *name)
 
static command_tcommand_add_c (plugin_t *plugin, const char *name, char *params, command_func_t function, int flags, char *possibilities)
 
command_tcommand_add (plugin_t *plugin, const char *name, char *params, command_func_t function, int flags, char *possibilities)
 
EXPORTNOT command_tremote_command_add (const char *name, char *params)
 
EXPORTNOT void command_init ()
 

Zmienne

char * send_nicks [SEND_NICKS_MAX] = { NULL }
 
int send_nicks_count = 0
 
int send_nicks_index = 0
 
static int quit_command = 0
 
command_tcommands = NULL
 
char shortopt
 
char const char * longopt
 
char const char int longoptlen
 
 arg
 

Dokumentacja definicji

#define __EXTENSIONS__
#define _BSD_SOURCE
#define _XOPEN_SOURCE   600

Dokumentacja funkcji

int binding_help ( int  a,
int  b 
)
int binding_quick_list ( int  a,
int  b 
)
static int cmd_forward_to_server ( const char *  name,
const char **  params,
session_t session,
const char *  target,
int  quiet 
)
static
static int cmd_quit ( const char *  name,
const char **  params,
session_t session,
const char *  target,
int  quiet 
)
static
static int cmd_real_quit ( const char *  name,
const char **  params,
session_t session,
const char *  target,
int  quiet 
)
static
command_t* command_add ( plugin_t plugin,
const char *  name,
char *  params,
command_func_t  function,
int  flags,
char *  possibilities 
)
static command_t* command_add_c ( plugin_t plugin,
const char *  name,
char *  params,
command_func_t  function,
int  flags,
char *  possibilities 
)
static
static int command_add_compare ( command_t data1,
command_t data2 
)
static
int command_exec ( const char *  target,
session_t session,
const char *  xline,
int  quiet 
)
int command_exec_format ( const char *  target,
session_t session,
int  quiet,
const char *  format,
  ... 
)

command_exec_format()

Format string in format and execute formated command Equivalent to:
char *tmp = saprintf(format, ...);
command_exec(target, session, tmp, quiet);
xfree(tmp);

Nota
For more details about string formating functions read man 3 vsnprintf
Zobacz również
command_exec() - If you want/can use non-formating function.. Watch for swaped params! (quiet with format)
Zwraca
0 - If format was NULL
-1 - If command was not found [It's result of command_exec()]
else it returns result of command handler.
static command_t* command_find ( const char *  name)
static
EXPORTNOT void command_init ( )
DYNSTUFF_LIST_DECLARE_SORTED ( commands  ,
command_t  ,
command_add_compare  ,
list_command_free  ,
static  __DYNSTUFF_LIST_ADD_SORTED,
EXPORTNOT  __DYNSTUFF_LIST_REMOVE_ITER,
EXPORTNOT  __DYNSTUFF_LIST_DESTROY 
) const
static const char* ekg_status_label ( const int  status)
static
if ( len =  longoptlen,
len   
)
static LIST_FREE_ITEM ( list_command_free  ,
command_t  
)
static
EXPORTNOT command_t* remote_command_add ( const char *  name,
char *  params 
)
static char* strip_spaces ( char *  line)
static
void tabnick_remove ( const char *  nick)

Dokumentacja zmiennych

if arg
Wartość początkowa:
{
int len = strlen(++arg)
command_t* commands = NULL
char const char* longopt
char const char int longoptlen
Wartość początkowa:
{
if (!arg || *arg != '-')
return 0
int quit_command = 0
static
char* send_nicks[SEND_NICKS_MAX] = { NULL }
int send_nicks_count = 0
int send_nicks_index = 0
char shortopt