ekg2  GIT master
Definicje | Funkcje | Zmienne
Dokumentacja pliku misc.c
#include "ekg2.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 "irc.h"
#include "misc.h"
#include "people.h"
#include "input.h"
#include "autoacts.h"
Wykres zależności załączania dla misc.c:

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 void irc_parse_nick_identhost (char *line, char **nick, char **identhost)
 
static void irc_parse_ident_host (char *identhost, char **ident, char **host)
 
static void irc_convert_in (irc_private_t *j, GString *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, const char *l, int fd)
 
static int irc_c_init (session_t *s, irc_private_t *j, int fd, int ecode, char **param)
 
static int irc_c_error (session_t *s, irc_private_t *j, int fd, int ecode, char **param)
 
char * clean_channel_names (session_t *session, char *channels)
 
static int irc_c_whois (session_t *s, irc_private_t *j, int fd, int ecode, char **param)
 
static int irc_c_list (session_t *s, irc_private_t *j, int fd, int ecode, char **param)
 
static int irc_c_ping (session_t *s, irc_private_t *j, int fd, int ecode, char **param)
 
static int irc_c_nick (session_t *s, irc_private_t *j, int fd, int ecode, char **param)
 
static int irc_c_msg (session_t *s, irc_private_t *j, int fd, int ecode, char **param)
 
static int irc_c_join (session_t *s, irc_private_t *j, int fd, int ecode, char **param)
 
static int irc_c_part (session_t *s, irc_private_t *j, int fd, int ecode, char **param)
 
static int irc_c_kick (session_t *s, irc_private_t *j, int fd, int ecode, char **param)
 
static int irc_c_quit (session_t *s, irc_private_t *j, int fd, int ecode, char **param)
 
static int irc_c_namerpl (session_t *s, irc_private_t *j, int fd, int ecode, char **param)
 
static int irc_c_topic (session_t *s, irc_private_t *j, int fd, int ecode, char **param)
 
static int irc_c_invite (session_t *s, irc_private_t *j, int fd, int ecode, char **param)
 
static int irc_c_mode (session_t *s, irc_private_t *j, int fd, int ecode, char **param)
 

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

◆ dchar

#define dchar (   x)    debug("%c", x);

◆ GDEBUG

#define GDEBUG

◆ IOK

#define IOK (   x)    param[x]?param[x]:""

◆ IOK2

#define IOK2 (   x)    param[x]?OMITCOLON(param[x]):""

◆ IOK3

#define IOK3 (   x)    (x)?(x):""

◆ IRC_TO_LOWER

#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

◆ IRC_TO_UPPER

#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

◆ MARLENE

#define MARLENE

◆ OMITCOLON

#define OMITCOLON (   x)    ((*x)==':'?(x+1):(x))

◆ PRINT_INFO

#define PRINT_INFO   if (!chan || !chan->syncmode) print_info

Dokumentacja funkcji

◆ clean_channel_names()

char* clean_channel_names ( session_t session,
char *  channels 
)

◆ do_sample_wildcard_match()

static int do_sample_wildcard_match ( const char *  str,
const char *  matchstr,
const char  stopon 
)
static

◆ gatoi()

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

◆ irc_access_parse()

static void irc_access_parse ( session_t s,
channel_t chan,
people_t p,
int  flags 
)
static

◆ irc_c_error()

static int irc_c_error ( session_t s,
irc_private_t j,
int  fd,
int  ecode,
char **  param 
)
static

◆ irc_c_init()

static int irc_c_init ( session_t s,
irc_private_t j,
int  fd,
int  ecode,
char **  param 
)
static

◆ irc_c_invite()

static int irc_c_invite ( session_t s,
irc_private_t j,
int  fd,
int  ecode,
char **  param 
)
static

◆ irc_c_join()

static int irc_c_join ( session_t s,
irc_private_t j,
int  fd,
int  ecode,
char **  param 
)
static

◆ irc_c_kick()

static int irc_c_kick ( session_t s,
irc_private_t j,
int  fd,
int  ecode,
char **  param 
)
static

◆ irc_c_list()

static int irc_c_list ( session_t s,
irc_private_t j,
int  fd,
int  ecode,
char **  param 
)
static

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_c_mode()

static int irc_c_mode ( session_t s,
irc_private_t j,
int  fd,
int  ecode,
char **  param 
)
static

◆ irc_c_msg()

static int irc_c_msg ( session_t s,
irc_private_t j,
int  fd,
int  ecode,
char **  param 
)
static

◆ irc_c_namerpl()

static int irc_c_namerpl ( session_t s,
irc_private_t j,
int  fd,
int  ecode,
char **  param 
)
static

◆ irc_c_nick()

static int irc_c_nick ( session_t s,
irc_private_t j,
int  fd,
int  ecode,
char **  param 
)
static

◆ irc_c_part()

static int irc_c_part ( session_t s,
irc_private_t j,
int  fd,
int  ecode,
char **  param 
)
static

◆ irc_c_ping()

static int irc_c_ping ( session_t s,
irc_private_t j,
int  fd,
int  ecode,
char **  param 
)
static

◆ irc_c_quit()

static int irc_c_quit ( session_t s,
irc_private_t j,
int  fd,
int  ecode,
char **  param 
)
static

◆ irc_c_topic()

static int irc_c_topic ( session_t s,
irc_private_t j,
int  fd,
int  ecode,
char **  param 
)
static

◆ irc_c_whois()

static int irc_c_whois ( session_t s,
irc_private_t j,
int  fd,
int  ecode,
char **  param 
)
static

◆ irc_convert_in()

static void irc_convert_in ( irc_private_t j,
GString *  line 
)
static

◆ irc_parse_ident_host()

static void irc_parse_ident_host ( char *  identhost,
char **  ident,
char **  host 
)
static

◆ irc_parse_line()

int irc_parse_line ( session_t s,
const char *  l,
int  fd 
)

◆ irc_parse_nick_identhost()

static void irc_parse_nick_identhost ( char *  line,
char **  nick,
char **  identhost 
)
static

◆ irc_tolower_int()

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

Dokumentacja zmiennych

◆ mode_act

int mode_act = 0

◆ sopt_casemapping

char sopt_casemapping[] = "CASEMAPPING"

◆ sopt_casemapping_values

char* sopt_casemapping_values[IRC_CASEMAPPING_COUNT] = { "ascii", "rfc1459", "strict-rfc1459" }

◆ sopt_keys

char* sopt_keys[SERVOPTS] = { NULL, NULL, "PREFIX", "CHANTYPES", "CHANMODES", "MODES", "CHANLIMIT", "NICKLEN", "IDCHAN" }