ekg2
 All Struktury Danych Pliki Funkcje Zmienne Definicje typów Wyliczenia Wartości wyliczeń Definicje Grupay Strony
Definicje | Funkcje | Zmienne
Dokumentacja pliku misc.c
#include "ekg2-config.h"
#include <ekg/win32.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <sys/time.h>
#include <arpa/inet.h>
#include <ekg/commands.h>
#include <ekg/debug.h>
#include <ekg/dynstuff.h>
#include <ekg/plugins.h>
#include <ekg/protocol.h>
#include <ekg/recode.h>
#include <ekg/sessions.h>
#include <ekg/stuff.h>
#include <ekg/themes.h>
#include <ekg/userlist.h>
#include <ekg/windows.h>
#include <ekg/xmalloc.h>
#include <ekg/queries.h>
#include "irc.h"
#include "misc.h"
#include "people.h"
#include "input.h"
#include "autoacts.h"

Definicje

#define GDEBUG
#define MARLENE
#define OMITCOLON(x)   ((*x)==':'?(x+1):(x))
#define dchar(x)   debug("%c", x);
#define IRC_TO_UPPER(x)   irc_toupper_int(x, j->casemapping)
#define IRC_TO_LOWER(x)   irc_tolower_int(x, j->casemapping)
#define IOK2(x)   param[x]?OMITCOLON(param[x]):""
#define IOK(x)   param[x]?param[x]:""
#define IOK3(x)   (x)?(x):""
#define PRINT_INFO   if (!chan || !chan->syncmode) print_info

Funkcje

static char * try_convert_string_p (const char *ps, void *cd)
static char * irc_convert_in (irc_private_t *j, const char *line)
static int do_sample_wildcard_match (const char *str, const char *matchstr, const char stopon)
static void irc_access_parse (session_t *s, channel_t *chan, people_t *p, int flags)
static int gatoi (char *buf, int *a)
static char * irc_tolower_int (char *buf, int casemapping)
int irc_parse_line (session_t *s, char *buf, int fd)
static int irc_parse_identhost (char *identhost, char **ident, char **host)
 IRC_COMMAND (irc_c_init)
 IRC_COMMAND (irc_c_error)
char * clean_channel_names (session_t *session, char *channels)
 IRC_COMMAND (irc_c_whois)
 IRC_COMMAND (irc_c_list)
 IRC_COMMAND (irc_c_ping)
 IRC_COMMAND (irc_c_nick)
 IRC_COMMAND (irc_c_msg)
 IRC_COMMAND (irc_c_join)
 IRC_COMMAND (irc_c_part)
 IRC_COMMAND (irc_c_kick)
 IRC_COMMAND (irc_c_quit)
 IRC_COMMAND (irc_c_namerpl)
 IRC_COMMAND (irc_c_topic)
 IRC_COMMAND (irc_c_invite)
 IRC_COMMAND (irc_c_mode)

Zmienne

char * sopt_keys [SERVOPTS] = { NULL, NULL, "PREFIX", "CHANTYPES", "CHANMODES", "MODES", "CHANLIMIT", "NICKLEN", "IDCHAN" }
char sopt_casemapping [] = "CASEMAPPING"
char * sopt_casemapping_values [IRC_CASEMAPPING_COUNT] = { "ascii", "rfc1459", "strict-rfc1459" }
int mode_act = 0

Dokumentacja definicji

#define dchar (   x)    debug("%c", x);
#define GDEBUG
#define IOK (   x)    param[x]?param[x]:""
#define IOK2 (   x)    param[x]?OMITCOLON(param[x]):""
#define IOK3 (   x)    (x)?(x):""
#define IRC_TO_LOWER (   x)    irc_tolower_int(x, j->casemapping)

IRC_TO_LOWER - macro around irc_upper_int, that passes currently casemapping used by server

#define IRC_TO_UPPER (   x)    irc_toupper_int(x, j->casemapping)

IRC_TO_UPPER - macro around irc_upper_int, that passes currently casemapping used by server

#define MARLENE
#define OMITCOLON (   x)    ((*x)==':'?(x+1):(x))
#define PRINT_INFO   if (!chan || !chan->syncmode) print_info

Dokumentacja funkcji

char* clean_channel_names ( session_t session,
char *  channels 
)
static int do_sample_wildcard_match ( const char *  str,
const char *  matchstr,
const char  stopon 
)
static
static int gatoi ( char *  buf,
int *  a 
)
static

int gatoi(char *buf, int *returnvalue)

Simple wrapper around strtol. Convert string pointed by buf to base 10 number, and save it in int value pointed at returnvalue.

Zwraca
0 - OK 1 - conversion failed, memory content of *number is unknown
static void irc_access_parse ( session_t s,
channel_t chan,
people_t p,
int  flags 
)
static
IRC_COMMAND ( irc_c_init  )
IRC_COMMAND ( irc_c_error  )
IRC_COMMAND ( irc_c_whois  )
IRC_COMMAND ( irc_c_list  )

irc_c_list - this function is only for evil hackers, do not touch this stuff unless you want yourself get burned :>

handling some list stuff STATS, WHO, LIST, LINKS, IVITELIST, EXCEPTLIST, BANLIST

IRC_COMMAND ( irc_c_ping  )
IRC_COMMAND ( irc_c_nick  )
IRC_COMMAND ( irc_c_msg  )
IRC_COMMAND ( irc_c_join  )
IRC_COMMAND ( irc_c_part  )
IRC_COMMAND ( irc_c_kick  )
IRC_COMMAND ( irc_c_quit  )
IRC_COMMAND ( irc_c_namerpl  )
IRC_COMMAND ( irc_c_topic  )
IRC_COMMAND ( irc_c_invite  )
IRC_COMMAND ( irc_c_mode  )
static char* irc_convert_in ( irc_private_t j,
const char *  line 
)
static
static int irc_parse_identhost ( char *  identhost,
char **  ident,
char **  host 
)
static
int irc_parse_line ( session_t s,
char *  buf,
int  fd 
)
static char* irc_tolower_int ( char *  buf,
int  casemapping 
)
static

irc_tolower_int(char *buf, int casemapping)

Converts buffer pointed at buf to lower case using one of casmapping's: IRC_CASEMAPPING_ASCII, IRC_CASEMAPPING_RFC1459, IRC_CASEMAPPING_RFC1459_STRICT

DO NOT pass strings that can be in unicode;

Zwraca
pointer to beginning of a string
static char* try_convert_string_p ( const char *  ps,
void *  cd 
)
static

Dokumentacja zmiennych

int mode_act = 0
char sopt_casemapping[] = "CASEMAPPING"
char* sopt_casemapping_values[IRC_CASEMAPPING_COUNT] = { "ascii", "rfc1459", "strict-rfc1459" }
char* sopt_keys[SERVOPTS] = { NULL, NULL, "PREFIX", "CHANTYPES", "CHANMODES", "MODES", "CHANLIMIT", "NICKLEN", "IDCHAN" }