channel.c File Reference

#include "stdinc.h"
#include "server.h"

Go to the source code of this file.

Functions

int findcmode_bysymbol (char *symbol)
Channelnew_chan (char *chan)
Channelfind_channel (char *chan)
int in_channel (User *user, Channel *ch)
void AddToChannel (char *user, Channel *c)
void AddToChannelU (User *user, Channel *c)
void KickFromChannel (User *u, Channel *c, char *message)
void DelFromChannel (User *user, Channel *c)
struct ChanUsernew_chanuser (User *user)
struct ChanUserfind_chanuser (User *u, Channel *c)
char * create_sjoin_nicklist (Channel *c)
char * create_chanmode_string (Channel *c)
void read_chanmode_string (Channel *c, char *modes, char **params)

Variables

Channelchan_list
struct CMode ircd_cmodes [128]

Function Documentation

void AddToChannel ( char *  user,
Channel c 
)
void AddToChannelU ( User *  user,
Channel c 
)
char* create_chanmode_string ( Channel c  ) 
char* create_sjoin_nicklist ( Channel c  ) 

Definition at line 432 of file channel.c.

References DLINK_FOREACH, ChanUser::op, strlcat(), ChanUser::user, and Channel::users.

void DelFromChannel ( User *  user,
Channel c 
)
Channel* find_channel ( char *  chan  ) 

Find a channel structure within the list by channel name.

Parameters:
chan Channel name
Returns:
Channel* Return the structure we found, or NULL if it cant be found or we fail for w/e reason.

Definition at line 146 of file channel.c.

References channels, DLINK_FOREACH, and Channel::name.

Referenced by foo_connect(), new_chan(), and sendto_socket().

struct ChanUser* find_chanuser ( User *  u,
Channel c 
) [read]

Definition at line 413 of file channel.c.

References DLINK_FOREACH, ChanUser::user, and Channel::users.

Referenced by DelFromChannel(), and KickFromChannel().

int findcmode_bysymbol ( char *  symbol  ) 

Find a mode string by its retrospective symbol

Parameters:
symbol Symbol of the mode we are searching for.
Returns:
return the location of the mode within our supported mode structure or -1 if the mode isnt supported or we failed for whatever reason.

Definition at line 58 of file channel.c.

Referenced by AddToChannel().

int in_channel ( User *  user,
Channel ch 
)

Check if a user is in a channel.

Parameters:
user User we are checking for.
ch Channel we are checking against.
Returns:
True if the user is within channel, or false if user is not.

Definition at line 178 of file channel.c.

References DLINK_FOREACH, and Channel::name.

Referenced by AddToChannel(), and AddToChannelU().

void KickFromChannel ( User *  u,
Channel c,
char *  message 
)
Channel* new_chan ( char *  chan  ) 

Allocate a new channel structure as well as initialize the defaults for that channel.

Parameters:
chan the name of the channel we are creating a structure for
Returns:
Channel* Return a pointer to the channel structure regardless. if the channel already exsists return a pointer to that as well.

Definition at line 88 of file channel.c.

References alog(), Channel::audit, channels, Channel::channelts, dlink_add_tail(), dlink_create(), Channel::external, find_channel(), Channel::flood, Channel::haskey, Channel::invite, Channel::limit, Channel::linked, Channel::name, Channel::onlyoptopic, Channel::operonly, Channel::priv, Channel::registered, Channel::regonly, Channel::ssl, strlcpy(), Channel::unknownmodes, Channel::usercnt, and Channel::users.

Referenced by foo_connect().

struct ChanUser* new_chanuser ( User *  user  )  [read]
void read_chanmode_string ( Channel c,
char *  modes,
char **  params 
)

Work our the nasty SJOIN params (mainly keys and limits)

Definition at line 517 of file channel.c.

References Channel::external, Channel::haskey, Channel::key, Channel::limit, Channel::onlyoptopic, s_assert, strlcat(), strlcpy(), and Channel::unknownmodes.


Variable Documentation

Definition at line 14 of file extern.h.

struct CMode ircd_cmodes[128]
Initial value:
 {
    { "q",    1,    1,      "~"  },  
    { "a",    1,    1,      "&"  },  
    { "o",    1,    1,      "@"  },  
    { "h",    1,    1,      "%"  },  
    { "v",    1,    1,      "+"  },  

    { "n",    0,    0,      0    },  
    { "t",    0,    0,      0    },  
    { "r",    0,    0,      0    },  
    { "p",    0,    0,      0    },  
    { "k",    1,    0,      0    },  
    { "l",    1,    0,      0    },  
    { NULL,   0,    0,      NULL }
}

Definition at line 31 of file channel.c.

Generated on Mon Jul 19 21:53:04 2010 for Omega Security Services by  doxygen 1.6.3